Condense: Difference between revisions

From NARS2000
Jump to navigationJump to search
No edit summary
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"><apll>Z←&lt;R</apll></td>
       <td valign="top"><apll>Z←&lt;R</apll> &nbsp;&nbsp; or &nbsp;&nbsp; <apll>Z←&lt;[X] R</apll></td>
       <td></td>
       <td></td>
       <td></td>
       <td></td>
       <td>converts <apll>R</apll> to a Hypercomplex array if <apll>(≢R)∊2 4 8</apll> or a Real array if <apll>1=≢R</apll>.</td>
       <td>converts <apll>R</apll> to a Hypercomplex array if <apll>(⍴R)[X]∊2 4 8</apll> or a Real array if <apll>(⍴R)[X]=1</apll>.</td>
     </tr>
     </tr>
     </table>
     </table>
Line 13: Line 13:
</tr>
</tr>
<tr>
<tr>
   <td><apll>R</apll> is an arbitrary Real numeric array (BOOL, INT, FLT, APA, RAT, VFP &mdash; otherwise, <apll>DOMAIN ERROR</apll>) whose number of columns (<apll>≢R</apll>) is <apll>1</apll>, <apll>2</apll>, <apll>4</apll>, or <apll>8</apll> &mdash; otherwise, <apll>LENGTH ERROR</apll>.</td>
   <td><apll>X</apll> is an optional numeric singleton axis with <apll>X∊⍳⍴⍴R</apll>.  If <apll>X</apll> is omitted, it defaults to the last axis.</td>
</tr>
</tr>
<tr>
<tr>
   <td><apll>Z</apll> is the corresponding Real or Hypercomplex array of shape <apll>¯1↓⍴R</apll> using the columns of <apll>R</apll> as the coefficients of the resulting Real or Hypercomplex array.  If <apll>≢R</apll> is <apll>1</apll>, the result is the Real array <apll>(¯1↓⍴R)⍴R</apll>, if <apll>≢R</apll> is <apll>2</apll>, the result is a Complex array, if <apll>≢R</apll> is <apll>4</apll>, the result is a Quaternion array, and if <apll>≢R</apll> is <apll>8</apll>, the result is an Octonion array.</td>
  <td><apll>R</apll> is an arbitrary Real numeric array (BOOL, INT, FLT, APA, RAT, VFP &mdash; otherwise, <apll>DOMAIN ERROR</apll>) whose <apll>X</apll>-axis length <apll>(⍴R)[X]</apll> is <apll>1</apll>, <apll>2</apll>, <apll>4</apll>, or <apll>8</apll> &mdash; otherwise, <apll>LENGTH ERROR</apll>.</td>
</tr>
<tr>
   <td><apll>Z</apll> is the corresponding Real or Hypercomplex array of shape <apll>(X≠⍳⍴⍴R)/⍴R</apll> using the items along the <apll>X</apll>-axis of <apll>R</apll> as the coefficients of the resulting Real or Hypercomplex array.  If <apll>(⍴R)[X]</apll> is <apll>1</apll>, the result is the Real array <apll>((X≠⍳⍴⍴R)/⍴R)⍴R</apll>, if <apll>(⍴R)[X]</apll> is <apll>2</apll>, the result is a Complex array, if <apll>(⍴R)[X]</apll> is <apll>4</apll>, the result is a Quaternion array, and if <apll>(⍴R)[X]</apll> is <apll>8</apll>, the result is an Octonion array.</td>
</tr>
</tr>
</table>
</table>
Line 30: Line 33:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;2 8⍴(⍳8),⌽⍳8<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;2 8⍴(⍳8),⌽⍳8<br />
1<pn>i</pn>2<pn>j</pn>3<pn>k</pn>4<pn>l</pn>5<pn>ij</pn>6<pn>jk</pn>7<pn>kl</pn>8 8<pn>i</pn>7<pn>j</pn>6<pn>k</pn>5<pn>l</pn>4<pn>ij</pn>3<pn>jk</pn>2<pn>kl</pn>1<br />
1<pn>i</pn>2<pn>j</pn>3<pn>k</pn>4<pn>l</pn>5<pn>ij</pn>6<pn>jk</pn>7<pn>kl</pn>8 8<pn>i</pn>7<pn>j</pn>6<pn>k</pn>5<pn>l</pn>4<pn>ij</pn>3<pn>jk</pn>2<pn>kl</pn>1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;[1] 2 8⍴(⍳8),⌽⍳8<br />
1<pn>J</pn>8 2<pn>J</pn>7 3<pn>J</pn>6 4<pn>J</pn>5 5<pn>J</pn>4 6<pn>J</pn>3 7<pn>J</pn>2 8<pn>J</pn>1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⍴⎕←&lt;2 3 1⍴⍳6<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;⍴⎕←&lt;2 3 1⍴⍳6<br />
1 2 3<br />
1 2 3<br />
Line 50: Line 55:
==Identities==
==Identities==


