APL hardware: Difference between revisions

Jump to navigation Jump to search
108 bytes added ,  22:13, 10 September 2022
m
Text replacement - "<source" to "<syntaxhighlight"
m (Text replacement - "</source>" to "</syntaxhighlight>")
m (Text replacement - "<source" to "<syntaxhighlight")
Tags: Mobile edit Mobile web edit
 
Line 32: Line 32:


=== Supported Operations ===
=== Supported Operations ===
Values can be transferred using the <source lang=apl inline>←</syntaxhighlight> operator.
Values can be transferred using the <syntaxhighlight lang=apl inline>←</syntaxhighlight> operator.
The MLIM natively supports the monadic operations:
The MLIM natively supports the monadic operations:
<source lang=apl inline>(A,B,C,T)←~(A,B,C,T)</syntaxhighlight>
<syntaxhighlight lang=apl inline>(A,B,C,T)←~(A,B,C,T)</syntaxhighlight>
and the dyadic operations:
and the dyadic operations:
<source lang=apl>
<syntaxhighlight lang=apl>
(C,A)←(A,C)+B
(C,A)←(A,C)+B
(C,A)←(A,C)-B
(C,A)←(A,C)-B
Line 48: Line 48:
</syntaxhighlight>
</syntaxhighlight>
The operations can be combined to create the following operations:
The operations can be combined to create the following operations:
<source lang=apl>
<syntaxhighlight lang=apl>
+M
+M
×M
×M
Line 74: Line 74:
M⍲N
M⍲N
</syntaxhighlight>
</syntaxhighlight>
The masking functionality of the RL combined with the native ability for [[Scan]] (reduce while reading the output in between each step) and [[Reduce]] (<source lang=apl inline>\</syntaxhighlight> and <source lang=apl inline>/</syntaxhighlight> respectively) allows for [[Index Generator]] (monadic <source lang=apl inline>⍳</syntaxhighlight>) to be defined, while its generalized indexing functionality allows [[Reverse]] and [[Transpose]] (monadic <source lang=apl inline>⌽</syntaxhighlight> and <source lang=apl inline>⍉</syntaxhighlight>) to be defined. [[Shape]] and [[Ravel]] (monadic <source lang=apl inline>⍴</syntaxhighlight> and <source lang=apl inline>,</syntaxhighlight>) can also be defined by using the RL and PP in parallel. Thus, a list of complex operators can be defined:  
The masking functionality of the RL combined with the native ability for [[Scan]] (reduce while reading the output in between each step) and [[Reduce]] (<syntaxhighlight lang=apl inline>\</syntaxhighlight> and <syntaxhighlight lang=apl inline>/</syntaxhighlight> respectively) allows for [[Index Generator]] (monadic <syntaxhighlight lang=apl inline>⍳</syntaxhighlight>) to be defined, while its generalized indexing functionality allows [[Reverse]] and [[Transpose]] (monadic <syntaxhighlight lang=apl inline>⌽</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍉</syntaxhighlight>) to be defined. [[Shape]] and [[Ravel]] (monadic <syntaxhighlight lang=apl inline>⍴</syntaxhighlight> and <syntaxhighlight lang=apl inline>,</syntaxhighlight>) can also be defined by using the RL and PP in parallel. Thus, a list of complex operators can be defined:  
<source lang=apl>
<syntaxhighlight lang=apl>
⍳N
⍳N
,N
,N

Navigation menu