Ravel: Difference between revisions

Jump to navigation Jump to search
14 bytes added ,  09:07, 29 October 2019
m
Text replacement - "</code>" to "</source>"
Miraheze>Adám Brudzewsky
m (Text replacement - "<code>" to "<source lang=apl inline>")
Miraheze>Adám Brudzewsky
m (Text replacement - "</code>" to "</source>")
Line 50: Line 50:
== Description ==
== Description ==


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.
The ravel of an array <source lang=apl inline>A</source> has shape <source lang=apl inline>,×/⍴A</source> and shares elements with <source lang=apl inline>A</source>. Thus Ravel may be modelled as a [[Reshape|reshaping]] function <source lang=apl inline>{(×/⍴⍵)⍴⍵}</source>. The [[element]] with [[index]] [[vector]] <source lang=apl inline>I</source> is moved to index <source lang=apl inline>(⍴A)⊥I</source> in [[index origin]] 0, or <source lang=apl inline>⎕IO+(⍴A)⊥I-⎕IO</source> 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