Commute-Duplicate

From NARS2000
Revision as of 11:15, 1 December 2016 by Drab (talk | contribs)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Duplicate: Z←f⍨ R      returns R f R.
Commute: Z←L f⍨ R returns R f L.
L and R are arrays.
f is a function.

For example:

      ×⍨⍳5 ⍝ squares
1 4 9 16 25
      ∘.=⍨⍳4 ⍝ Identity matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

      2*⍨⍳5 ⍝ squares
1 4 9 16 25
      √+/2*⍨6 2⍴3 4, 5 12, 8 15, 7 24, 20 21, 12 35 ⍝ Pythagorean hypotenuses
5 13 17 25 29 37