pub enum DyadOp {
Show 49 variants
Scalar(ScalarDyad),
Reshape,
Take,
Drop,
Right,
Left,
Rotate,
AppendLeading,
AppendLast,
IndexOf {
origin: i64,
},
MemberJ,
MemberApl,
From,
Match,
NotMatch,
GradeSelect {
down: bool,
},
Copy,
Decode,
Encode,
Laminate,
Link,
Strand,
IntervalIndex {
offset: i64,
},
IndexOfLast {
origin: i64,
},
MatrixDivide,
PartitionEnclose,
Squad {
origin: i64,
},
SelectAxis {
axis: usize,
rank: usize,
origin: i64,
},
Fetch,
PolyEval,
PolyIntegral,
FormatSpec,
TruthTable(u8),
ExactForm,
Deal {
origin: i64,
fixed: bool,
},
Boolean(BoolDyad),
Less,
Union,
Intersect,
AnagramFrom,
Permute,
FindSeq,
UnicodeForm,
PrimeMeta,
PrimeExponents,
Pick {
origin: i64,
},
Expand,
NotYet(&'static str),
None,
}Expand description
Dyadic meaning of a primitive.
Variants§
Scalar(ScalarDyad)
Reshape
x $ y / x ⍴ y: lay out shape x, reusing y — its ITEMS in J, its ravel in APL.
Take
x {. y / x ↑ y: per-axis take, negative from the end, overtake fills.
Drop
x }. y / x ↓ y: per-axis drop, negative from the end.
Right
y (APL ⊢).
Left
x (APL ⊣).
Rotate
x |. y: rotate axis k of y left by x[k] (negative rotates right).
AppendLeading
Catenate along the LEADING axis (J ,, APL ⍪).
AppendLast
Catenate along the LAST axis (APL ,).
IndexOf
x i. y / x ⍳ y: the index in x’s items of each cell of y, or
origin + #items(x) when absent.
MemberJ
x e. y: is each cell of x, shaped like y’s items, an item of y?
MemberApl
x ∊ y: does each ELEMENT of x occur anywhere in y?
From
x { y: each integer atom of x selects an item of y (negative from the end).
Match
x -: y / x ≡ y: same shape and same values; never a shape error.
NotMatch
The negation of Match (APL ≢).
GradeSelect
x /: y and x : y: x’s items reordered by the grade of y’s items.
Copy
x # y (J), x/y and x⌿y (APL): item i of y repeated x[i] times.
A one-element x applies to every item.
Decode
x #. y / x ⊥ y: mixed-radix decode. A scalar x is the base for
every digit; otherwise x and y have the same length.
Encode
x #: y / x ⊤ y: mixed-radix encode. The digits become the LEADING
axis of the result, which is what makes one operation serve J’s
per-atom #: (right rank 0) and APL’s ⊤ (right rank infinite).
Laminate
x ,: y: the two arguments as the items of a new leading axis.
Link
J ;: link — (<x) before y, which is taken as it is when it is
already boxed and boxed when it is not.
Strand
APL vector notation: x is one more item in front of the strand y.
IntervalIndex
J x I. y / APL x ⍸ y: which interval of the ascending x each cell
of y falls in. The field is what the language adds to the count of
items below it: nothing in J, ⎕IO - 1 in APL.
IndexOfLast
J x i: y: where each cell of y LAST sits among the items of x.
MatrixDivide
J x %. y / APL x ⌹ y: the least-squares solution of y a = x.
PartitionEnclose
APL x ⊂ y: partitioned enclose — a 1 in x opens a partition, a 0
continues it, and a leading run of 0s drops those items.
Squad
APL x ⌷ y: one scalar index per axis of y.
SelectAxis
One bracket slot of APL indexing: axis axis of y selected by x.
rank, when it is not zero, is the number of slots the brackets
held, checked by the slot that sees the whole array.
Fetch
J x {:: y: follow the path x into y, opening a level a step.
PolyEval
J x p. y: the polynomial with ascending coefficients x at y. A
boxed x is the multiplier ; roots form of the same polynomial.
PolyIntegral
J x p.. y: the integral of the polynomial y’s coefficients
describe, with x as the constant term.
FormatSpec
APL x ⍕ y: format by specification — one width and precision per
column of the last axis, or one pair for the whole argument.
TruthTable(u8)
J x m b. y: the boolean function whose truth table m numbers,
on two bits for m below 16 and on every bit of two integers for
m from 16 to 31.
ExactForm
J x x: y: which exact form. 1 is the rational one, 2 the pair of
numerator and denominator, _1 the conversion back to a machine
number, _2 the argument unchanged.
Deal
J x ? y / x ?. y and APL x ? y: deal — x distinct values from
the y below origin + y.
Boolean(BoolDyad)
J +: and *: / APL ⍱ and ⍲: the two boolean operations that
have no other reading. Both arguments must be 0 or 1.
Less
J x -. y / APL x ~ y: the items of x that are not items of y.
Union
APL x ∪ y: x’s items, then y’s items that x does not already have.
Intersect
APL x ∩ y: the items of x that y also has, in x’s order.
AnagramFrom
J x A. y: y’s items under the x-th permutation of the items, the
permutations counted in lexicographic order.
Permute
J x C. y: y’s items permuted by x — a direct permutation, or a
boxed list of cycles.
FindSeq
J x E. y / APL x ⍷ y: 1 at each position of y where a copy of x
begins.
UnicodeForm
J x u: y: which conversion — 3 and 4 take characters to
codepoints, 8 and 10 take codepoints to characters.
PrimeMeta
J x p: y: which fact about primes — _1 counts the primes below
y, 0 asks whether y is composite, 1 whether it is prime, and x of
magnitude 4 steps to the next or previous prime.
PrimeExponents
J x q: y: the exponents of the first x primes in y, or, for __,
the distinct primes over their exponents as a 2-row table.
Pick
APL x ⊃ y: pick — follow the path x into y, opening a level a step.
Expand
APL x \ y and x ⍀ y: expand — a 1 in x takes the next item of y,
a 0 puts a fill in its place.
NotYet(&'static str)
None
Trait Implementations§
impl Copy for DyadOp
impl Eq for DyadOp
impl StructuralPartialEq for DyadOp
Auto Trait Implementations§
impl Freeze for DyadOp
impl RefUnwindSafe for DyadOp
impl Send for DyadOp
impl Sync for DyadOp
impl Unpin for DyadOp
impl UnsafeUnpin for DyadOp
impl UnwindSafe for DyadOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more