<apll>R ←→ &lt;&gt;R</apll> &nbsp;&nbsp;for all <apll>R</apll> (see [[Dilate]] for the definition of monadic Right Caret)<br />
<apll>R ←→ &lt;[X] &gt;[X] R</apll> &nbsp;&nbsp;for all <apll>R</apll> (see [[Dilate]] for the definition of monadic Right Caret)<br />
<apll>R ←→ &gt;&lt;R</apll> &nbsp;&nbsp;for all <apll>R</apll> with <apll>(¯1↑⍴R)∊1 2 4 8</apll><br />
<apll>R ←→ &gt;[X] &lt;[X] R</apll> &nbsp;&nbsp;for all <apll>R</apll> with <apll>(⍴R)[X]∊1 2 4 8</apll><br />


== Acknowledgements==
== Acknowledgements==


<p>This symbol and its name were suggested by David A. Rabenhorst.</p>
<p>This symbol and its name were suggested by David A. Rabenhorst.</p>

Revision as of 19:14, 11 April 2018

Z←<R    or    Z←<[X] R converts R to a Hypercomplex array if (⍴R)[X]∊2 4 8 or a Real array if (⍴R)[X]=1.
X is an optional numeric singleton axis with X∊⍳⍴⍴R. If X is omitted, it defaults to the last axis.
R is an arbitrary Real numeric array (BOOL, INT, FLT, APA, RAT, VFP — otherwise, DOMAIN ERROR) whose X-axis length (⍴R)[X] is 1, 2, 4, or 8 — otherwise, LENGTH ERROR.
Z is the corresponding Real or Hypercomplex array of shape (X≠⍳⍴⍴R)/⍴R using the items along the X-axis of R as the coefficients of the resulting Real or Hypercomplex array. If (⍴R)[X] is 1, the result is the Real array ((X≠⍳⍴⍴R)/⍴R)⍴R, if (⍴R)[X] is 2, the result is a Complex array, if (⍴R)[X] is 4, the result is a Quaternion array, and if (⍴R)[X] is 8, the result is an Octonion array.


For example,

      <23
23
      <10 20
10J20
      <2 4⍴⍳8
1i2j3k4 5i6j7k8
      <2 8⍴(⍳8),⌽⍳8
1i2j3k4l5ij6jk7kl8 8i7j6k5l4ij3jk2kl1
      <[1] 2 8⍴(⍳8),⌽⍳8
1J8 2J7 3J6 4J5 5J4 6J3 7J2 8J1
      ⍴⎕←<2 3 1⍴⍳6
1 2 3
4 5 6
2 3
      ⍴⎕←<2 3 2⍴(⍳6),⌽⍳6
1J2 3J4 5J6
6J5 4J3 2J1
2 3
      ⍴⎕←<2 3 4⍴(⍳12),⌽⍳12
1i2j3k4    5i6j7k8 9i10j11k12
12i11j10k9 8i7j6k5 4i3j2k1
2 3
      ⍴⎕←<2 3 8⍴(⍳24),⌽⍳24
 1i2j3k4l5ij6jk7kl8         9i10j11k12l13ij14jk15kl16 17i18j19k20l21ij22jk23kl24
24i23j22k21l20ij19jk18kl17 16i15j14k13l12ij11jk10kl9   8i7j6k5l4ij3jk2kl1
2 3

Identities

R ←→ <[X] >[X] R   for all R (see Dilate for the definition of monadic Right Caret)
R ←→ >[X] <[X] R   for all R with (⍴R)[X]∊1 2 4 8

Acknowledgements

This symbol and its name were suggested by David A. Rabenhorst.