FinnAPL idiom library: Difference between revisions
Jump to navigation
Jump to search
Miraheze>Adám Brudzewsky |
Miraheze>Adám Brudzewsky (convert moinmoin markup) |
||
Line 56: | Line 56: | ||
== Idiom Library Listing == | == Idiom Library Listing == | ||
=== Grade Up < | === Grade Up <source lang=apl inline>⍋</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|1. || Progressive index of (without replacement) ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←A1</source> | |rowspan=2|1. || Progressive index of (without replacement) ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←A1</source> | ||
Line 66: | Line 66: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⌊.5×(⍋⍋X)+⌽⍋⍋⌽X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⌊.5×(⍋⍋X)+⌽⍋⍋⌽X</source> | ||
|- | |- | ||
|rowspan=2| 3. || Cumulative maxima ( | |rowspan=2| 3. || Cumulative maxima (<source lang=apl inline>⌈\</source>) of subvectors of Y indicated by X ||style="text-align: right;"|<source lang=apl inline>X←B1; Y←D1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>Y[A⍳⌈\A←⍋A[⍋(+\X)[A←⍋Y]]]</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>Y[A⍳⌈\A←⍋A[⍋(+\X)[A←⍋Y]]]</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 4. || Cumulative minima ( | |rowspan=2| 4. || Cumulative minima (<source lang=apl inline>⌊\</source>) of subvectors of Y indicated by X ||style="text-align: right;"|<source lang=apl inline>X←B1; Y←D1</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>Y[A⍳⌈\A←⍋A[⍋(+\X)[A←⍒Y]]]</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>Y[A⍳⌈\A←⍋A[⍋(+\X)[A←⍒Y]]]</source> | ||
Line 86: | Line 86: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>X^.=⍋⍋X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>X^.=⍋⍋X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 8. || Grade up ( | |rowspan=2| 8. || Grade up (<source lang=apl inline>⍋</source>) for sorting subvectors of Y having lengths X ||style="text-align: right;"|<source lang=apl inline>Y←D1; X←I1; (⍴Y) ←→ +/X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>A[⍋(+\(⍳⍴Y)∊+\⎕IO,X)[A←⍋Y]]</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>A[⍋(+\(⍳⍴Y)∊+\⎕IO,X)[A←⍋Y]]</source> | ||
Line 98: | Line 98: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>Y[A[X/⍋(+\X)[A←⍋Y]]]</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>Y[A[X/⍋(+\X)[A←⍋Y]]]</source> | ||
|- | |- | ||
|rowspan=2| 11. || Grade up ( | |rowspan=2| 11. || Grade up (<source lang=apl inline>⍋</source>) for sorting subvectors of Y indicated by X ||style="text-align: right;"|<source lang=apl inline>X←B1; Y←D1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>A[⍋(+\X)[A←⍋Y]]</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>A[⍋(+\X)[A←⍋Y]]</source> | ||
Line 134: | Line 134: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⍋⍋X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⍋⍋X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 20. || Grade down ( | |rowspan=2| 20. || Grade down (<source lang=apl inline>⍒</source>) for sorting subvectors of Y having lengths X ||style="text-align: right;"|<source lang=apl inline>Y←D1; X←I1; (⍴Y) ←→ +/X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>A[⍋(+\(⍳⍴Y)∊+\⎕IO,X)[A←⍒Y]]</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>A[⍋(+\(⍳⍴Y)∊+\⎕IO,X)[A←⍒Y]]</source> | ||
Line 142: | Line 142: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>Y[A[X/⍋(+\X)[A←⍒Y]]]</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>Y[A[X/⍋(+\X)[A←⍒Y]]]</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 22. || Grade down ( | |rowspan=2| 22. || Grade down (<source lang=apl inline>⍒</source>) for sorting subvectors of Y indicated by X ||style="text-align: right;"|<source lang=apl inline>X←B1; Y←D1</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>A[⍋(+\X)[A←⍒Y]]</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>A[⍋(+\X)[A←⍒Y]]</source> | ||
Line 186: | Line 186: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>A[(B/C)-⍴Y]←B/+\~B←(⍴Y)<C←⍋Y,X+A←0×X ⋄ A</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>A[(B/C)-⍴Y]←B/+\~B←(⍴Y)<C←⍋Y,X+A←0×X ⋄ A</source> | ||
|- | |- | ||
|rowspan=2| 33. || Rotate first elements ( | |rowspan=2| 33. || Rotate first elements (<source lang=apl inline>1⌽</source>) of subvectors of Y indicated by X ||style="text-align: right;"|<source lang=apl inline>X←B1; Y←A1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>Y[⍋X++\X]</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>Y[⍋X++\X]</source> | ||
Line 194: | Line 194: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(X,'''')[(⎕IO+⍴X)⌊⍋(⍳⍴X),(''''=X)/⍳⍴X]</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(X,'''')[(⎕IO+⍴X)⌊⍋(⍳⍴X),(''''=X)/⍳⍴X]</source> | ||
|- | |- | ||
|rowspan=2| 35. || Inserting Y | |rowspan=2| 35. || Inserting Y <source lang=apl inline>*</source>'s into vector X after indices G ||style="text-align: right;"|<source lang=apl inline>X←C1; Y←I0; G←I1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(X,'*')[(⎕IO+⍴X)⌊⍋(⍳⍴X),(Y×⍴G)⍴G]</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(X,'*')[(⎕IO+⍴X)⌊⍋(⍳⍴X),(Y×⍴G)⍴G]</source> | ||
Line 261: | Line 261: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>X[⍒+⌿A<.-⍉A←X,0;]</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>X[⍒+⌿A<.-⍉A←X,0;]</source> | ||
|- | |- | ||
|rowspan=2| 52. || Reversal ( | |rowspan=2| 52. || Reversal (<source lang=apl inline>⌽</source>) of subvectors of X having lengths Y ||style="text-align: right;"|<source lang=apl inline>X←D1; Y←I1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>X[⌽⍒+\(⍳⍴X)∊+\⎕IO,Y]</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>X[⌽⍒+\(⍳⍴X)∊+\⎕IO,Y]</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 53. || Reversal ( | |rowspan=2| 53. || Reversal (<source lang=apl inline>⌽</source>) of subvectors of Y indicated by X ||style="text-align: right;"|<source lang=apl inline>X←B1; Y←A1</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>Y[⌽⍒+\X]</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>Y[⌽⍒+\X]</source> | ||
Line 290: | Line 290: | ||
|} | |} | ||
=== Matrix Inversion / Matrix Division ⌹ === | === Matrix Inversion / Matrix Division <source lang=apl inline>⌹</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|60. || Interpolated value of series (X,Y) at G ||style="text-align: right;"|<source lang=apl inline>X←D1; Y←D1; G←D0</source> | |rowspan=2|60. || Interpolated value of series (X,Y) at G ||style="text-align: right;"|<source lang=apl inline>X←D1; Y←D1; G←D0</source> | ||
Line 317: | Line 317: | ||
|} | |} | ||
=== Decode ⊥ === | === Decode <source lang=apl inline>⊥</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|66. || Binary format of decimal number X ||style="text-align: right;"|<source lang=apl inline>X←I0</source> | |rowspan=2|66. || Binary format of decimal number X ||style="text-align: right;"|<source lang=apl inline>X←I0</source> | ||
Line 428: | Line 428: | ||
|} | |} | ||
=== Encode ⊤ === | === Encode <source lang=apl inline>⊤</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=4|94. || Conversion from decimal to hexadecimal ( | |rowspan=4|94. || Conversion from decimal to hexadecimal (<source lang=apl inline>X=1..255</source>) ||style="text-align: right;"|<source lang=apl inline>X←I</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⍉'0123456789ABCDEF'[⎕IO+((⌈⌈/16⍟,X)⍴16)⊤X]</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⍉'0123456789ABCDEF'[⎕IO+((⌈⌈/16⍟,X)⍴16)⊤X]</source> | ||
Line 454: | Line 454: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>1 0⍕10 10⊤1-⎕IO-⍳X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>1 0⍕10 10⊤1-⎕IO-⍳X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 99. || Conversion of characters to hexadecimal representation ( | |rowspan=2| 99. || Conversion of characters to hexadecimal representation (<source lang=apl inline>⎕AV</source>) ||style="text-align: right;"|<source lang=apl inline>X←C1</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>,' ',⍉'0123456789ABCDEF'[⎕IO+16 16⊤-⎕IO-⎕AV⍳X]</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>,' ',⍉'0123456789ABCDEF'[⎕IO+16 16⊤-⎕IO-⎕AV⍳X]</source> | ||
Line 482: | Line 482: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⎕IO+(⍴X)⊤(-⎕IO)+(,X∊Y)/⍳⍴,X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⎕IO+(⍴X)⊤(-⎕IO)+(,X∊Y)/⍳⍴,X</source> | ||
|- | |- | ||
|rowspan=2| 106. || All pairs of elements of | |rowspan=2| 106. || All pairs of elements of <source lang=apl inline>⍳X</source> and <source lang=apl inline>⍳Y</source> ||style="text-align: right;"|<source lang=apl inline>X←I0; Y←I0</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⎕IO+(X,Y)⊤(⍳X×Y)-⎕IO</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⎕IO+(X,Y)⊤(⍳X×Y)-⎕IO</source> | ||
Line 507: | Line 507: | ||
|} | |} | ||
=== Logarithm ⍟ === | === Logarithm <source lang=apl inline>⍟</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|112. || Number of decimals of elements of X ||style="text-align: right;"|<source lang=apl inline>X←D1</source> | |rowspan=2|112. || Number of decimals of elements of X ||style="text-align: right;"|<source lang=apl inline>X←D1</source> | ||
Line 513: | Line 513: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⌊10⍟(⍎('.'≠A)/A←⍕X)÷X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⌊10⍟(⍎('.'≠A)/A←⍕X)÷X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 113. || Number of sortable columns at a time using | |rowspan=2| 113. || Number of sortable columns at a time using <source lang=apl inline>⊥</source> and alphabet X ||style="text-align: right;"|<source lang=apl inline>X←C1</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⌊(1+⍴X)⍟2*(A=¯1+A←2*⍳128)⍳1</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⌊(1+⍴X)⍟2*(A=¯1+A←2*⍳128)⍳1</source> | ||
Line 538: | Line 538: | ||
|} | |} | ||
=== Branch → === | === Branch <source lang=apl inline>→</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|119. || Case structure according to key vector G ||style="text-align: right;"|<source lang=apl inline>X←A0; Y←I1; G←A1</source> | |rowspan=2|119. || Case structure according to key vector G ||style="text-align: right;"|<source lang=apl inline>X←A0; Y←I1; G←A1</source> | ||
Line 585: | Line 585: | ||
|} | |} | ||
=== Execute ⍎ === | === Execute <source lang=apl inline>⍎</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|132. || Test for symmetricity of matrix X ||style="text-align: right;"|<source lang=apl inline>X←A2</source> | |rowspan=2|132. || Test for symmetricity of matrix X ||style="text-align: right;"|<source lang=apl inline>X←A2</source> | ||
Line 595: | Line 595: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⍎'VAR',(⍕X),'←Y'</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⍎'VAR',(⍕X),'←Y'</source> | ||
|- | |- | ||
|rowspan=2| 134. || Rounding to | |rowspan=2| 134. || Rounding to <source lang=apl inline>⎕PP</source> precision ||style="text-align: right;"|<source lang=apl inline>X←D1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⍎⍕X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⍎⍕X</source> | ||
Line 676: | Line 676: | ||
|} | |} | ||
=== Format ⍕ === | === Format <source lang=apl inline>⍕</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|154. || Numeric headers (elements of X) for rows of table Y ||style="text-align: right;"|<source lang=apl inline>X←D1; Y←A2</source> | |rowspan=2|154. || Numeric headers (elements of X) for rows of table Y ||style="text-align: right;"|<source lang=apl inline>X←D1; Y←A2</source> | ||
Line 698: | Line 698: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(⍴A)⍴B\(B←,('0'≠A)∨' '≠¯1⌽A)/,A←' ',⍕X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(⍴A)⍴B\(B←,('0'≠A)∨' '≠¯1⌽A)/,A←' ',⍕X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 159. || Number of digit positions in scalar X (depends on | |rowspan=2| 159. || Number of digit positions in scalar X (depends on <source lang=apl inline>⎕PP</source>) ||style="text-align: right;"|<source lang=apl inline>X←D0</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⍴⍕X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⍴⍕X</source> | ||
Line 715: | Line 715: | ||
|} | |} | ||
=== Roll / Deal ? === | === Roll / Deal <source lang=apl inline>?</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|164. || Y-shaped array of random numbers within ( X[1],X[2] ] ||style="text-align: right;"|<source lang=apl inline>X←I1; Y←I1</source> | |rowspan=2|164. || Y-shaped array of random numbers within ( X[1],X[2] ] ||style="text-align: right;"|<source lang=apl inline>X←I1; Y←I1</source> | ||
Line 725: | Line 725: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(~X∊' .,:;?''')/X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(~X∊' .,:;?''')/X</source> | ||
|- | |- | ||
|rowspan=2| 166. || Choosing Y objects out of | |rowspan=2| 166. || Choosing Y objects out of <source lang=apl inline>⍳X</source> with replacement (roll) ||style="text-align: right;"|<source lang=apl inline>Y←I; X←I</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>?Y⍴X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>?Y⍴X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 167. || Choosing Y objects out of | |rowspan=2| 167. || Choosing Y objects out of <source lang=apl inline>⍳X</source> without replacement (deal) ||style="text-align: right;"|<source lang=apl inline>X←I0; Y←I0</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>Y?X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>Y?X</source> | ||
|} | |} | ||
=== Geometrical Functions ○ === | === Geometrical Functions <source lang=apl inline>○</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|168. || Arctan Y÷X ||style="text-align: right;"|<source lang=apl inline>X←D; Y←D</source> | |rowspan=2|168. || Arctan Y÷X ||style="text-align: right;"|<source lang=apl inline>X←D; Y←D</source> | ||
Line 753: | Line 753: | ||
|} | |} | ||
=== Factorial / Binomial ! === | === Factorial / Binomial <source lang=apl inline>!</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|172. || Number of permutations of X objects taken Y at a time ||style="text-align: right;"|<source lang=apl inline>X←D; Y←D</source> | |rowspan=2|172. || Number of permutations of X objects taken Y at a time ||style="text-align: right;"|<source lang=apl inline>X←D; Y←D</source> | ||
Line 788: | Line 788: | ||
|} | |} | ||
=== Index Of ⍳ === | === Index Of <source lang=apl inline>⍳</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|180. || Removing elements Y from beginning and end of vector X ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←A</source> | |rowspan=2|180. || Removing elements Y from beginning and end of vector X ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←A</source> | ||
Line 854: | Line 854: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(1-(⌽' '≠X)⍳1)↓X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(1-(⌽' '≠X)⍳1)↓X</source> | ||
|- | |- | ||
|rowspan=2| 198. || Index of last occurrence of Y in X ( | |rowspan=2| 198. || Index of last occurrence of Y in X (<source lang=apl inline>⎕IO-1</source> if not found) ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←A</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>((¯1 1)[2×⎕IO]+⍴X)-(⌽X)⍳Y</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>((¯1 1)[2×⎕IO]+⍴X)-(⌽X)⍳Y</source> | ||
Line 939: | Line 939: | ||
|} | |} | ||
=== Outer Product ∘.! ∘.⌈ ∘.| === | === Outer Product <source lang=apl inline>∘.!</source> <source lang=apl inline>∘.⌈</source> <source lang=apl inline>∘.|</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|219. || Pascal's triangle of order X (binomial coefficients) ||style="text-align: right;"|<source lang=apl inline>X←I0</source> | |rowspan=2|219. || Pascal's triangle of order X (binomial coefficients) ||style="text-align: right;"|<source lang=apl inline>X←I0</source> | ||
Line 966: | Line 966: | ||
|} | |} | ||
=== Outer Product ∘.* ∘.× ∘.- ∘.+ === | === Outer Product <source lang=apl inline>∘.*</source> <source lang=apl inline>∘.×</source> <source lang=apl inline>∘.-</source> <source lang=apl inline>∘.+</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|225. || Compound interest for principals Y at rates G % in times X ||style="text-align: right;"|<source lang=apl inline>X←D; Y←D; G←D</source> | |rowspan=2|225. || Compound interest for principals Y at rates G % in times X ||style="text-align: right;"|<source lang=apl inline>X←D; Y←D; G←D</source> | ||
Line 1,049: | Line 1,049: | ||
|} | |} | ||
=== Outer Product ∘.<∘.≤ ∘.≥ ∘.> === | === Outer Product <source lang=apl inline>∘.<</source> <source lang=apl inline>∘.≤</source> <source lang=apl inline>∘.≥</source> <source lang=apl inline>∘.></source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|247. || Matrix with X[i] trailing zeroes on row i ||style="text-align: right;"|<source lang=apl inline>X←I1</source> | |rowspan=2|247. || Matrix with X[i] trailing zeroes on row i ||style="text-align: right;"|<source lang=apl inline>X←I1</source> | ||
Line 1,144: | Line 1,144: | ||
|} | |} | ||
=== Outer Product ∘.≠ ∘.= === | === Outer Product <source lang=apl inline>∘.≠</source> <source lang=apl inline>∘.=</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|271. || Indices of elements of Y in corr. rows of X ( | |rowspan=2|271. || Indices of elements of Y in corr. rows of X (<source lang=apl inline>X[i;]⍳Y[i;]</source>) ||style="text-align: right;"|<source lang=apl inline>X←A2; Y←A2</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>1++/^\1 2 1 3⍉Y∘.≠X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>1++/^\1 2 1 3⍉Y∘.≠X</source> | ||
Line 1,154: | Line 1,154: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⍉X∘.=(1 1⍉<\X∘.=X)/X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⍉X∘.=(1 1⍉<\X∘.=X)/X</source> | ||
|- | |- | ||
|rowspan=2| 275. || Changing connection matrix X ( | |rowspan=2| 275. || Changing connection matrix X (<source lang=apl inline>¯1 → 1</source>) to a node matrix ||style="text-align: right;"|<source lang=apl inline>X←I2</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(1 ¯1∘.=⍉X)+.×⍳1↑⍴⎕←X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(1 ¯1∘.=⍉X)+.×⍳1↑⍴⎕←X</source> | ||
Line 1,174: | Line 1,174: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>∨/^/0 1∘.=X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>∨/^/0 1∘.=X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 280. || Test if elements of X belong to corr. row of Y ( | |rowspan=2| 280. || Test if elements of X belong to corr. row of Y (<source lang=apl inline>X[i;]∊Y[i;]</source>) ||style="text-align: right;"|<source lang=apl inline>X←A2; Y←A2; 1↑⍴X←→1↑⍴Y</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>∨/1 2 1 3⍉X∘.=Y</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>∨/1 2 1 3⍉X∘.=Y</source> | ||
Line 1,199: | Line 1,199: | ||
|} | |} | ||
=== Inner Product ⌈.× ⌊.× ⌊.+ ×.○ ×.* +.* === | === Inner Product <source lang=apl inline>⌈.×</source> <source lang=apl inline>⌊.×</source> <source lang=apl inline>⌊.+</source> <source lang=apl inline>×.○</source> <source lang=apl inline>×.*</source> <source lang=apl inline>+.*</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|287. || Maxima of elements of subsets of X specified by Y ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←B</source> | |rowspan=2|287. || Maxima of elements of subsets of X specified by Y ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←B</source> | ||
Line 1,237: | Line 1,237: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>X+.*2</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>X+.*2</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 297. || Randomizing random numbers (in | |rowspan=2| 297. || Randomizing random numbers (in <source lang=apl inline>⎕LX</source> in a workspace) ||style="text-align: right;"|<source lang=apl inline></source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⎕RL←⎕TS+.*2</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⎕RL←⎕TS+.*2</source> | ||
|} | |} | ||
=== Inner Product ∨.^ <.< <.≤ <.≥ ≤.≥>.> === | === Inner Product <source lang=apl inline>∨.^</source> <source lang=apl inline><.<</source> <source lang=apl inline><.≤</source> <source lang=apl inline><.≥</source> <source lang=apl inline>≤.≥</source> <source lang=apl inline>>.></source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|298. || Extending a transitive binary relation ||style="text-align: right;"|<source lang=apl inline>X←B2</source> | |rowspan=2|298. || Extending a transitive binary relation ||style="text-align: right;"|<source lang=apl inline>X←B2</source> | ||
Line 1,273: | Line 1,273: | ||
|} | |} | ||
=== Inner Product ∨.≠ ^.= +.≠ +.= === | === Inner Product <source lang=apl inline>∨.≠</source> <source lang=apl inline>^.=</source> <source lang=apl inline>+.≠</source> <source lang=apl inline>+.=</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|306. || Removing trailing blank columns ||style="text-align: right;"|<source lang=apl inline>X←C2</source> | |rowspan=2|306. || Removing trailing blank columns ||style="text-align: right;"|<source lang=apl inline>X←C2</source> | ||
Line 1,291: | Line 1,291: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⎕IO++⌿^⍀Y∨.≠⍉X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⎕IO++⌿^⍀Y∨.≠⍉X</source> | ||
|- | |- | ||
|rowspan=2| 310. || | |rowspan=2| 310. || <source lang=apl inline>X⍳Y</source> for rows of matrices ||style="text-align: right;"|<source lang=apl inline>X←A2; Y←A2</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⎕IO++⌿^⍀X∨.≠⍉Y</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⎕IO++⌿^⍀X∨.≠⍉Y</source> | ||
Line 1,368: | Line 1,368: | ||
|} | |} | ||
=== Inner Product -.÷ +.÷ +.× === | === Inner Product <source lang=apl inline>-.÷</source> <source lang=apl inline>+.÷</source> <source lang=apl inline>+.×</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|329. || Sum of alternating reciprocal series Y÷X ||style="text-align: right;"|<source lang=apl inline>X←D1; Y←D1</source> | |rowspan=2|329. || Sum of alternating reciprocal series Y÷X ||style="text-align: right;"|<source lang=apl inline>X←D1; Y←D1</source> | ||
Line 1,374: | Line 1,374: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>Y-.÷X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>Y-.÷X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 330. || Limits X to fit in | |rowspan=2| 330. || Limits X to fit in <source lang=apl inline>⍕</source> field Y[1 2] ||style="text-align: right;"|<source lang=apl inline>X←D; Y←I1</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(X⌈1↓A)⌊1↑A←(2 2⍴¯1 1 1 ¯.1)+.×10*(-1↓Y),-/Y+Y>99 0</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(X⌈1↓A)⌊1↑A←(2 2⍴¯1 1 1 ¯.1)+.×10*(-1↓Y),-/Y+Y>99 0</source> | ||
Line 1,417: | Line 1,417: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>^/[Y]X=⌈\[Y]X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>^/[Y]X=⌈\[Y]X</source> | ||
|- | |- | ||
|rowspan=2| 340. || Duplicating element of X belonging to | |rowspan=2| 340. || Duplicating element of X belonging to <source lang=apl inline>Y,1↑X</source> until next found ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←B1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>X[1⌈⌈\Y×⍳⍴Y]</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>X[1⌈⌈\Y×⍳⍴Y]</source> | ||
Line 1,452: | Line 1,452: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>≠\Y≠X\A≠¯1↓0,A←X/≠\¯1↓0,Y</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>≠\Y≠X\A≠¯1↓0,A←X/≠\¯1↓0,Y</source> | ||
|- | |- | ||
|rowspan=2| 352. || Vector | |rowspan=2| 352. || Vector <source lang=apl inline>(X[1]⍴1),(X[2]⍴0),(X[3]⍴1),...</source> ||style="text-align: right;"|<source lang=apl inline>X←I1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>≠\(⍳+/X)∊+\⎕IO,X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>≠\(⍳+/X)∊+\⎕IO,X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 353. || Not leading zeroes( | |rowspan=2| 353. || Not leading zeroes(<source lang=apl inline>∨\</source>) in each subvector of Y indicated by X ||style="text-align: right;"|<source lang=apl inline>X←B1; Y←B1</source> | ||
|- style="background-color | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>≠\(Y∨X)\A≠¯1↓0,A←(Y∨X)/Y</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>≠\(Y∨X)\A≠¯1↓0,A←(Y∨X)/Y</source> | ||
|- | |- | ||
|rowspan=2| 354. || Leading ones ( | |rowspan=2| 354. || Leading ones (<source lang=apl inline>^\</source>) in each subvector of Y indicated by X ||style="text-align: right;"|<source lang=apl inline>X←B1; Y←B1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>~≠\(Y≤X)\A≠¯1↓0,A←~(Y≤X)/Y</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>~≠\(Y≤X)\A≠¯1↓0,A←~(Y≤X)/Y</source> | ||
Line 1,515: | Line 1,515: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(A-⌊0.5×(A←+/^\⌽A)++/^\A←' '=⌽X)⌽X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(A-⌊0.5×(A←+/^\⌽A)++/^\A←' '=⌽X)⌽X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 367. || Decommenting a matrix representation of a function ( | |rowspan=2| 367. || Decommenting a matrix representation of a function (<source lang=apl inline>⎕CR</source>) ||style="text-align: right;"|<source lang=apl inline>X←C2</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(∨/A)⌿(⍴X)⍴(,A)\(,A←^\('⍝'≠X)∨≠\X='''')/,X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(∨/A)⌿(⍴X)⍴(,A)\(,A←^\('⍝'≠X)∨≠\X='''')/,X</source> | ||
Line 1,554: | Line 1,554: | ||
=== Scan +\ === | === Scan +\ === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|378. || Vector ( | |rowspan=2|378. || Vector (<source lang=apl inline>X[1]⍴1),(Y[1]⍴0),(X[2]⍴1),...</source> ||style="text-align: right;"|<source lang=apl inline>X←I1; Y←I1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(⍳+/X,Y)∊+\1+¯1↓0,((⍳+/X)∊+\X)\Y</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(⍳+/X,Y)∊+\1+¯1↓0,((⍳+/X)∊+\X)\Y</source> | ||
Line 1,562: | Line 1,562: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>((X≠0)/Y)[+\¯1⌽(⍳+/X)∊+\X]</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>((X≠0)/Y)[+\¯1⌽(⍳+/X)∊+\X]</source> | ||
|- | |- | ||
|rowspan=2| 380. || Vector ( | |rowspan=2| 380. || Vector (<source lang=apl inline>Y[1]+⍳X[1]),(Y[2]+⍳X[2]),(Y[3]+⍳X[3]),...</source> ||style="text-align: right;"|<source lang=apl inline>X←I1; Y←I1; ⍴X←→⍴Y</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⎕IO++\1+((⍳+/X)∊+\⎕IO,X)\Y-¯1↓1,X+Y</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⎕IO++\1+((⍳+/X)∊+\⎕IO,X)\Y-¯1↓1,X+Y</source> | ||
Line 1,768: | Line 1,768: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>X,[.5×⌈/(⍴⍴X),⍴⍴Y]Y</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>X,[.5×⌈/(⍴⍴X),⍴⍴Y]Y</source> | ||
|- | |- | ||
|rowspan=2| 431. || Quick membership ( | |rowspan=2| 431. || Quick membership (<source lang=apl inline>∊</source>) for positive integers ||style="text-align: right;"|<source lang=apl inline>X←I1; Y←I1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>A←(⌈/X,Y)⍴0 ⋄ A[Y]←1 ⋄ A[X]</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>A←(⌈/X,Y)⍴0 ⋄ A[Y]←1 ⋄ A[X]</source> | ||
Line 1,878: | Line 1,878: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>^/,X∊0 1</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>^/,X∊0 1</source> | ||
|- | |- | ||
|rowspan=2| 457. || Test if Y is a subset of X ( | |rowspan=2| 457. || Test if Y is a subset of X (<source lang=apl inline>Y ⊂ X</source>) ||style="text-align: right;"|<source lang=apl inline>X←A; Y←A1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>^/Y∊X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>^/Y∊X</source> | ||
Line 1,966: | Line 1,966: | ||
|} | |} | ||
=== Reverse ⌽ ⊖ === | === Reverse ⌽ <source lang=apl inline>⊖</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|478. || Scan from end with function | |rowspan=2|478. || Scan from end with function <source lang=apl inline>⍺</source> ||style="text-align: right;"|<source lang=apl inline>X←A</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⌽⍺\⌽X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>⌽⍺\⌽X</source> | ||
Line 2,005: | Line 2,005: | ||
|} | |} | ||
=== Rotate ⌽ ⊖ === | === Rotate ⌽ <source lang=apl inline>⊖</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|488. || Vector (cross) product of vectors ||style="text-align: right;"|<source lang=apl inline>X←D; Y←D</source> | |rowspan=2|488. || Vector (cross) product of vectors ||style="text-align: right;"|<source lang=apl inline>X←D; Y←D</source> | ||
Line 2,027: | Line 2,027: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(Y⌽1 2)⍉X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(Y⌽1 2)⍉X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 493. || Any element true ( | |rowspan=2| 493. || Any element true (<source lang=apl inline>∨/</source>) on each subvector of Y indicated by X ||style="text-align: right;"|<source lang=apl inline>X←B1; Y←B1</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(X/Y)≥A/1⌽A←(Y∨X)/X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(X/Y)≥A/1⌽A←(Y∨X)/X</source> | ||
|- | |- | ||
|rowspan=2| 494. || All elements true ( | |rowspan=2| 494. || All elements true (<source lang=apl inline>^/</source>) on each subvector of Y indicated by X ||style="text-align: right;"|<source lang=apl inline>X←B1; Y←B1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(X/Y)^A/1⌽A←(Y≤X)/X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(X/Y)^A/1⌽A←(Y≤X)/X</source> | ||
Line 2,088: | Line 2,088: | ||
|} | |} | ||
=== Transpose ⍉ === | === Transpose <source lang=apl inline>⍉</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|509. || Applying to columns action defined on rows ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←I0</source> | |rowspan=2|509. || Applying to columns action defined on rows ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←I0</source> | ||
Line 2,098: | Line 2,098: | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>1 1⍉X[Y[1;];Y[2;]]</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>1 1⍉X[Y[1;];Y[2;]]</source> | ||
|- | |- | ||
|rowspan=2| 511. || Successive transposes of G (X after Y: | |rowspan=2| 511. || Successive transposes of G (X after Y: <source lang=apl inline>X⍉Y⍉G</source>) ||style="text-align: right;"|<source lang=apl inline>X←I1; Y←I1</source> | ||
|- | |- | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>X[Y]⍉G</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>X[Y]⍉G</source> | ||
Line 2,135: | Line 2,135: | ||
|} | |} | ||
=== Maximum ⌈ Minimum ⌊ === | === Maximum ⌈ Minimum <source lang=apl inline>⌊</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|520. || Limiting X between Y[1] and Y[2], inclusive ||style="text-align: right;"|<source lang=apl inline>X←D; Y←D1</source> | |rowspan=2|520. || Limiting X between Y[1] and Y[2], inclusive ||style="text-align: right;"|<source lang=apl inline>X←D; Y←D1</source> | ||
Line 2,166: | Line 2,166: | ||
|} | |} | ||
=== Ceiling ⌈ Floor ⌊ === | === Ceiling ⌈ Floor <source lang=apl inline>⌊</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|527. || Reshaping X into a matrix of width Y ||style="text-align: right;"|<source lang=apl inline>X←D, Y←I0</source> | |rowspan=2|527. || Reshaping X into a matrix of width Y ||style="text-align: right;"|<source lang=apl inline>X←D, Y←I0</source> | ||
Line 2,221: | Line 2,221: | ||
|} | |} | ||
=== Residue | === | === Residue <source lang=apl inline>|</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|540. || Test if X is a leap year ||style="text-align: right;"|<source lang=apl inline>X←I</source> | |rowspan=2|540. || Test if X is a leap year ||style="text-align: right;"|<source lang=apl inline>X←I</source> | ||
Line 2,280: | Line 2,280: | ||
|} | |} | ||
=== Magnitude |, Signum × === | === Magnitude |, Signum <source lang=apl inline>×</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|554. || Increasing absolute value without change of sign ||style="text-align: right;"|<source lang=apl inline>X←D; Y←D</source> | |rowspan=2|554. || Increasing absolute value without change of sign ||style="text-align: right;"|<source lang=apl inline>X←D; Y←D</source> | ||
Line 2,299: | Line 2,299: | ||
|} | |} | ||
=== Expand \ ⍀ === | === Expand \ <source lang=apl inline>⍀</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|558. || Not first zero (≤\) in each subvector of Y indicated by X ||style="text-align: right;"|<source lang=apl inline>X←B1; Y←B1</source> | |rowspan=2|558. || Not first zero (≤\) in each subvector of Y indicated by X ||style="text-align: right;"|<source lang=apl inline>X←B1; Y←B1</source> | ||
Line 2,350: | Line 2,350: | ||
|} | |} | ||
=== Compress / ⌿ === | === Compress / <source lang=apl inline>⌿</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|570. || Lengths of groups of ones in X ||style="text-align: right;"|<source lang=apl inline>X←B1</source> | |rowspan=2|570. || Lengths of groups of ones in X ||style="text-align: right;"|<source lang=apl inline>X←B1</source> | ||
Line 2,460: | Line 2,460: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(,X,[1.5]1)/,X,[1.5]~X</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(,X,[1.5]1)/,X,[1.5]~X</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 599. || Reduction with FUNCTION | |rowspan=2| 599. || Reduction with FUNCTION <source lang=apl inline>⍺</source> without respect to shape ||style="text-align: right;"|<source lang=apl inline>X←D</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⍺/,X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>⍺/,X</source> | ||
Line 2,477: | Line 2,477: | ||
|} | |} | ||
=== Take ↑ === | === Take <source lang=apl inline>↑</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|603. || Inserting vector X into matrix Y after row G ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←A2; G←I0</source> | |rowspan=2|603. || Inserting vector X into matrix Y after row G ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←A2; G←I0</source> | ||
Line 2,572: | Line 2,572: | ||
|} | |} | ||
=== Drop ↓ === | === Drop <source lang=apl inline>↓</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|627. || Starting points of groups of equal elements (non-empty X) ||style="text-align: right;"|<source lang=apl inline>X←A1</source> | |rowspan=2|627. || Starting points of groups of equal elements (non-empty X) ||style="text-align: right;"|<source lang=apl inline>X←A1</source> | ||
Line 2,643: | Line 2,643: | ||
|} | |} | ||
=== Member Of ∊ === | === Member Of <source lang=apl inline>∊</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|644. || Expansion vector with zero after indices Y ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←I1</source> | |rowspan=2|644. || Expansion vector with zero after indices Y ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←I1</source> | ||
Line 2,686: | Line 2,686: | ||
|} | |} | ||
=== Index Generator ⍳ === | === Index Generator <source lang=apl inline>⍳</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|654. || Inverting a permutation ||style="text-align: right;"|<source lang=apl inline>X←I1</source> | |rowspan=2|654. || Inverting a permutation ||style="text-align: right;"|<source lang=apl inline>X←I1</source> | ||
Line 2,717: | Line 2,717: | ||
|} | |} | ||
=== Logical Functions ~ ∨ ^ ⍱ ⍲ === | === Logical Functions ~ ∨ ^ ⍱ <source lang=apl inline>⍲</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|661. || Demote non-boolean representations to booleans ||style="text-align: right;"|<source lang=apl inline>X←B</source> | |rowspan=2|661. || Demote non-boolean representations to booleans ||style="text-align: right;"|<source lang=apl inline>X←B</source> | ||
Line 2,739: | Line 2,739: | ||
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(X×G)+Y×~G</source> | |colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>(X×G)+Y×~G</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|rowspan=2| 667. || Changing an index origin dependent result to be as | |rowspan=2| 667. || Changing an index origin dependent result to be as <source lang=apl inline>⎕IO=1</source> ||style="text-align: right;"|<source lang=apl inline>X←I</source> | ||
|- style="background-color: #FFFFFF" | |- style="background-color: #FFFFFF" | ||
|colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(~⎕IO)+X</source> | |colspan=2 style="background-color: #FFFFFF"|<source lang=apl inline>(~⎕IO)+X</source> | ||
Line 2,748: | Line 2,748: | ||
|} | |} | ||
=== Comparison <≤> ≠ === | === Comparison <≤> <source lang=apl inline>≠</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|669. || X implies Y ||style="text-align: right;"|<source lang=apl inline>X←B; Y←B</source> | |rowspan=2|669. || X implies Y ||style="text-align: right;"|<source lang=apl inline>X←B; Y←B</source> | ||
Line 2,775: | Line 2,775: | ||
|} | |} | ||
=== Ravel , === | === Ravel <source lang=apl inline>,</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|675. || Catenating Y elements G after every element of X ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←I0; G←A</source> | |rowspan=2|675. || Catenating Y elements G after every element of X ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←I0; G←A</source> | ||
Line 2,818: | Line 2,818: | ||
|} | |} | ||
=== Catenate , === | === Catenate <source lang=apl inline>,</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|685. || Separating variable length lines ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←A1</source> | |rowspan=2|685. || Separating variable length lines ||style="text-align: right;"|<source lang=apl inline>X←A1; Y←A1</source> | ||
Line 2,885: | Line 2,885: | ||
|} | |} | ||
=== Indexing [ ] === | === Indexing [ <source lang=apl inline>]</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|702. || Value of fixed-degree polynomial Y at points X ||style="text-align: right;"|<source lang=apl inline>Y←D1; X←D</source> | |rowspan=2|702. || Value of fixed-degree polynomial Y at points X ||style="text-align: right;"|<source lang=apl inline>Y←D1; X←D</source> | ||
Line 2,932: | Line 2,932: | ||
|} | |} | ||
=== Shape ⍴ === | === Shape <source lang=apl inline>⍴</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|713. || Rank of array X ||style="text-align: right;"|<source lang=apl inline>X←A</source> | |rowspan=2|713. || Rank of array X ||style="text-align: right;"|<source lang=apl inline>X←A</source> | ||
Line 2,955: | Line 2,955: | ||
|} | |} | ||
=== Reshape ⍴ === | === Reshape <source lang=apl inline>⍴</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|720. || Forming an initially empty array to be expanded ||style="text-align: right;"|<source lang=apl inline></source> | |rowspan=2|720. || Forming an initially empty array to be expanded ||style="text-align: right;"|<source lang=apl inline></source> | ||
Line 2,974: | Line 2,974: | ||
|} | |} | ||
=== Arithmetic + - × ÷ === | === Arithmetic + - × <source lang=apl inline>÷</source> === | ||
{|class=wikitable style="background-color: #EBEBEB" | {|class=wikitable style="background-color: #EBEBEB" | ||
|rowspan=2|724. || Continued fraction ||style="text-align: right;"|<source lang=apl inline></source> | |rowspan=2|724. || Continued fraction ||style="text-align: right;"|<source lang=apl inline></source> |