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