Contents
Naming Conventions |
|||||
|
Scalar |
Vector |
Matrix |
Any |
Non- |
Boolean |
BS |
BV |
BM |
BA |
BN |
Integer |
IS |
IV |
IM |
IA |
IN |
Float |
FS |
FV |
FM |
FA |
FN |
Numeric |
NS |
NV |
NM |
NA |
NN |
Character |
CS |
CV |
CM |
CA |
CN |
Enclosed |
ES |
EV |
EM |
EA |
EN |
enclosed |
TS |
TV |
TM |
TA |
TN |
Simple |
SS |
SV |
SM |
SA |
SN |
Any |
AS |
AV |
AM |
AA |
AN |
phrase e.g.: .X...Y. ⍝ X←BS; Y←IV |
|||||
combinations: use ISV for Integer scalar∨vector |
|||||
B3, I4 &c. to specify higher ranks. |
|||||
EnforceMatrix
If you want to make any array a rank-two-array:
(¯2↑1 1,⍴SA)⍴SA
Examples
⎕FX ⍕2 1⍴'r←EnforceMatrix SA' 'r←(¯2↑1 1,⍴SA)⍴SA' ⍝ This will work in any APL dialect
⍴EnforceMatrix 1
1 1
⍴EnforceMatrix 1 2 3
1 3
Compatibility
Checked with:
Test Cases
Show test cases
Test my code, both Examples and Test Cases.
See also: ...
Mentor: KaiJaeger
Tags:
APL Wiki