Commute-Duplicate: Difference between revisions
From NARS2000
Jump to navigationJump to search
(Created page with "<table border="1" cellpadding="5" cellspacing="0" rules="none" summary=""> <tr> <td> <table border="0" cellpadding="5" cellspacing="0" summary=""> <tr> <td val...") |
No edit summary |
||
Line 4: | Line 4: | ||
<table border="0" cellpadding="5" cellspacing="0" summary=""> | <table border="0" cellpadding="5" cellspacing="0" summary=""> | ||
<tr> | <tr> | ||
<td valign="top"> | <td valign="top">Duplicate: <apll>Z←f⍨ R</apll></td> | ||
<td></td> | <td></td> | ||
<td> </td> | <td> </td> | ||
Line 17: | Line 17: | ||
<table border="0" cellpadding="5" cellspacing="0" summary=""> | <table border="0" cellpadding="5" cellspacing="0" summary=""> | ||
<tr> | <tr> | ||
<td valign="top"> | <td valign="top">Commute: <apll>Z←L f⍨ R</apll></td> | ||
<td></td> | <td></td> | ||
<td></td> | <td></td> | ||
Line 37: | Line 37: | ||
<p>For example:</p> | <p>For example:</p> | ||
<apll> ∘.=⍨⍳4 ⍝ Identity matrix<br /> | <apll> | ||
×⍨⍳5 ⍝ squares <br/> | |||
1 4 9 16 25<br/> | |||
∘.=⍨⍳4 ⍝ Identity matrix<br /> | |||
1 0 0 0<br /> | 1 0 0 0<br /> | ||
0 1 0 0<br /> | 0 1 0 0<br /> | ||
0 0 1 0<br /> | 0 0 1 0<br /> | ||
0 0 0 1<br /> | 0 0 0 1<br /> | ||
</apll> | |||
<apll> | |||
2*⍨⍳5 ⍝ squares <br/> | |||
1 4 9 16 25<br/> | |||
√+/2*⍨6 2⍴3 4, 5 12, 8 15, 7 24, 20 21, 12 35 ⍝ Pythagorean hypotenuses<br /> | √+/2*⍨6 2⍴3 4, 5 12, 8 15, 7 24, 20 21, 12 35 ⍝ Pythagorean hypotenuses<br /> | ||
5 13 17 25 29 37<br /> | 5 13 17 25 29 37<br /> | ||
</apll> | </apll> |
Revision as of 06:15, 1 December 2016
|
||||
|
||||
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