Suffix: Difference between revisions

Jump to navigation Jump to search
36 bytes added ,  11:03, 11 September 2022
m
Text replacement - "</source>" to "</syntaxhighlight>"
m (Array relationships category)
m (Text replacement - "</source>" to "</syntaxhighlight>")
Tags: Mobile edit Mobile web edit
Line 8: Line 8:
       'suff' isSuffix 'suffix'
       'suff' isSuffix 'suffix'
0
0
</source>
</syntaxhighlight>
We can also use an <source lang=apl inline>isPrefix</source> function directly by [[Reverse|reversing]] both its arguments. In the second definition below, this relation is written more succinctly in a [[tacit]] style using the [[Over]] operator.
We can also use an <source lang=apl inline>isPrefix</syntaxhighlight> function directly by [[Reverse|reversing]] both its arguments. In the second definition below, this relation is written more succinctly in a [[tacit]] style using the [[Over]] operator.
<source lang=apl>
<source lang=apl>
       isSuffix ← {(⊖⍺)isPrefix(⊖⍵)}
       isSuffix ← {(⊖⍺)isPrefix(⊖⍵)}
       isSuffix ← isPrefix⍥⊖
       isSuffix ← isPrefix⍥⊖
</source>
</syntaxhighlight>


In [[leading axis theory]], the [[cell shape]] of each k-[[cell]] in an array is a suffix of that array's [[shape]], while the [[frame]] is a [[prefix]] of the shape.
In [[leading axis theory]], the [[cell shape]] of each k-[[cell]] in an array is a suffix of that array's [[shape]], while the [[frame]] is a [[prefix]] of the shape.


[[Iverson notation]] included the notion of a suffix vector <math>\omega^j(n)</math> consisting of <math>n-j</math> zeros followed by <math>j</math> ones; such a vector could be used to produce a length-<math>j</math> suffix of a length-<math>n</math> vector using [[Compress]]. The earliest versions of [[APL\360]] adapted this notation by defining a suffix function <source lang=apl inline>n ⍵ j</source> before removing it in favor of [[Take]] with a negative left argument.
[[Iverson notation]] included the notion of a suffix vector <math>\omega^j(n)</math> consisting of <math>n-j</math> zeros followed by <math>j</math> ones; such a vector could be used to produce a length-<math>j</math> suffix of a length-<math>n</math> vector using [[Compress]]. The earliest versions of [[APL\360]] adapted this notation by defining a suffix function <source lang=apl inline>n ⍵ j</syntaxhighlight> before removing it in favor of [[Take]] with a negative left argument.


[[Category:Array relationships]]
[[Category:Array relationships]]

Navigation menu