Ravel: Difference between revisions
Jump to navigation
Jump to search
→Description
Miraheze>Marshall |
Miraheze>Marshall |
||
Line 51: | Line 51: | ||
The ravel of an array <code>A</code> has shape <code>,×/⍴A</code> and shares elements with <code>A</code>. Thus Ravel may be modelled as a [[Reshape|reshaping]] function <code>{(×/⍴⍵)⍴⍵}</code>. The [[element]] with [[index]] [[vector]] <code>I</code> is moved to index <code>(⍴A)⊥I</code> in [[index origin]] 0, or <code>⎕IO+(⍴A)⊥I-⎕IO</code> in arbitrary index origin. | The ravel of an array <code>A</code> has shape <code>,×/⍴A</code> and shares elements with <code>A</code>. Thus Ravel may be modelled as a [[Reshape|reshaping]] function <code>{(×/⍴⍵)⍴⍵}</code>. The [[element]] with [[index]] [[vector]] <code>I</code> is moved to index <code>(⍴A)⊥I</code> in [[index origin]] 0, or <code>⎕IO+(⍴A)⊥I-⎕IO</code> in arbitrary index origin. | ||
As with any reshaping, the result of Ravel has the same [[prototype]] as the argument. | |||
== History == | == History == |