4,494
edits
Miraheze>Adám Brudzewsky m (Text replacement - "</code>" to "</source>") |
m (Text replacement - " ⊢( *[^∘])" to " ⎕←$1") Tags: Mobile edit Mobile web edit |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{Built-in|Ravel|,}} is a [[primitive function]] introduced in [[APL\360]] which returns the ''ravel'' of an array. In the APL [[array model]], an array's ravel is the [[vector]] containing all its [[elements]] in [[ravel order]]. It is equivalent to [[Reshape|reshaping]] an array using its [[bound]] for the new [[shape]]. Reshaping the ravel using the original array's shape restores that array. | ||
In some APLs an [[Function axis|axis]] may be specified for Ravel in order to combine only some [[Axis|axes]] of an array, or insert a length-1 axis. | In some APLs an [[Function axis|axis]] may be specified for Ravel in order to combine only some [[Axis|axes]] of an array, or insert a length-1 axis. | ||
Line 9: | Line 9: | ||
You can use ravel to squash a [[matrix]] down to one dimension. The elements are listed in reading order—left to right, top to bottom. | You can use ravel to squash a [[matrix]] down to one dimension. The elements are listed in reading order—left to right, top to bottom. | ||
<source lang=apl> | <source lang=apl> | ||
⎕←x ← 3 4⍴⍳12 ⍝ A matrix | |||
1 2 3 4 | 1 2 3 4 | ||
5 6 7 8 | 5 6 7 8 | ||
Line 66: | Line 66: | ||
=== Documentation === | === Documentation === | ||
* [http://help.dyalog.com/latest/ | * [http://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Ravel.htm Dyalog] ([http://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Ravel%20with%20Axes.htm with axis]), | ||
* [http://wiki.nars2000.org/index.php/Rho NARS2000] | * [http://wiki.nars2000.org/index.php/Rho NARS2000] | ||
Line 78: | Line 78: | ||
<references /> | <references /> | ||
{{APL | {{APL features}} | ||
{{APL built-ins}} | {{APL built-ins}}[[Category:Primitive functions]] |