Skip to main content

DyadOp

Enum DyadOp 

Source
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.

Fields

§origin: i64
§

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.

Fields

§down: bool
§

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.

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.

Fields

§offset: i64
§

IndexOfLast

J x i: y: where each cell of y LAST sits among the items of x.

Fields

§origin: i64
§

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.

Fields

§origin: i64
§

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.

Fields

§axis: usize
§rank: usize
§origin: i64
§

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.

Fields

§origin: i64
§fixed: bool
§

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.

Fields

§origin: i64
§

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§

Source§

impl Clone for DyadOp

Source§

fn clone(&self) -> DyadOp

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DyadOp

Source§

impl Debug for DyadOp

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for DyadOp

Source§

impl PartialEq for DyadOp

Source§

fn eq(&self, other: &DyadOp) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DyadOp

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,