Ravel: Difference between revisions

Jump to navigation Jump to search
126 bytes added ,  09:06, 29 October 2019
m
Text replacement - "<code>" to "<source lang=apl inline>"
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 <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 <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.

Navigation menu