Skip to main content

Vector

Struct Vector 

Source
pub struct Vector<R: Register>(/* private fields */);
Expand description

SIMD Vector type.

This wraps a low-level register type and provides a vector-like interface, including operator overloading and element-wise operations.

Implementations§

Source§

impl<R: Register> Vector<R>

Source

pub const fn splat_const(value: R::Element) -> Self

👎Deprecated

Splat a value in a const context.

This is temporarily marked as deprecated until we can figure out a better way. Only use within a const {} block.

Trait Implementations§

Source§

impl<R: NumericRegister + Register> Add for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: NumericRegister + Register> AddAssign for Vector<R>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<R: NumericRegister + Register> AddAssignMasked<Mask<R>> for Vector<R>

Source§

fn add_assign_c(&mut self, mask: Mask<R>, rhs: Self)

Computes AddAssign with rhs where mask is true.
Source§

fn add_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: Self)

Merges AddAssign with src using mask, assigning src where mask is false.
Source§

fn add_assign_z(&mut self, mask: Mask<R>, rhs: Self)

Computes AddAssign masked (zeroed where mask is false).
Source§

impl<R: NumericRegister + Register> AddMasked<Mask<R>> for Vector<R>

Source§

fn add_c(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes Add with rhs where mask is true.
Source§

fn add_m(self, src: Self, mask: Mask<R>, rhs: Self) -> Self::Output

Merges Add with src using mask, returning src where mask is false.
Source§

fn add_z(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes Add masked (zeroed where mask is false).
Source§

impl<R: FloatRegister> AddSubExt for Vector<R>

Source§

type Output = Vector<R>

The result of the lane-alternating operation.
Source§

fn addsub(self, b: Self) -> Self

[a0 - b0, a1 + b1, a2 - b2, ...] - even lanes subtract, odd lanes add.
Source§

fn fmaddsub(self, b: Self, c: Self) -> Self

[a0*b0 - c0, a1*b1 + c1, ...] - fused multiply then addsub.
Source§

fn fmsubadd(self, b: Self, c: Self) -> Self

[a0*b0 + c0, a1*b1 - c1, ...] - fused multiply then subadd (opposite parity).
Source§

impl<R: FloatRegister> AddSubExtMasked<Mask<R>> for Vector<R>

Source§

fn addsub_c(self, mask: Mask<R>, b: Self) -> Self

addsub where mask is true, else self.
Source§

fn addsub_m(self, src: Self, mask: Mask<R>, b: Self) -> Self

addsub where mask is true, else src.
Source§

fn addsub_z(self, mask: Mask<R>, b: Self) -> Self

addsub where mask is true, else zero.
Source§

fn fmaddsub_c(self, mask: Mask<R>, b: Self, c: Self) -> Self

fmaddsub where mask is true, else self.
Source§

fn fmaddsub_m(self, src: Self, mask: Mask<R>, b: Self, c: Self) -> Self

fmaddsub where mask is true, else src.
Source§

fn fmaddsub_z(self, mask: Mask<R>, b: Self, c: Self) -> Self

fmaddsub where mask is true, else zero.
Source§

fn fmsubadd_c(self, mask: Mask<R>, b: Self, c: Self) -> Self

fmsubadd where mask is true, else self.
Source§

fn fmsubadd_m(self, src: Self, mask: Mask<R>, b: Self, c: Self) -> Self

fmsubadd where mask is true, else src.
Source§

fn fmsubadd_z(self, mask: Mask<R>, b: Self, c: Self) -> Self

fmsubadd where mask is true, else zero.
Source§

impl<R: BitwiseRegister + Register> BitAnd for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl<R: BitwiseRegister + Register> BitAndAssign for Vector<R>

Source§

fn bitand_assign(&mut self, rhs: Self)

Performs the &= operation. Read more
Source§

impl<R: BitwiseRegister + Register> BitAndAssignMasked<Mask<R>> for Vector<R>

Source§

fn bitand_assign_c(&mut self, mask: Mask<R>, rhs: Self)

Computes BitAndAssign with rhs where mask is true.
Source§

fn bitand_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: Self)

Merges BitAndAssign with src using mask, assigning src where mask is false.
Source§

fn bitand_assign_z(&mut self, mask: Mask<R>, rhs: Self)

Computes BitAndAssign masked (zeroed where mask is false).
Source§

impl<R: BitwiseRegister + Register> BitAndMasked<Mask<R>> for Vector<R>

Source§

fn bitand_c(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes BitAnd with rhs where mask is true.
Source§

fn bitand_m(self, src: Self, mask: Mask<R>, rhs: Self) -> Self::Output

Merges BitAnd with src using mask, returning src where mask is false.
Source§

fn bitand_z(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes BitAnd masked (zeroed where mask is false).
Source§

impl<R: BitwiseRegister + Register> BitAndNot for Vector<R>

Source§

type Output = Vector<R>

The result of the AND NOT.
Source§

fn bitandnot(self, rhs: Self) -> Self::Output

Computes self & !rhs, one instruction on every SIMD backend. Read more
Source§

impl<R: BitwiseRegister + Register> BitAndNotAssign for Vector<R>

Source§

fn bitandnot_assign(&mut self, rhs: Self)

Assigns self & !rhs into self.
Source§

impl<R: BitwiseRegister + Register> BitAndNotAssignMasked<Mask<R>> for Vector<R>

Source§

fn bitandnot_assign_c(&mut self, mask: Mask<R>, rhs: Self)

Computes BitAndNotAssign with rhs where mask is true.
Source§

fn bitandnot_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: Self)

Merges BitAndNotAssign with src using mask, assigning src where mask is false.
Source§

fn bitandnot_assign_z(&mut self, mask: Mask<R>, rhs: Self)

Computes BitAndNotAssign masked (zeroed where mask is false).
Source§

impl<R: BitwiseRegister + Register> BitAndNotMasked<Mask<R>> for Vector<R>

Source§

fn bitandnot_c(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes BitAndNot with rhs where mask is true.
Source§

fn bitandnot_m(self, src: Self, mask: Mask<R>, rhs: Self) -> Self::Output

Merges BitAndNot with src using mask, returning src where mask is false.
Source§

fn bitandnot_z(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes BitAndNot masked (zeroed where mask is false).
Source§

impl<FROM, INTO> BitCastVector<Vector<FROM>> for Vector<INTO>
where FROM: Register, INTO: Register + BitCastRegister<FROM>,

Source§

fn from_bits(bits: Vector<FROM>) -> Self

Reinterpret the bit pattern of bits as a value of Self.
Source§

impl<R: BitwiseRegister + Register> BitOr for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl<R: BitwiseRegister + Register> BitOrAssign for Vector<R>

Source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
Source§

impl<R: BitwiseRegister + Register> BitOrAssignMasked<Mask<R>> for Vector<R>

Source§

fn bitor_assign_c(&mut self, mask: Mask<R>, rhs: Self)

Computes BitOrAssign with rhs where mask is true.
Source§

fn bitor_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: Self)

Merges BitOrAssign with src using mask, assigning src where mask is false.
Source§

fn bitor_assign_z(&mut self, mask: Mask<R>, rhs: Self)

Computes BitOrAssign masked (zeroed where mask is false).
Source§

impl<R: BitwiseRegister + Register> BitOrMasked<Mask<R>> for Vector<R>

Source§

fn bitor_c(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes BitOr with rhs where mask is true.
Source§

fn bitor_m(self, src: Self, mask: Mask<R>, rhs: Self) -> Self::Output

Merges BitOr with src using mask, returning src where mask is false.
Source§

fn bitor_z(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes BitOr masked (zeroed where mask is false).
Source§

impl<R: BitwiseRegister + Register> BitXor for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<R: BitwiseRegister + Register> BitXorAssign for Vector<R>

Source§

fn bitxor_assign(&mut self, rhs: Self)

Performs the ^= operation. Read more
Source§

impl<R: BitwiseRegister + Register> BitXorAssignMasked<Mask<R>> for Vector<R>

Source§

fn bitxor_assign_c(&mut self, mask: Mask<R>, rhs: Self)

Computes BitXorAssign with rhs where mask is true.
Source§

fn bitxor_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: Self)

Merges BitXorAssign with src using mask, assigning src where mask is false.
Source§

fn bitxor_assign_z(&mut self, mask: Mask<R>, rhs: Self)

Computes BitXorAssign masked (zeroed where mask is false).
Source§

impl<R: BitwiseRegister + Register> BitXorMasked<Mask<R>> for Vector<R>

Source§

fn bitxor_c(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes BitXor with rhs where mask is true.
Source§

fn bitxor_m(self, src: Self, mask: Mask<R>, rhs: Self) -> Self::Output

Merges BitXor with src using mask, returning src where mask is false.
Source§

fn bitxor_z(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes BitXor masked (zeroed where mask is false).
Source§

impl<R: BitshiftRegister> BitshiftVector for Vector<R>

Source§

const HAS_TRUE_SHIFTV: bool = R::HAS_TRUE_SHIFTV

true if the backend has a true per-lane variable shift instruction (e.g. AVX2 vpsllvd). When false, shlv / shrv are emulated and may be slower than splatting a scalar shift count through shli / shri.
Source§

const HAS_WIDE_BYTE_SHIFTS: bool = R::HAS_WIDE_BYTE_SHIFTS

true if the backend can byte-shift the entire vector as a single large integer at register widths above 128 bits without lane-boundary stitching. When false, bshli / bshri on wider vectors are emulated via shuffles.
Source§

fn bshli<const I: i32>(self) -> Self

Treats the entire vector as a single large integer and shifts left by the immediate value number of BYTES. Not bits, bytes. Read more
Source§

fn bshri<const I: i32>(self) -> Self

Treats the entire vector as a single large integer and shifts right by the immediate value number of BYTES. Not bits, bytes. Read more
Source§

fn shli<const I: i32>(self) -> Self

For each lane in the vector, shift left by the immediate value.
Source§

fn shri<const I: i32>(self) -> Self

For each lane in the vector, shift right by the immediate value.
Source§

fn shlv(self, shifts: Self::Unsigned) -> Self

For each lane in the vector, shift left by the given value.
Source§

fn shrv(self, shifts: Self::Unsigned) -> Self

For each lane in the vector, shift right by the given value.
Source§

fn rol(self, shift: u32) -> Self

For each element in the vector, rotate the bits to the left by the given number of bits.
Source§

fn ror(self, shift: u32) -> Self

For each element in the vector, rotate the bits to the right by the given number of bits.
Source§

fn roli<const I: i32>(self) -> Self

For each element in the vector, rotate the bits to the left by the immediate value number of bits.
Source§

fn rori<const I: i32>(self) -> Self

For each element in the vector, rotate the bits to the right by the immediate value number of bits.
Source§

fn rolv(self, counts: Self::Unsigned) -> Self

For each element in the vector, rotate the bits to the left by the given number of bits in the corresponding lane of counts.
Source§

fn rorv(self, counts: Self::Unsigned) -> Self

For each element in the vector, rotate the bits to the right by the given number of bits in the corresponding lane of counts.
Source§

fn reverse_bits(self) -> Self

For each element in the vector, reverse the bits of that element.
Source§

fn bshli_c<const I: i32>(self, mask: Mask<R>) -> Self

Treats the entire vector as a single large integer and shifts left by the immediate value number of BYTES. Not bits, bytes. Read more
Source§

fn bshli_m<const I: i32>(self, src: Self, mask: Mask<R>) -> Self

Treats the entire vector as a single large integer and shifts left by the immediate value number of BYTES. Not bits, bytes. Read more
Source§

fn bshli_z<const I: i32>(self, mask: Mask<R>) -> Self

Treats the entire vector as a single large integer and shifts left by the immediate value number of BYTES. Not bits, bytes. Read more
Source§

fn bshri_c<const I: i32>(self, mask: Mask<R>) -> Self

Treats the entire vector as a single large integer and shifts right by the immediate value number of BYTES. Not bits, bytes. Read more
Source§

fn bshri_m<const I: i32>(self, src: Self, mask: Mask<R>) -> Self

Treats the entire vector as a single large integer and shifts right by the immediate value number of BYTES. Not bits, bytes. Read more
Source§

fn bshri_z<const I: i32>(self, mask: Mask<R>) -> Self

Treats the entire vector as a single large integer and shifts right by the immediate value number of BYTES. Not bits, bytes. Read more
Source§

fn shli_c<const I: i32>(self, mask: Mask<R>) -> Self

For each lane in the vector, shift left by the immediate value. Computes shli when mask is true, returns self where false.
Source§

fn shli_m<const I: i32>(self, src: Self, mask: Mask<R>) -> Self

For each lane in the vector, shift left by the immediate value. Merges shli with src using mask.
Source§

fn shli_z<const I: i32>(self, mask: Mask<R>) -> Self

For each lane in the vector, shift left by the immediate value. Computes shli masked (zeroed where mask is false).
Source§

fn shri_c<const I: i32>(self, mask: Mask<R>) -> Self

For each lane in the vector, shift right by the immediate value. Computes shri when mask is true, returns self where false.
Source§

fn shri_m<const I: i32>(self, src: Self, mask: Mask<R>) -> Self

For each lane in the vector, shift right by the immediate value. Merges shri with src using mask.
Source§

fn shri_z<const I: i32>(self, mask: Mask<R>) -> Self

For each lane in the vector, shift right by the immediate value. Computes shri masked (zeroed where mask is false).
Source§

fn shlv_c(self, mask: Mask<R>, shifts: Self::Unsigned) -> Self

For each lane in the vector, shift left by the given value. Computes shlv when mask is true, returns self where false.
Source§

fn shlv_m(self, src: Self, mask: Mask<R>, shifts: Self::Unsigned) -> Self

For each lane in the vector, shift left by the given value. Merges shlv with src using mask.
Source§

fn shlv_z(self, mask: Mask<R>, shifts: Self::Unsigned) -> Self

For each lane in the vector, shift left by the given value. Computes shlv masked (zeroed where mask is false).
Source§

fn shrv_c(self, mask: Mask<R>, shifts: Self::Unsigned) -> Self

For each lane in the vector, shift right by the given value. Computes shrv when mask is true, returns self where false.
Source§

fn shrv_m(self, src: Self, mask: Mask<R>, shifts: Self::Unsigned) -> Self

For each lane in the vector, shift right by the given value. Merges shrv with src using mask.
Source§

fn shrv_z(self, mask: Mask<R>, shifts: Self::Unsigned) -> Self

For each lane in the vector, shift right by the given value. Computes shrv masked (zeroed where mask is false).
Source§

fn rol_c(self, mask: Mask<R>, shift: u32) -> Self

For each element in the vector, rotate the bits to the left by the given number of bits. Computes rol when mask is true, returns self where false.
Source§

fn rol_m(self, src: Self, mask: Mask<R>, shift: u32) -> Self

For each element in the vector, rotate the bits to the left by the given number of bits. Merges rol with src using mask.
Source§

fn rol_z(self, mask: Mask<R>, shift: u32) -> Self

For each element in the vector, rotate the bits to the left by the given number of bits. Computes rol masked (zeroed where mask is false).
Source§

fn ror_c(self, mask: Mask<R>, shift: u32) -> Self

For each element in the vector, rotate the bits to the right by the given number of bits. Computes ror when mask is true, returns self where false.
Source§

fn ror_m(self, src: Self, mask: Mask<R>, shift: u32) -> Self

For each element in the vector, rotate the bits to the right by the given number of bits. Merges ror with src using mask.
Source§

fn ror_z(self, mask: Mask<R>, shift: u32) -> Self

For each element in the vector, rotate the bits to the right by the given number of bits. Computes ror masked (zeroed where mask is false).
Source§

fn roli_c<const I: i32>(self, mask: Mask<R>) -> Self

For each element in the vector, rotate the bits to the left by the immediate value number of bits. Computes roli when mask is true, returns self where false.
Source§

fn roli_m<const I: i32>(self, src: Self, mask: Mask<R>) -> Self

For each element in the vector, rotate the bits to the left by the immediate value number of bits. Merges roli with src using mask.
Source§

fn roli_z<const I: i32>(self, mask: Mask<R>) -> Self

For each element in the vector, rotate the bits to the left by the immediate value number of bits. Computes roli masked (zeroed where mask is false).
Source§

fn rori_c<const I: i32>(self, mask: Mask<R>) -> Self

For each element in the vector, rotate the bits to the right by the immediate value number of bits. Computes rori when mask is true, returns self where false.
Source§

fn rori_m<const I: i32>(self, src: Self, mask: Mask<R>) -> Self

For each element in the vector, rotate the bits to the right by the immediate value number of bits. Merges rori with src using mask.
Source§

fn rori_z<const I: i32>(self, mask: Mask<R>) -> Self

For each element in the vector, rotate the bits to the right by the immediate value number of bits. Computes rori masked (zeroed where mask is false).
Source§

fn rolv_c(self, mask: Mask<R>, counts: Self::Unsigned) -> Self

For each element in the vector, rotate the bits to the left by the given number of bits in the corresponding lane of counts. Computes rolv when mask is true, returns self where false.
Source§

fn rolv_m(self, src: Self, mask: Mask<R>, counts: Self::Unsigned) -> Self

For each element in the vector, rotate the bits to the left by the given number of bits in the corresponding lane of counts. Merges rolv with src using mask.
Source§

fn rolv_z(self, mask: Mask<R>, counts: Self::Unsigned) -> Self

For each element in the vector, rotate the bits to the left by the given number of bits in the corresponding lane of counts. Computes rolv masked (zeroed where mask is false).
Source§

fn rorv_c(self, mask: Mask<R>, counts: Self::Unsigned) -> Self

For each element in the vector, rotate the bits to the right by the given number of bits in the corresponding lane of counts. Computes rorv when mask is true, returns self where false.
Source§

fn rorv_m(self, src: Self, mask: Mask<R>, counts: Self::Unsigned) -> Self

For each element in the vector, rotate the bits to the right by the given number of bits in the corresponding lane of counts. Merges rorv with src using mask.
Source§

fn rorv_z(self, mask: Mask<R>, counts: Self::Unsigned) -> Self

For each element in the vector, rotate the bits to the right by the given number of bits in the corresponding lane of counts. Computes rorv masked (zeroed where mask is false).
Source§

fn reverse_bits_c(self, mask: Mask<R>) -> Self

For each element in the vector, reverse the bits of that element. Computes reverse_bits when mask is true, returns self where false.
Source§

fn reverse_bits_m(self, src: Self, mask: Mask<R>) -> Self

For each element in the vector, reverse the bits of that element. Merges reverse_bits with src using mask.
Source§

fn reverse_bits_z(self, mask: Mask<R>) -> Self

For each element in the vector, reverse the bits of that element. Computes reverse_bits masked (zeroed where mask is false).
Source§

impl<R: BitwiseRegister + Register> BitwiseVector for Vector<R>

Source§

const HAS_NATIVE_TERNLOG: bool = R::HAS_NATIVE_TERNLOG

Whether ternlog is a single native instruction (AVX-512 vpternlog{d,q}), forwarded from BitwiseRegister::HAS_NATIVE_TERNLOG. Read more
Source§

fn ternlog<const IMM: i32>(a: Self, b: Self, c: Self) -> Self

Computes an arbitrary bitwise boolean function of three inputs (a, b, c) based on the truth table specified by IMM. Read more
Source§

fn bilog<const IMM: i32>(a: Self, b: Self) -> Self

Two-input version of ternlog. Read more
Source§

fn ternlog_c<const IMM: i32>(mask: Mask<R>, a: Self, b: Self, c: Self) -> Self

Computes an arbitrary bitwise boolean function of three inputs (a, b, c) based on the truth table specified by IMM. Read more
Source§

fn ternlog_m<const IMM: i32>( src: Self, mask: Mask<R>, a: Self, b: Self, c: Self, ) -> Self

Computes an arbitrary bitwise boolean function of three inputs (a, b, c) based on the truth table specified by IMM. Read more
Source§

fn ternlog_z<const IMM: i32>(mask: Mask<R>, a: Self, b: Self, c: Self) -> Self

Computes an arbitrary bitwise boolean function of three inputs (a, b, c) based on the truth table specified by IMM. Read more
Source§

fn bilog_c<const IMM: i32>(mask: Mask<R>, a: Self, b: Self) -> Self

Two-input version of ternlog. Read more
Source§

fn bilog_m<const IMM: i32>(src: Self, mask: Mask<R>, a: Self, b: Self) -> Self

Two-input version of ternlog. Read more
Source§

fn bilog_z<const IMM: i32>(mask: Mask<R>, a: Self, b: Self) -> Self

Two-input version of ternlog. Read more
Source§

impl<R: NumericRegister> Bounded for Vector<R>

Source§

fn max_value() -> Self

Returns the largest finite number this type can represent
Source§

fn min_value() -> Self

Returns the smallest finite number this type can represent
Source§

impl<FROM, INTO> CastVector<Vector<FROM>> for Vector<INTO>
where FROM: Register + CastRegister<INTO>, INTO: Register + CastRegister<FROM>,

Source§

fn cast_from(from: Vector<FROM>) -> Self

Convert a vector of type FROM into Self, lane-by-lane, using as semantics on each element. See the trait docs for what float-to-int does with NaN and out-of-range lanes.
Source§

fn cast_into(self) -> Vector<FROM>

Convert this vector into a vector of type FROM, lane-by-lane.
Source§

fn fast_cast_into(self) -> Vector<FROM>

Like cast_into, but may take a faster path that relaxes IEEE corner cases. See GenericVector::fast_cast.
Source§

fn saturating_cast_from(from: Vector<FROM>) -> Self

Convert lane-by-lane, clamping out-of-range values to Self’s element range rather than wrapping (integers) or producing a backend-defined value (float to int). Read more
Source§

fn fast_cast_from(from: Vector<FROM>) -> Self

Like cast_from, but may take a faster path that relaxes IEEE corner cases. See GenericVector::fast_cast. Read more
Source§

impl<R: Register> Clone for Vector<R>

Source§

fn clone(&self) -> Self

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<R: Register, B> Concat<Vector<R>> for Vector<B>
where B: ConcatRegister<R> + Register,

Source§

fn concat(lo: Vector<R>, hi: Vector<R>) -> Self

Build the double-width value from a lo and hi half, with lo’s lanes occupying the lower half of the result and hi’s the upper half.
Source§

fn split(self) -> (Vector<R>, Vector<R>)

Split into (lo, hi) halves, the inverse of concat.
Source§

impl<R: Register> ConstDefault for Vector<R>

Source§

const DEFAULT: Self = Self::EMPTY

The constant default value.
Source§

impl<R: Register> Copy for Vector<R>

Source§

impl<R: Register> Debug for Vector<R>

Source§

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

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

impl<R: Register> Default for Vector<R>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<R: NumericRegister + Register> Div for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: IntegerRegister> Div<BranchfreeDivider<<R as Register>::Element>> for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: BranchfreeDivider<R::Element>) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: IntegerRegister> Div<Divider<<R as Register>::Element>> for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Divider<R::Element>) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: IntegerRegister> Div<VectorDivider<R>> for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: VectorDivider<R>) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: NumericRegister + Register> DivAssign for Vector<R>

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<R: NumericRegister + Register> DivAssignMasked<Mask<R>> for Vector<R>

Source§

fn div_assign_c(&mut self, mask: Mask<R>, rhs: Self)

Computes DivAssign with rhs where mask is true.
Source§

fn div_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: Self)

Merges DivAssign with src using mask, assigning src where mask is false.
Source§

fn div_assign_z(&mut self, mask: Mask<R>, rhs: Self)

Computes DivAssign masked (zeroed where mask is false).
Source§

impl<R: IntegerRegister> DivMasked<Mask<R>, BranchfreeDivider<<R as Register>::Element>> for Vector<R>
where R::Element: Denominator,

Source§

fn div_c( self, mask: Mask<R>, rhs: BranchfreeDivider<R::Element>, ) -> Self::Output

Computes Div with rhs where mask is true.
Source§

fn div_m( self, src: Self, mask: Mask<R>, rhs: BranchfreeDivider<R::Element>, ) -> Self::Output

Merges Div with src using mask, returning src where mask is false.
Source§

fn div_z( self, mask: Mask<R>, rhs: BranchfreeDivider<R::Element>, ) -> Self::Output

Computes Div masked (zeroed where mask is false).
Source§

impl<R: IntegerRegister> DivMasked<Mask<R>, Divider<<R as Register>::Element>> for Vector<R>
where R::Element: Denominator,

Source§

fn div_c(self, mask: Mask<R>, rhs: Divider<R::Element>) -> Self::Output

Computes Div with rhs where mask is true.
Source§

fn div_m( self, src: Self, mask: Mask<R>, rhs: Divider<R::Element>, ) -> Self::Output

Merges Div with src using mask, returning src where mask is false.
Source§

fn div_z(self, mask: Mask<R>, rhs: Divider<R::Element>) -> Self::Output

Computes Div masked (zeroed where mask is false).
Source§

impl<R: IntegerRegister> DivMasked<Mask<R>, VectorDivider<R>> for Vector<R>
where R::Element: Denominator,

Source§

fn div_c(self, mask: Mask<R>, rhs: VectorDivider<R>) -> Self::Output

Computes Div with rhs where mask is true.
Source§

fn div_m(self, src: Self, mask: Mask<R>, rhs: VectorDivider<R>) -> Self::Output

Merges Div with src using mask, returning src where mask is false.
Source§

fn div_z(self, mask: Mask<R>, rhs: VectorDivider<R>) -> Self::Output

Computes Div masked (zeroed where mask is false).
Source§

impl<R: NumericRegister + Register> DivMasked<Mask<R>> for Vector<R>

Source§

fn div_c(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes Div with rhs where mask is true.
Source§

fn div_m(self, src: Self, mask: Mask<R>, rhs: Self) -> Self::Output

Merges Div with src using mask, returning src where mask is false.
Source§

fn div_z(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes Div masked (zeroed where mask is false).
Source§

impl<R: Register, B> Extend<Vector<R>> for Vector<B>
where B: ExtendRegister<R> + Register,

Source§

fn extend(v: Vector<R>) -> Self

Widen v into Self, placing v’s lanes in the lower half and filling the upper half with zeros.
Source§

fn narrow(self) -> Vector<R>

Narrow back to FROM by keeping the lower lanes and discarding the upper lanes.
Source§

impl<R: FloatRegister<Element: FloatConsts>> FloatConsts for Vector<R>

Source§

const NEG_ZERO: Self

Negative zero (-0) (only sign bit set)
Source§

const E: Self

Euler’s number (e)
Source§

const EULER_GAMMA: Self

Euler-Mascheroni constant (γ)
Source§

const PI_SQUARED: Self

$\pi^2$
Source§

const PI_CUBED: Self

$\pi^3$
Source§

const PI_FOURTH: Self

$\pi^4$
Source§

const FRAC_1_PI: Self

$1/\pi$
Source§

const FRAC_1_SQRT_2: Self

$1/\sqrt{2}$
Source§

const FRAC_1_SQRT_3: Self

$1/\sqrt{3}$
Source§

const FRAC_2_PI: Self

$2/\pi$
Source§

const FRAC_1_SQRT_PI: Self

$1/\sqrt{\pi}$
Source§

const FRAC_2_SQRT_PI: Self

$2/\sqrt{\pi}$
Source§

const FRAC_SQRT_PI_2: Self

$\sqrt{\pi}/2$
Source§

const FRAC_1_SQRT_TAU: Self

$1/\sqrt{2\pi}$
Source§

const FRAC_PI_2: Self

$\pi/2$
Source§

const FRAC_PI_3: Self

$\pi/3$
Source§

const FRAC_PI_4: Self

$\pi/4$
Source§

const FRAC_PI_6: Self

$\pi/6$
Source§

const FRAC_PI_8: Self

$\pi/8$
Source§

const FRAC_PI_180: Self

$\pi/180$
Source§

const FRAC_180_PI: Self

$180/\pi$
Source§

const LN_2: Self

$\ln 2$
Source§

const LN_10: Self

$\ln 10$
Source§

const LN_PI: Self

$\ln \pi$
Source§

const FRAC_LN_PI_2: Self

$frac{1}{2}\ln \pi$
Source§

const LOG2_10: Self

$\log_2 10$
Source§

const LOG2_E: Self

$\log_2 e$
Source§

const LOG10_2: Self

$\log_{10} 2$
Source§

const LOG10_E: Self

$\log_{10} e$
Source§

const PI: Self

Archimedes’ constant (π)
Source§

const SQRT_2: Self

$\sqrt{2}$
Source§

const SQRT_3: Self

$\sqrt{3}$
Source§

const SQRT_E: Self

$\sqrt{e}$
Source§

const EPSILON: Self

The machine epsilon
Source§

const SQRT_EPSILON: Self

The square root of the machine epsilon ($\sqrt{ arepsilon}$)
Source§

const FOURTH_ROOT_EPSILON: Self

The fourth root of the machine epsilon ($\sqrt[4]{ arepsilon}$)
Source§

const TAU: Self

The full circle constant (τ)
Source§

const SQRT_FRAC_PI_2: Self

$\sqrt{\pi/2}$
Source§

const SQRT_TAU: Self

$\sqrt{2\pi}$
Source§

const PHI: Self

The golden ratio (φ)
Source§

const FRAC_1_3: Self

$1/3$
Source§

const FRAC_2_3: Self

$2/3$
Source§

const FRAC_1_4: Self

1/4
Source§

const FRAC_1_6: Self

1/6
Source§

const FRAC_NEG_1_E: Self

-1/e
Source§

impl<R: FloatRegister> FloatVector for Vector<R>

Source§

const HALF: Self

The value 0.5 represented in this vector type.
Source§

const NEG_ZERO: Self

The value -0.0 represented in this vector type.
Source§

const INFINITY: Self

The value infinity represented in this vector type.
Source§

const NEG_INFINITY: Self

The value -infinity represented in this vector type.
Source§

const NAN: Self

The value NaN represented in this vector type.
Source§

const EPSILON: Self

Hardware epsilon value in this vector type.
Source§

const HAS_APPROX_RCP: bool = R::HAS_APPROX_RCP

true if the backend has a hardware approximate-reciprocal instruction (e.g. rcpps on x86). When false, rcp falls back to a full IEEE division and provides no speed advantage over Self::ONE / self.
Source§

const HAS_APPROX_RSQRT: bool = R::HAS_APPROX_RSQRT

true if the backend has a hardware approximate-reciprocal-square-root instruction (e.g. rsqrtps on x86). When false, rsqrt falls back to Self::ONE / self.sqrt().
Source§

type ExtendedPrecision = Vector<<R as FloatRegister>::ExtendedPrecision>

If available, an extended precision floating point vector type corresponding to this vector type. E.g., for f32 vectors, this would be an f64 vector type. Read more
Source§

fn is_infinite(self) -> Self::Mask

Check if each element in the vector is infinite, returning a mask.
Source§

fn is_finite(self) -> Self::Mask

Check if each element in the vector is finite, returning a mask.
Source§

fn is_nan(self) -> Self::Mask

Check if each element in the vector is NaN, returning a mask.
Source§

fn is_zero_or_subnormal(self) -> Self::Mask

Check if each element in the vector is zero or subnormal, returning a mask.
Source§

fn is_normal(self) -> Self::Mask

Check if each element in the vector is normal, returning a mask.
Source§

fn is_subnormal(self) -> Self::Mask

Check if each element in the vector is subnormal, returning a mask.
Source§

fn sqrt(self) -> Self

Lane-wise IEEE 754 square root. Read more
Source§

fn rsqrt(self) -> Self

Lane-wise approximate reciprocal square root. Read more
Source§

fn rcp(self) -> Self

Lane-wise approximate reciprocal: 1 / self. Read more
Source§

fn floor(self) -> Self

Lane-wise floor: largest integer less than or equal to each element. Read more
Source§

fn ceil(self) -> Self

Lane-wise ceiling: smallest integer greater than or equal to each element, kept in the float representation.
Source§

fn round(self) -> Self

Lane-wise round-to-nearest. Read more
Source§

fn trunc(self) -> Self

Lane-wise truncation toward zero (drops the fractional part), kept in the float representation.
Source§

fn fract(self) -> Self

Lane-wise fractional part: self - self.trunc(). Read more
Source§

fn mul_sign(self, sign: Self) -> Self

Effectively self * sign.signum(), multiplying the sign bits.
Source§

fn signed_zero(self) -> Self

Returns zero with the sign of self, i.e.: only the sign bit is set.
Source§

fn next_up(self) -> Self

Returns the next representable value greater than the current value, towards positive infinity.
Source§

fn next_down(self) -> Self

Returns the next representable value less than the current value, towards negative infinity.
Source§

fn mix(self, a: Self, b: Self) -> Self

Linearly interpolates between a and b by self, where self is typically in the range [0, 1]. Read more
Source§

unsafe fn block_autovectorization(&mut self)

Inhibit further LLVM auto-vectorization of code surrounding this call. Read more
Source§

fn with_bits<const N: usize, K: AsFloatVectorWithBitsKernel<Self, N>>( values: [Self; N], kernel: K, ) -> Option<<K as AsFloatVectorWithBitsKernel<Self, N>>::Output>

Attempt to upcast this FloatVector to a FloatVectorWithBits, using the provided kernel. If not possible, returns None.
Source§

fn sqrt_c(self, mask: Mask<R>) -> Self

Lane-wise IEEE 754 square root. Read more
Source§

fn sqrt_m(self, src: Self, mask: Mask<R>) -> Self

Lane-wise IEEE 754 square root. Read more
Source§

fn sqrt_z(self, mask: Mask<R>) -> Self

Lane-wise IEEE 754 square root. Read more
Source§

fn rsqrt_c(self, mask: Mask<R>) -> Self

Lane-wise approximate reciprocal square root. Read more
Source§

fn rsqrt_m(self, src: Self, mask: Mask<R>) -> Self

Lane-wise approximate reciprocal square root. Read more
Source§

fn rsqrt_z(self, mask: Mask<R>) -> Self

Lane-wise approximate reciprocal square root. Read more
Source§

fn rcp_c(self, mask: Mask<R>) -> Self

Lane-wise approximate reciprocal: 1 / self. Read more
Source§

fn rcp_m(self, src: Self, mask: Mask<R>) -> Self

Lane-wise approximate reciprocal: 1 / self. Read more
Source§

fn rcp_z(self, mask: Mask<R>) -> Self

Lane-wise approximate reciprocal: 1 / self. Read more
Source§

fn floor_c(self, mask: Mask<R>) -> Self

Lane-wise floor: largest integer less than or equal to each element. Read more
Source§

fn floor_m(self, src: Self, mask: Mask<R>) -> Self

Lane-wise floor: largest integer less than or equal to each element. Read more
Source§

fn floor_z(self, mask: Mask<R>) -> Self

Lane-wise floor: largest integer less than or equal to each element. Read more
Source§

fn ceil_c(self, mask: Mask<R>) -> Self

Lane-wise ceiling: smallest integer greater than or equal to each element, kept in the float representation. Computes ceil when mask is true, returns self where false.
Source§

fn ceil_m(self, src: Self, mask: Mask<R>) -> Self

Lane-wise ceiling: smallest integer greater than or equal to each element, kept in the float representation. Merges ceil with src using mask.
Source§

fn ceil_z(self, mask: Mask<R>) -> Self

Lane-wise ceiling: smallest integer greater than or equal to each element, kept in the float representation. Computes ceil masked (zeroed where mask is false).
Source§

fn round_c(self, mask: Mask<R>) -> Self

Lane-wise round-to-nearest. Read more
Source§

fn round_m(self, src: Self, mask: Mask<R>) -> Self

Lane-wise round-to-nearest. Read more
Source§

fn round_z(self, mask: Mask<R>) -> Self

Lane-wise round-to-nearest. Read more
Source§

fn trunc_c(self, mask: Mask<R>) -> Self

Lane-wise truncation toward zero (drops the fractional part), kept in the float representation. Computes trunc when mask is true, returns self where false.
Source§

fn trunc_m(self, src: Self, mask: Mask<R>) -> Self

Lane-wise truncation toward zero (drops the fractional part), kept in the float representation. Merges trunc with src using mask.
Source§

fn trunc_z(self, mask: Mask<R>) -> Self

Lane-wise truncation toward zero (drops the fractional part), kept in the float representation. Computes trunc masked (zeroed where mask is false).
Source§

fn fract_c(self, mask: Mask<R>) -> Self

Lane-wise fractional part: self - self.trunc(). Read more
Source§

fn fract_m(self, src: Self, mask: Mask<R>) -> Self

Lane-wise fractional part: self - self.trunc(). Read more
Source§

fn fract_z(self, mask: Mask<R>) -> Self

Lane-wise fractional part: self - self.trunc(). Read more
Source§

fn mul_sign_c(self, mask: Mask<R>, sign: Self) -> Self

Effectively self * sign.signum(), multiplying the sign bits. Computes mul_sign when mask is true, returns self where false.
Source§

fn mul_sign_m(self, src: Self, mask: Mask<R>, sign: Self) -> Self

Effectively self * sign.signum(), multiplying the sign bits. Merges mul_sign with src using mask.
Source§

fn mul_sign_z(self, mask: Mask<R>, sign: Self) -> Self

Effectively self * sign.signum(), multiplying the sign bits. Computes mul_sign masked (zeroed where mask is false).
Source§

fn signed_zero_c(self, mask: Mask<R>) -> Self

Returns zero with the sign of self, i.e.: only the sign bit is set. Computes signed_zero when mask is true, returns self where false.
Source§

fn signed_zero_m(self, src: Self, mask: Mask<R>) -> Self

Returns zero with the sign of self, i.e.: only the sign bit is set. Merges signed_zero with src using mask.
Source§

fn signed_zero_z(self, mask: Mask<R>) -> Self

Returns zero with the sign of self, i.e.: only the sign bit is set. Computes signed_zero masked (zeroed where mask is false).
Source§

fn next_up_c(self, mask: Mask<R>) -> Self

Returns the next representable value greater than the current value, towards positive infinity. Computes next_up when mask is true, returns self where false.
Source§

fn next_up_m(self, src: Self, mask: Mask<R>) -> Self

Returns the next representable value greater than the current value, towards positive infinity. Merges next_up with src using mask.
Source§

fn next_up_z(self, mask: Mask<R>) -> Self

Returns the next representable value greater than the current value, towards positive infinity. Computes next_up masked (zeroed where mask is false).
Source§

fn next_down_c(self, mask: Mask<R>) -> Self

Returns the next representable value less than the current value, towards negative infinity. Computes next_down when mask is true, returns self where false.
Source§

fn next_down_m(self, src: Self, mask: Mask<R>) -> Self

Returns the next representable value less than the current value, towards negative infinity. Merges next_down with src using mask.
Source§

fn next_down_z(self, mask: Mask<R>) -> Self

Returns the next representable value less than the current value, towards negative infinity. Computes next_down masked (zeroed where mask is false).
Source§

fn one_minus_sq(self) -> Self

Computes $1 - x^2$ accurately, avoiding the cancellation a naive 1 - self * self suffers as self approaches ±1 (where the result is small but self * self is near 1). Read more
Source§

impl<R: FloatRegister> FloatVectorWithBits for Vector<R>

Source§

const NATIVE_CAP: NativeCapability = R::NATIVE_CAP

Bit-flag set describing which native_* methods on this trait have a real hardware implementation on the current backend. Read more
Source§

type SignedBits = Vector<<R as FloatRegister>::SignedBits>

This vector’s bit pattern viewed as signed integer lanes of the same width, for exponent arithmetic and the sign-aware bit tricks.
Source§

type Bits = Vector<<R as FloatRegister>::Bits>

This vector’s bit pattern viewed as unsigned integer lanes of the same width, which is what masking and shifting the raw bits wants.
Source§

unsafe fn native_ldexp(self, exp: Self::SignedBits) -> Self

Hardware-accelerated ldexp: self * 2^exp, lane-wise. Read more
Source§

unsafe fn native_frexp(self) -> (Self, Self::SignedBits)

Hardware-accelerated frexp: split each lane into a normalized mantissa in [0.5, 1.0) and an integer exponent. Read more
Source§

unsafe fn native_sin_cos<P: Policy>(self) -> (Self, Self)

Hardware-accelerated combined sine and cosine, lane-wise. Read more
Source§

unsafe fn native_sin<P: Policy>(self) -> Self

Hardware-accelerated sine, lane-wise. Read more
Source§

unsafe fn native_cos<P: Policy>(self) -> Self

Hardware-accelerated cosine, lane-wise. Read more
Source§

unsafe fn native_tan<P: Policy>(self) -> Self

Hardware-accelerated tangent, lane-wise. Read more
Source§

unsafe fn native_exp2<P: Policy>(self) -> Self

Hardware-accelerated 2^self, lane-wise. Read more
Source§

unsafe fn native_log2<P: Policy>(self) -> Self

Hardware-accelerated log2(self), lane-wise. Read more
Source§

unsafe fn native_exp<P: Policy>(self) -> Self

Hardware-accelerated e^self, lane-wise. Read more
Source§

unsafe fn native_ln<P: Policy>(self) -> Self

Hardware-accelerated natural logarithm, lane-wise. Read more
Source§

unsafe fn native_powf<P: Policy>(self, exp: Self) -> Self

Hardware-accelerated self^exp, lane-wise. Read more
Source§

fn total_order(self) -> Self::SignedBits

Return a signed integer vector that is capable of encapsulating the “total order” of the floating point values in this vector, /// such that when compared as integers, the ordering is the same as the floating point ordering, including NaNs, in the following order: Read more
Source§

fn linear_order(self) -> Self::SignedBits

Similar to total_order, but positive zero and negative zero are the same value. This can be used for calculating ULP differences by simply subtracting one from another.
Source§

impl<R> FloatVectorWithRegister for Vector<R>
where R: FloatRegister,

Source§

type Register = R

The backing hardware register this vector is a thin wrapper over.
Source§

impl<R> From<Vector<R>> for Mask<R>

Source§

fn from(value: Vector<R>) -> Self

Converts a vector of R into a mask. The mask will have all bits set to true if the corresponding element in the vector is non-zero, and false otherwise.

Source§

impl<R> GenericSelectable for Vector<R>
where R: Register,

Source§

type SelectableMask = Mask<R>

The mask type whose lane count and layout match Self.
Source§

fn select<M>(mask: M, t: Self, f: Self) -> Self
where Mask<R>: CastMask<M>,

For each lane, take the value from t where mask is true, otherwise from f.
Source§

impl<R: Register> GenericVector for Vector<R>

Source§

const EMPTY: Self

A vector with all elements zeroed.
Source§

const LANES: usize = <R::Lanes as generic_array::typenum::Unsigned>::USIZE

Number of lanes in the vector.
Source§

const HAS_NATIVE_ALIGN: bool = R::HAS_NATIVE_ALIGN

Whether align is a native cross-register instruction rather than the generic shuffle-and-blend fallback, forwarded from Register::HAS_NATIVE_ALIGN. Read more
Source§

type Element = <R as Register>::Element

Scalar element type of the vector.
Source§

type Lanes = <R as CoreRegister>::Lanes

Number of lanes in the vector, as a typenum.
Source§

type Unsigned = Vector<<R as Register>::Unsigned>

Unsigned Integer Type suitable for use with this vector.
Source§

type Signed = Vector<<R as Register>::Signed>

SignedBits Integer Type suitable for use with this vector.
Source§

type Mask = Mask<R>

Mask type for this vector. Masks are semantically boolean vectors indicating true or false for each lane. They may or may not be represented as actual bits.
Source§

fn new<const N: usize>(values: [R::Element; N]) -> Self
where Const<N>: IntoArrayLength<ArrayLength = R::Lanes>,

Create a new vector from an array of elements. Read more
Source§

fn into_array(self) -> GenericArray<R::Element, R::Lanes>

Consume the vector and return its elements as a GenericArray. Read more
Source§

fn splat(value: Self::Element) -> Self

Create a new vector from a single element by splatting it across all lanes.
Source§

fn single(value: Self::Element) -> Self

Create a new vector with the first lane set to the given value, and all other lanes set to zero.
Source§

fn broadcast<const I: usize>(self) -> Self

Broadcast the value of a single lane across all lanes of the vector.
Source§

fn broadcastv(self, idx: usize) -> Self

Broadcast the value of a single lane across all lanes of the vector. Read more
Source§

fn extract<const I: usize>(self) -> Self::Element

Extract a single element from the vector at the const-generic index I. Read more
Source§

fn extractv(self, idx: usize) -> Self::Element

Extract a single element from the vector at the runtime index idx. Read more
Source§

fn insert<const I: usize>(self, value: Self::Element) -> Self

Replace a single element in the vector at the const-generic index I. Read more
Source§

fn insertv(self, idx: usize, value: Self::Element) -> Self

Replace a single element in the vector at the runtime index idx. Read more
Source§

unsafe fn lookup_unchecked( values: &[Self::Element], indices: Self::Unsigned, ) -> Self

Assemble a vector from a slice of elements and a vector of indices into that slice. The indices are NOT checked to be within bounds. Read more
Source§

fn reverse(self) -> Self

Reverse the order of the elements in the vector. Read more
Source§

fn swap_bytes(self) -> Self

Swap the byte order of each element in the vector, converting between little-endian and big-endian representations lane-by-lane. Read more
Source§

fn compress(self, mask: Self::Mask) -> Self

Left-pack (a.k.a. compress): gather the lanes where mask is true into the low lanes, preserving their relative order. The unselected lanes are kept (not zeroed) and packed into the high lanes, also in order - a stable partition of the vector by mask. Read more
Source§

fn compress_z(self, mask: Self::Mask) -> Self

Zero-filling left-pack: like compress, but the lanes beyond the mask population count are zeroed instead of holding the unselected elements. Matches AVX-512 zero-masking vpcompress*. Read more
Source§

fn compress_m(self, src: Self, mask: Self::Mask) -> Self

Merge-masked left-pack: like compress, but the lanes at and beyond the mask population count take their values from src (at their own positions). Matches AVX-512 merge-masked vpcompress*. Read more
Source§

fn expand(self, mask: Self::Mask) -> Self

Inverse left-pack (expand): scatter this vector’s packed low lanes back out to the lanes where mask is set, preserving order; the unselected lanes read the tail. The exact inverse permutation of compress: v.compress(m).expand(m) == v and v.expand(m).compress(m) == v for every v and m. Read more
Source§

fn expand_z(self, mask: Self::Mask) -> Self

Zero-filling inverse left-pack: like expand, but the unselected lanes are zeroed. Matches AVX-512 zero-masking vpexpand*. Read more
Source§

fn expand_m(self, src: Self, mask: Self::Mask) -> Self

Merge-masked inverse left-pack: like expand, but the unselected lanes take their values from src. Matches AVX-512 merge-masked vpexpand*. Read more
Source§

fn align<const OFFSET: usize>(self, other: Self) -> Self

Two-register element align (the palignr family): the window of LANES lanes starting at lane OFFSET of the concatenation [self, other] (self’s lanes first, then other’s). OFFSET == 0 returns self, OFFSET == LANES returns other; in between, lanes spill from the tail of self into the head of other. Read more
Source§

fn zz(self, mask: Self::Mask) -> Self

(Zero If False) Zero elements if the corresponding mask lane is false; otherwise, leave unchanged. Read more
Source§

fn nz(self, mask: Self::Mask) -> Self

(Zero If True) Zero elements if the corresponding mask lane is true; otherwise, leave unchanged. Read more
Source§

fn map<F>(self, f: F) -> Self
where F: Fn(Self::Element) -> Self::Element,

Apply a function to each element in the vector, returning a new vector with the results. Read more
Source§

fn fold<F>(self, init: Self::Element, f: F) -> Self::Element
where F: Fn(Self::Element, Self::Element) -> Self::Element,

Fold the elements of the vector using the provided function and initial value. Read more
Source§

fn reduce<F>(self, f: F) -> Self::Element
where F: Fn(Self::Element, Self::Element) -> Self::Element,

Reduce the elements of the vector using the provided function. Read more
Source§

unsafe fn load(ptr: *const Self::Element) -> Self

Load a vector from an aligned pointer to its elements. Read more
Source§

unsafe fn load_unaligned(ptr: *const Self::Element) -> Self

Load a vector from an unaligned pointer to its elements. Read more
Source§

unsafe fn load_streaming(ptr: *const Self::Element) -> Self

Load a vector from a pointer to its elements using non-temporal (streaming) loads. Read more
Source§

unsafe fn store(self, ptr: *mut Self::Element)

Store the vector to an aligned pointer to its elements. Read more
Source§

unsafe fn store_masked(self, mask: Self::Mask, ptr: *mut Self::Element)

Store the vector to an aligned pointer to its elements, but only for lanes where the corresponding mask lane is true. For lanes where the mask is false, the store is suppressed without panicking. Read more
Source§

unsafe fn store_unaligned(self, ptr: *mut Self::Element)

Store the vector to an unaligned pointer to its elements. Read more
Source§

unsafe fn store_streaming(self, ptr: *mut Self::Element)

Store the vector to a pointer to its elements using non-temporal (streaming) stores. Read more
Source§

fn interleave_by<const GROUP: usize>(self, other: Self) -> (Self, Self)

Interleave two vectors at group granularity: blocks of GROUP consecutive elements move as a unit and are never split. GROUP == 1 is interleave; GROUP == 2 is the complex interleave - lo == [a.c0, b.c0, a.c1, b.c1, ...] over the low half of the groups, hi over the high half - which lowers to the doubled-element unpack (unpacklo_pd + permute2f128 on AVX2, zip on NEON) rather than a general permute. The primitive for complex FFT transposes and any group-structured SIMD. GROUP must divide LANES. Read more
Source§

fn deinterleave_by<const GROUP: usize>(self, other: Self) -> (Self, Self)

The inverse of interleave_by - group-granularity de-interleave.
Source§

fn interleave_radix<const N: usize>(inputs: [Self; N]) -> [Self; N]

Radix-N interleave: the generic sibling of interleave (N == 2). Treats the N inputs as one contiguous N * LANES span and gives out with concat(out)[q * N + r] == inputs[r].extract(q). Read more
Source§

fn deinterleave_radix<const N: usize>(inputs: [Self; N]) -> [Self; N]

The inverse of interleave_radix - radix-N de-interleave: out[r].extract(q) == concat(inputs)[q * N + r].
Source§

fn deinterleave_radix_by<const N: usize, const GROUP: usize>( inputs: [Self; N], ) -> [Self; N]

Group-granularity radix-N de-interleave: the two-axis unification of deinterleave_radix (GROUP == 1) and deinterleave_by (N == 2). Each vector is viewed as LANES / GROUP groups of GROUP consecutive elements; out[r] group q is the (q * N + r)-th group of the concatenated input sequence, each group moving as a unit. Read more
Source§

fn interleave_radix_by<const N: usize, const GROUP: usize>( inputs: [Self; N], ) -> [Self; N]

The inverse of deinterleave_radix_by - group-granularity radix-N interleave. For the square case it is the same (self-inverse) register-array transpose.
Source§

unsafe fn load_deinterleaved<const N: usize>( ptr: *const Self::Element, ) -> [Self; N]

Load N interleaved (array-of-structures) streams and de-interleave them into N vectors: reads N * LANES contiguous elements from ptr and returns out with out[j].extract(lane) == ptr[lane * N + j]. Read more
Source§

unsafe fn store_interleaved<const N: usize>( ptr: *mut Self::Element, values: [Self; N], )

Interleave N vectors and store them contiguously as an array-of-structures: writes N * LANES elements such that ptr[lane * N + j] == values[j].extract(lane). Read more
Source§

unsafe fn load_deinterleaved_arrays<const M: usize, const C: usize>( ptr: *const Self::Element, ) -> [[Self; C]; M]

Load M interleaved AoS records of C components each and de-interleave them: reads M * C * LANES contiguous elements, and out[j][c] holds component c of record j (out[j][c].extract(lane) == ptr[lane * M * C + j * C + c]). Read more
Source§

unsafe fn store_interleaved_arrays<const M: usize, const C: usize>( ptr: *mut Self::Element, values: [[Self; C]; M], )

Interleave M records of C components and store them contiguously - the exact inverse of load_deinterleaved_arrays, with the same lane-wise default. Read more
Source§

unsafe fn load_deinterleaved_grouped<const M: usize, const TAIL: usize>( ptr: *const Self::Element, ) -> [StreamGroup<Self, TAIL>; M]

Load M interleaved composite streams of 1 + TAIL components each and de-interleave them into M StreamGroups: reads M * (TAIL + 1) * LANES contiguous elements, and group j’s head/tail[c - 1] hold the de-interleaved components of composite stream j. See StreamGroup for why the component count is a separate const generic, and Register::load_deinterleaved_grouped for the register-level strategy. Read more
Source§

unsafe fn store_interleaved_grouped<const M: usize, const TAIL: usize>( ptr: *mut Self::Element, values: [StreamGroup<Self, TAIL>; M], )

Interleave M StreamGroups and store them as a contiguous array-of-structures - the exact inverse of load_deinterleaved_grouped, with the same lane-wise default and the same override expectations. Read more
Source§

fn splat_m(src: Self, mask: Mask<R>, value: Self::Element) -> Self

Create a new vector from a single element by splatting it across all lanes. Merges splat with src using mask.
Source§

fn splat_z(mask: Mask<R>, value: Self::Element) -> Self

Create a new vector from a single element by splatting it across all lanes. Computes splat masked (zeroed where mask is false).
Source§

fn broadcast_c<const I: usize>(self, mask: Mask<R>) -> Self

Broadcast the value of a single lane across all lanes of the vector. Computes broadcast when mask is true, returns self where false.
Source§

fn broadcast_m<const I: usize>(self, src: Self, mask: Mask<R>) -> Self

Broadcast the value of a single lane across all lanes of the vector. Merges broadcast with src using mask.
Source§

fn broadcast_z<const I: usize>(self, mask: Mask<R>) -> Self

Broadcast the value of a single lane across all lanes of the vector. Computes broadcast masked (zeroed where mask is false).
Source§

fn broadcastv_c(self, mask: Mask<R>, idx: usize) -> Self

Broadcast the value of a single lane across all lanes of the vector. Read more
Source§

fn broadcastv_m(self, src: Self, mask: Mask<R>, idx: usize) -> Self

Broadcast the value of a single lane across all lanes of the vector. Read more
Source§

fn broadcastv_z(self, mask: Mask<R>, idx: usize) -> Self

Broadcast the value of a single lane across all lanes of the vector. Read more
Source§

fn reverse_c(self, mask: Mask<R>) -> Self

Reverse the order of the elements in the vector. Read more
Source§

fn reverse_m(self, src: Self, mask: Mask<R>) -> Self

Reverse the order of the elements in the vector. Read more
Source§

fn reverse_z(self, mask: Mask<R>) -> Self

Reverse the order of the elements in the vector. Read more
Source§

fn swap_bytes_c(self, mask: Mask<R>) -> Self

Swap the byte order of each element in the vector, converting between little-endian and big-endian representations lane-by-lane. Read more
Source§

fn swap_bytes_m(self, src: Self, mask: Mask<R>) -> Self

Swap the byte order of each element in the vector, converting between little-endian and big-endian representations lane-by-lane. Read more
Source§

fn swap_bytes_z(self, mask: Mask<R>) -> Self

Swap the byte order of each element in the vector, converting between little-endian and big-endian representations lane-by-lane. Read more
Source§

unsafe fn load_m(src: Self, mask: Mask<R>, ptr: *const Self::Element) -> Self

Load a vector from an aligned pointer to its elements. Read more
Source§

unsafe fn load_z(mask: Mask<R>, ptr: *const Self::Element) -> Self

Load a vector from an aligned pointer to its elements. Read more
Source§

fn lanes() -> usize

Number of lanes in the vector, as a runtime value. Read more
Source§

fn concat<INTO>(self, hi: Self) -> INTO
where INTO: ConcatVector<Self, Element = Self::Element>,

Combine two vectors of the same type into one wider vector, with self as the lower half and hi as the upper half.
Source§

fn split<INTO: GenericVector>(self) -> (INTO, INTO)
where Self: ConcatVector<INTO, Element = INTO::Element>,

Split this vector into two narrower vectors of the same type, with the lower lanes in the first vector and the upper lanes in the second vector.
Source§

fn extend<INTO>(self) -> INTO
where INTO: ExtendVector<Self, Element = Self::Element>,

Zero-extend a narrower vector into this wider vector type, placing the original values in the lower lanes and filling the upper lanes with zeros.
Source§

fn narrow<INTO: GenericVector>(self) -> INTO
where Self: ExtendVector<INTO, Element = INTO::Element>,

Narrow this wider vector into a narrower vector by taking the lower lanes. Read more
Source§

fn align_slice( slice: &[Self::Element], ) -> (&[Self::Element], &[Self], &[Self::Element])

Align a slice of elements to the vector’s lane count, returning the aligned portion and any unaligned head or tail. Read more
Source§

fn align_slice_mut( slice: &mut [Self::Element], ) -> (&mut [Self::Element], &mut [Self], &mut [Self::Element])

Align a mutable slice of elements to the vector’s lane count, returning the aligned portion and any unaligned head or tail. Read more
Source§

fn from_slice(slice: &[Self::Element]) -> Self

Create a new vector from a slice of elements. The slice must have at least as many elements as the vector’s lanes. Read more
Source§

fn copy_to_slice(self, slice: &mut [Self::Element])

Copy the elements of the vector into a slice. The slice must have at least as many elements as the vector’s lanes. Read more
Source§

fn iter_unaligned<'a>( values: &'a [Self::Element], ) -> (Unaligned<'a, Self>, &'a [Self::Element])

Transform a slice of element values into an unaligned iterator of vectors, returning any remaining elements as a suffix slice.
Source§

fn iter_mut_unaligned<'a>( values: &'a mut [Self::Element], ) -> (UnalignedMut<'a, Self>, &'a mut [Self::Element])

Transform a mutable slice of element values into an unaligned iterator of vectors, returning any remaining elements as a suffix slice.
Source§

fn stream_aligned_slice<'a>( values: &'a [Self::Element], ) -> impl DoubleEndedIterator<Item = StreamingVector<'a, Self>>

Iterate over a slice of element values as Vectors using non-temporal (streaming) loads. Read more
Source§

fn stream_aligned_slice_mut<'a>( values: &'a mut [Self::Element], ) -> impl DoubleEndedIterator<Item = StreamingVectorMut<'a, Self>>

Iterate over a mutable slice of element values as Vectors using non-temporal (streaming) loads and stores. Read more
Source§

fn gather<I: VectorIndices<Self>>(slice: &[Self::Element], indices: I) -> Self

Gather elements from memory at the specified indices and return a new vector with those elements. Read more
Source§

fn gather_or<I: VectorIndices<Self>>( slice: &[Self::Element], indices: I, or: Self, ) -> Self
where Self::Mask: CastMask<I::Mask>,

Gather elements from memory at the specified indices, or return or if the index is out of bounds. Read more
Source§

fn gather_or_zero<I: VectorIndices<Self>>( slice: &[Self::Element], indices: I, ) -> Self
where Self::Mask: CastMask<I::Mask>,

Gather elements from memory at the specified indices, or set the lane to zero if the index is out of bounds. Read more
Source§

fn gather_if<I: VectorIndices<Self>>( slice: &[Self::Element], enable: Self::Mask, indices: I, or: Self, ) -> Self
where Self::Mask: CastMask<I::Mask>, Self::Element: Default,

Gather elements from memory at the specified indices, or return or if the enable mask is false OR if any index is out of bounds. Read more
Source§

fn scatter<I: VectorIndices<Self>>( self, slice: &mut [Self::Element], indices: I, )
where Self::Mask: CastMask<I::Mask>,

Scatter elements from the given vector into memory at the specified indices. If the index is outside of the bounds of the provided slice, the write is suppressed without panicking.
Source§

fn scatter_if<I: VectorIndices<Self>>( self, slice: &mut [Self::Element], enable: Self::Mask, indices: I, )
where Self::Mask: CastMask<I::Mask>,

Scatter elements from the given vector into memory at the specified indices, but only for lanes where the enable mask is true. If the index is outside of the bounds of the provided slice, the write is suppressed without panicking.
Source§

fn lookup(values: &[Self::Element], indices: Self::Unsigned) -> Self

Assemble a vector from a slice of elements and a vector of indices into that slice. If an index is outside the bounds of the given slice, the resulting lane will be the first element of the input slice. Read more
Source§

fn first(self) -> Self::Element

Extract lane 0 – the scalar counterpart to single. Read more
Source§

fn prefix_mask(n: usize) -> Self::Mask

Construct a mask whose first n lanes are true and the remaining lanes false. Read more
Source§

fn suffix_mask(n: usize) -> Self::Mask

Construct a mask whose last n lanes are true and the remaining lanes false. Read more
Source§

fn cast<INTO>(self) -> INTO
where INTO: CastVector<Self>,

Numeric cast to another vector type, matching the semantics of Rust’s as operator on the underlying scalar elements for in-range, finite inputs. Read more
Source§

fn fast_cast<INTO>(self) -> INTO
where INTO: CastVector<Self>,

Fast numeric cast to another vector type. Read more
Source§

fn into_bits<INTO>(self) -> INTO
where INTO: BitCastVector<Self>,

Reinterpret the bits of this vector as another vector type of the same size and lane count. Read more
Source§

fn saturating_cast<INTO>(self) -> INTO
where INTO: CastVector<Self>,

Cast that saturates (clamps) out-of-range values to the destination element range, rather than wrapping (integers) or producing a backend-defined value (float-to-int) like cast. Read more
Source§

impl<R: Register> HasIsa for Vector<R>

Source§

const ISA: InstructionSet = R::ISA

The instruction set this backend implements. Read more
Source§

type Native = <R as CoreRegister>::NativeIsa

The backend this type executes on. Read more
Source§

impl<R: Register> Index<usize> for Vector<R>

Source§

type Output = <R as Register>::Element

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<R: Register> IndexMut<usize> for Vector<R>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<R, I> IndexableVector<Vector<I>> for Vector<R>
where R: IndexableRegister<I>, I: UnsignedIntegerRegister<Lanes = R::Lanes>,

Source§

unsafe fn gather_ptr(ptr: *const Self::Element, indices: Vector<I>) -> Self

Gather one element per lane from ptr[indices[lane]]. Read more
Source§

unsafe fn gather_ptr_m( src: Self, mask: Self::Mask, ptr: *const Self::Element, indices: Vector<I>, ) -> Self

Like gather_ptr, but only lanes where mask is true are loaded; the rest are taken from src. Read more
Source§

unsafe fn gather_ptr_z( mask: Self::Mask, ptr: *const Self::Element, indices: Vector<I>, ) -> Self

Like gather_ptr_m, but masked-off lanes are zeroed instead of taken from a source vector. Read more
Source§

unsafe fn scatter_ptr(value: Self, ptr: *mut Self::Element, indices: Vector<I>)

Scatter each lane of value to ptr[indices[lane]]. Read more
Source§

unsafe fn scatter_ptr_m( value: Self, mask: Self::Mask, ptr: *mut Self::Element, indices: Vector<I>, )

Like scatter_ptr, but only lanes where mask is true are written. Read more
Source§

impl<R: IntegerRegister> IntegerVector for Vector<R>
where R::Element: Denominator,

Source§

type Divider = Divider<<R as Register>::Element>

Precomputed scalar divider used by per-lane division against a runtime-known but loop-invariant divisor. See crate::Divider.
Source§

type BranchfreeDivider = BranchfreeDivider<<R as Register>::Element>

Branchfree variant of Divider. Slightly slower for some divisors but always emits straight-line code with no conditional branches, which is what you want inside a hot SIMD loop.
Source§

type VectorizedDivider = VectorDivider<R>

Precomputed per-lane divider produced by to_divider. Used when each lane needs a different (but loop-invariant) divisor.
Source§

fn mulhi(self, other: Self) -> Self

Multiply two vectors lane-wise and return the high half of each double-width product. Read more
Source§

fn mullo(self, other: Self) -> Self

Multiply two vectors lane-wise and return the low half of each product, with wrapping on overflow. Read more
Source§

fn saturating_add(self, other: Self) -> Self

Per-lane saturating addition: instead of wrapping, the result is clamped to the element type’s range (MIN..=MAX) on overflow.
Source§

fn saturating_sub(self, other: Self) -> Self

Per-lane saturating subtraction: instead of wrapping, the result is clamped to the element type’s range (MIN..=MAX) on overflow.
Source§

fn wrapping_sum(self) -> Self::Element

Horizontal sum of all lanes, wrapping on overflow. Read more
Source§

fn wrapping_prod(self) -> Self::Element

Horizontal product of all lanes, wrapping on overflow. Read more
Source§

fn create_divider(d: Self::Element) -> Self::Divider

Build a Divider for a single scalar divisor d, suitable for repeatedly dividing many vectors by the same d. Read more
Source§

fn create_branchfree_divider(d: Self::Element) -> Self::BranchfreeDivider

Build a BranchfreeDivider for a single scalar divisor d. Prefer this over create_divider inside tight SIMD loops where conditional branches would hurt throughput.
Source§

fn to_divider(self) -> Self::VectorizedDivider

Use this vector as the denominators for a vectorized division operation. Read more
Source§

fn count_ones(self) -> Self

For each element in the vector, count the number of bits that are set to 1.
Source§

fn count_zeros(self) -> Self

For each element in the vector, count the number of bits that are set to 0.
Source§

fn leading_ones(self) -> Self

For each element in the vector, count the number of leading ones.
Source§

fn leading_zeros(self) -> Self

For each element in the vector, count the number of leading zeros.
Source§

fn trailing_ones(self) -> Self

For each element in the vector, count the number of trailing ones.
Source§

fn trailing_zeros(self) -> Self

For each element in the vector, count the number of trailing zeros.
Source§

fn count_conflicts(self) -> Self

For each lane, how many earlier lanes hold the same value: out[i] == |{ j < i : self[j] == self[i] }|. Read more
Source§

fn mulhi_c(self, mask: Mask<R>, other: Self) -> Self

Multiply two vectors lane-wise and return the high half of each double-width product. Read more
Source§

fn mulhi_m(self, src: Self, mask: Mask<R>, other: Self) -> Self

Multiply two vectors lane-wise and return the high half of each double-width product. Read more
Source§

fn mulhi_z(self, mask: Mask<R>, other: Self) -> Self

Multiply two vectors lane-wise and return the high half of each double-width product. Read more
Source§

fn mullo_c(self, mask: Mask<R>, other: Self) -> Self

Multiply two vectors lane-wise and return the low half of each product, with wrapping on overflow. Read more
Source§

fn mullo_m(self, src: Self, mask: Mask<R>, other: Self) -> Self

Multiply two vectors lane-wise and return the low half of each product, with wrapping on overflow. Read more
Source§

fn mullo_z(self, mask: Mask<R>, other: Self) -> Self

Multiply two vectors lane-wise and return the low half of each product, with wrapping on overflow. Read more
Source§

fn saturating_add_c(self, mask: Mask<R>, other: Self) -> Self

Per-lane saturating addition: instead of wrapping, the result is clamped to the element type’s range (MIN..=MAX) on overflow. Computes saturating_add when mask is true, returns self where false.
Source§

fn saturating_add_m(self, src: Self, mask: Mask<R>, other: Self) -> Self

Per-lane saturating addition: instead of wrapping, the result is clamped to the element type’s range (MIN..=MAX) on overflow. Merges saturating_add with src using mask.
Source§

fn saturating_add_z(self, mask: Mask<R>, other: Self) -> Self

Per-lane saturating addition: instead of wrapping, the result is clamped to the element type’s range (MIN..=MAX) on overflow. Computes saturating_add masked (zeroed where mask is false).
Source§

fn saturating_sub_c(self, mask: Mask<R>, other: Self) -> Self

Per-lane saturating subtraction: instead of wrapping, the result is clamped to the element type’s range (MIN..=MAX) on overflow. Computes saturating_sub when mask is true, returns self where false.
Source§

fn saturating_sub_m(self, src: Self, mask: Mask<R>, other: Self) -> Self

Per-lane saturating subtraction: instead of wrapping, the result is clamped to the element type’s range (MIN..=MAX) on overflow. Merges saturating_sub with src using mask.
Source§

fn saturating_sub_z(self, mask: Mask<R>, other: Self) -> Self

Per-lane saturating subtraction: instead of wrapping, the result is clamped to the element type’s range (MIN..=MAX) on overflow. Computes saturating_sub masked (zeroed where mask is false).
Source§

fn count_ones_c(self, mask: Mask<R>) -> Self

For each element in the vector, count the number of bits that are set to 1. Computes count_ones when mask is true, returns self where false.
Source§

fn count_ones_m(self, src: Self, mask: Mask<R>) -> Self

For each element in the vector, count the number of bits that are set to 1. Merges count_ones with src using mask.
Source§

fn count_ones_z(self, mask: Mask<R>) -> Self

For each element in the vector, count the number of bits that are set to 1. Computes count_ones masked (zeroed where mask is false).
Source§

fn count_zeros_c(self, mask: Mask<R>) -> Self

For each element in the vector, count the number of bits that are set to 0. Computes count_zeros when mask is true, returns self where false.
Source§

fn count_zeros_m(self, src: Self, mask: Mask<R>) -> Self

For each element in the vector, count the number of bits that are set to 0. Merges count_zeros with src using mask.
Source§

fn count_zeros_z(self, mask: Mask<R>) -> Self

For each element in the vector, count the number of bits that are set to 0. Computes count_zeros masked (zeroed where mask is false).
Source§

fn leading_ones_c(self, mask: Mask<R>) -> Self

For each element in the vector, count the number of leading ones. Computes leading_ones when mask is true, returns self where false.
Source§

fn leading_ones_m(self, src: Self, mask: Mask<R>) -> Self

For each element in the vector, count the number of leading ones. Merges leading_ones with src using mask.
Source§

fn leading_ones_z(self, mask: Mask<R>) -> Self

For each element in the vector, count the number of leading ones. Computes leading_ones masked (zeroed where mask is false).
Source§

fn leading_zeros_c(self, mask: Mask<R>) -> Self

For each element in the vector, count the number of leading zeros. Computes leading_zeros when mask is true, returns self where false.
Source§

fn leading_zeros_m(self, src: Self, mask: Mask<R>) -> Self

For each element in the vector, count the number of leading zeros. Merges leading_zeros with src using mask.
Source§

fn leading_zeros_z(self, mask: Mask<R>) -> Self

For each element in the vector, count the number of leading zeros. Computes leading_zeros masked (zeroed where mask is false).
Source§

fn trailing_ones_c(self, mask: Mask<R>) -> Self

For each element in the vector, count the number of trailing ones. Computes trailing_ones when mask is true, returns self where false.
Source§

fn trailing_ones_m(self, src: Self, mask: Mask<R>) -> Self

For each element in the vector, count the number of trailing ones. Merges trailing_ones with src using mask.
Source§

fn trailing_ones_z(self, mask: Mask<R>) -> Self

For each element in the vector, count the number of trailing ones. Computes trailing_ones masked (zeroed where mask is false).
Source§

fn trailing_zeros_c(self, mask: Mask<R>) -> Self

For each element in the vector, count the number of trailing zeros. Computes trailing_zeros when mask is true, returns self where false.
Source§

fn trailing_zeros_m(self, src: Self, mask: Mask<R>) -> Self

For each element in the vector, count the number of trailing zeros. Merges trailing_zeros with src using mask.
Source§

fn trailing_zeros_z(self, mask: Mask<R>) -> Self

For each element in the vector, count the number of trailing zeros. Computes trailing_zeros masked (zeroed where mask is false).
Source§

impl<R: Register> Interleave for Vector<R>

Source§

fn interleave(self, other: Self) -> (Self, Self)

Unpack and interleave elements from two vectors. Read more
Source§

fn deinterleave(self, other: Self) -> (Self, Self)

Pack and deinterleave elements from two vectors. This is the inverse operation of interleave. Read more
Source§

impl<R: LinAlg3Register> LinAlg3Vector for Vector<R>

Source§

fn dot3(self, other: Self) -> Self::Element

Scalar Product using only the first three lanes of the register as a 3D vector. Read more
Source§

fn cross3<const DOP: bool>(self, other: Self) -> Self

Cross Product using only the first three lanes of the register as a 3D vector. Read more
Source§

fn refract(self, n: Self, eta: Self::Element) -> Self

Refraction of incident vector self through a surface with normal n and relative index of refraction eta ($\eta = \eta_i/\eta_t$). self and n are assumed unit length. Read more
Source§

fn zero4(self) -> Self

Efficiently set the 4th (last) lane of the register to 0.0. Read more
Source§

fn one4(self) -> Self

Efficiently set the 4th (last) lane of the register to 1.0. Read more
Source§

fn min_element3(self) -> Self::Element

Returns the minimum value in the first three lanes of the register.
Source§

fn max_element3(self) -> Self::Element

Returns the maximum value in the first three lanes of the register.
Source§

fn sum_elements3(self) -> Self::Element

Returns the sum of the first three elements of the register.
Source§

fn prod_elements3(self) -> Self::Element

Returns the product of the first three elements of the register.
Source§

fn mat3_transpose(m: &[Self; 3]) -> [Self; 3]

3x3 Matrix Transpose. Read more
Source§

fn mat3_vec3_product<const COLUMN_MAJOR: bool>(self, m: &[Self; 3]) -> Self

3x3 Matrix-Vector multiplication, assuming self as the vector.
Source§

fn mat3_vec3_product_array<const COLUMN_MAJOR: bool, const N: usize>( m: &[Self; 3], vectors: &[Self; N], ) -> [Self; N]

3x3 matrix times N 3D vectors (small-N batch; see mat4_vec4_product_array).
Source§

fn mat3_product<const COLUMN_MAJOR: bool>( lhs: &[Self; 3], rhs: &[Self; 3], ) -> [Self; 3]

3x3 Matrix-Matrix multiplication. Read more
Source§

fn mat3_det(m: &[Self; 3]) -> Self::Element

Determinant of a column-major 3x3 matrix.
Source§

fn mat3_inverse_inplace(m: &mut [Self; 3]) -> Self::Element

In-place 3x3 Matrix inversion; returns the determinant. Read more
Source§

fn mat3_normal<const DIVIDE: bool>(m: &[Self; 3]) -> [Self; 3]

“Normal matrix” for transforming normals under non-uniform scale, from the cofactor cross-products of a column-major 3x3. Read more
Source§

fn mat3_inverse(m: &[Self; 3]) -> Option<[Self; 3]>

3x3 Matrix inversion. Read more
Source§

impl<R: LinAlg4Register> LinAlg4Vector for Vector<R>

Source§

fn dot4(self, other: Self) -> Self::Element

Scalar Product using all four lanes of the register as a 4D vector.
Source§

fn quat4_product(self, other: Self) -> Self

Quaternion multiplication. Read more
Source§

fn quat4_vec3_product<const DOP: bool>(self, vec: Self) -> Self

Quaternion-vector multiplication. Read more
Source§

fn quat_to_mat3<const COLUMN_MAJOR: bool>(self) -> [Self; 3]

Rotation matrix of a unit quaternion as 3 registers; the 4th lane of each is unspecified. Read more
Source§

fn quat_to_mat4<const COLUMN_MAJOR: bool>(self) -> [Self; 4]

Homogeneous 4x4 rotation matrix of a unit quaternion: the quat_to_mat3 rotation with each rotation register’s 4th lane zeroed and a [0, 0, 0, 1] 4th register. COLUMN_MAJOR is forwarded to quat_to_mat3.
Source§

fn mat4_transpose(m: &[Self; 4]) -> [Self; 4]

4x4 Matrix Transpose.
Source§

fn mat4_vec4_product<const COLUMN_MAJOR: bool>(self, m: &[Self; 4]) -> Self

4x4 Matrix-Vector multiplication, assuming self as the vector. Read more
Source§

fn mat4_vec3_product<const COLUMN_MAJOR: bool>(self, m: &[Self; 4]) -> Self

4x4 Matrix-Vector3 multiplication, optimized for the case where the vector is a 3D coordinate (i.e., the 4th lane is ignored). Read more
Source§

fn mat4_vec3_product_array<const COLUMN_MAJOR: bool, const N: usize>( m: &[Self; 4], vectors: &[Self; N], ) -> [Self; N]

4x4 matrix multiplied with N 3D vectors (small-N batch; see mat4_vec4_product_array).
Source§

fn mat4_point3_product<const COLUMN_MAJOR: bool>(self, m: &[Self; 4]) -> Self

4x4 Matrix-Point3 multiplication, optimized for the case where the input 3D value is a point of homogenous coordinates (i.e. 4th lane is 1.0). Read more
Source§

fn mat4_point3_product_array<const COLUMN_MAJOR: bool, const N: usize>( m: &[Self; 4], vectors: &[Self; N], ) -> [Self; N]

4x4 Matrix multiplied with N 3D points (small-N batch).
Source§

fn mat4_product<const COLUMN_MAJOR: bool>( lhs: &[Self; 4], rhs: &[Self; 4], ) -> [Self; 4]

4x4 Matrix-Matrix multiplication. Read more
Source§

fn mat4_vec4_product_array<const COLUMN_MAJOR: bool, const N: usize>( m: &[Self; 4], vectors: &[Self; N], ) -> [Self; N]

Transform N vectors by a single 4x4 matrix, returning the transformed array. Read more
Source§

fn mat4_det(m: &[Self; 4]) -> Self::Element

Compute the determinant of a 4x4 matrix without inverting it.
Source§

fn mat4_inverse_inplace(m: &mut [Self; 4]) -> Self::Element

In-place 4x4 Matrix inversion; returns the determinant. Read more
Source§

fn mat4_inverse(m: &[Self; 4]) -> Option<[Self; 4]>

4x4 Matrix inversion. Read more
Source§

impl<R: NumericRegister + Register> Mul for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: FloatRegister> MulAddAssignExt for Vector<R>

Source§

fn mul_add_assign(&mut self, a: Self, b: Self)

Guaranteed fused-multiply-add operation. Read more
Source§

fn mul_sub_assign(&mut self, a: Self, b: Self)

Guaranteed fused-multiply-subtract operation. Read more
Source§

fn nmul_add_assign(&mut self, a: Self, b: Self)

Guaranteed fused-negated-multiply-add operation. Read more
Source§

fn nmul_sub_assign(&mut self, a: Self, b: Self)

Guaranteed fused-negated-multiply-subtract operation. Read more
Source§

fn mul_adde_assign(&mut self, a: Self, b: Self)

Fused-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA.
Source§

fn mul_sube_assign(&mut self, a: Self, b: Self)

Fused-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA.
Source§

fn nmul_adde_assign(&mut self, a: Self, b: Self)

Fused-negated-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA.
Source§

fn nmul_sube_assign(&mut self, a: Self, b: Self)

Fused-negated-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA.
Source§

impl<R: FloatRegister> MulAddAssignExtMasked<Mask<R>> for Vector<R>

Source§

fn mul_add_assign_c(&mut self, mask: Mask<R>, a: Self, b: Self)

Guaranteed fused-multiply-add operation. Read more
Source§

fn mul_add_assign_m(&mut self, src: Self, mask: Mask<R>, a: Self, b: Self)

Guaranteed fused-multiply-add operation. Read more
Source§

fn mul_add_assign_z(&mut self, mask: Mask<R>, a: Self, b: Self)

Guaranteed fused-multiply-add operation. Read more
Source§

fn mul_sub_assign_c(&mut self, mask: Mask<R>, a: Self, b: Self)

Guaranteed fused-multiply-subtract operation. Read more
Source§

fn mul_sub_assign_m(&mut self, src: Self, mask: Mask<R>, a: Self, b: Self)

Guaranteed fused-multiply-subtract operation. Read more
Source§

fn mul_sub_assign_z(&mut self, mask: Mask<R>, a: Self, b: Self)

Guaranteed fused-multiply-subtract operation. Read more
Source§

fn nmul_add_assign_c(&mut self, mask: Mask<R>, a: Self, b: Self)

Guaranteed fused-negated-multiply-add operation. Read more
Source§

fn nmul_add_assign_m(&mut self, src: Self, mask: Mask<R>, a: Self, b: Self)

Guaranteed fused-negated-multiply-add operation. Read more
Source§

fn nmul_add_assign_z(&mut self, mask: Mask<R>, a: Self, b: Self)

Guaranteed fused-negated-multiply-add operation. Read more
Source§

fn nmul_sub_assign_c(&mut self, mask: Mask<R>, a: Self, b: Self)

Guaranteed fused-negated-multiply-subtract operation. Read more
Source§

fn nmul_sub_assign_m(&mut self, src: Self, mask: Mask<R>, a: Self, b: Self)

Guaranteed fused-negated-multiply-subtract operation. Read more
Source§

fn nmul_sub_assign_z(&mut self, mask: Mask<R>, a: Self, b: Self)

Guaranteed fused-negated-multiply-subtract operation. Read more
Source§

fn mul_adde_assign_c(&mut self, mask: Mask<R>, a: Self, b: Self)

Fused-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA. Read more
Source§

fn mul_adde_assign_m(&mut self, src: Self, mask: Mask<R>, a: Self, b: Self)

Fused-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA. Read more
Source§

fn mul_adde_assign_z(&mut self, mask: Mask<R>, a: Self, b: Self)

Fused-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA. Read more
Source§

fn mul_sube_assign_c(&mut self, mask: Mask<R>, a: Self, b: Self)

Fused-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA. Read more
Source§

fn mul_sube_assign_m(&mut self, src: Self, mask: Mask<R>, a: Self, b: Self)

Fused-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA. Read more
Source§

fn mul_sube_assign_z(&mut self, mask: Mask<R>, a: Self, b: Self)

Fused-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA. Read more
Source§

fn nmul_adde_assign_c(&mut self, mask: Mask<R>, a: Self, b: Self)

Fused-negated-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA. Read more
Source§

fn nmul_adde_assign_m(&mut self, src: Self, mask: Mask<R>, a: Self, b: Self)

Fused-negated-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA. Read more
Source§

fn nmul_adde_assign_z(&mut self, mask: Mask<R>, a: Self, b: Self)

Fused-negated-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA. Read more
Source§

fn nmul_sube_assign_c(&mut self, mask: Mask<R>, a: Self, b: Self)

Fused-negated-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA. Read more
Source§

fn nmul_sube_assign_m(&mut self, src: Self, mask: Mask<R>, a: Self, b: Self)

Fused-negated-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA. Read more
Source§

fn nmul_sube_assign_z(&mut self, mask: Mask<R>, a: Self, b: Self)

Fused-negated-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA. Read more
Source§

impl<R: FloatRegister> MulAddExt for Vector<R>

Source§

const HAS_TRUE_FMA: bool = R::HAS_TRUE_FMA

Indicates whether the implementation uses true fused-multiply-add instructions. Read more
Source§

type Output = Vector<R>

The result of the fused operation.
Source§

fn mul_add(self, a: Self, b: Self) -> Self::Output

Guaranteed fused-multiply-add operation. Read more
Source§

fn mul_sub(self, a: Self, b: Self) -> Self::Output

Guaranteed fused-multiply-subtract operation. Read more
Source§

fn nmul_add(self, a: Self, b: Self) -> Self::Output

Guaranteed fused-negated-multiply-add operation. Read more
Source§

fn nmul_sub(self, a: Self, b: Self) -> Self::Output

Guaranteed fused-negated-multiply-subtract operation. Read more
Source§

fn mul_adde(self, a: Self, b: Self) -> Self::Output

Fused-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA.
Source§

fn mul_sube(self, a: Self, b: Self) -> Self::Output

Fused-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA.
Source§

fn nmul_adde(self, a: Self, b: Self) -> Self::Output

Fused-negated-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA.
Source§

fn nmul_sube(self, a: Self, b: Self) -> Self::Output

Fused-negated-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA.
Source§

impl<R: FloatRegister> MulAddExtMasked<Mask<R>> for Vector<R>

Source§

fn mul_add_c(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Guaranteed fused-multiply-add operation. Read more
Source§

fn mul_add_m(self, src: Self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Guaranteed fused-multiply-add operation. Read more
Source§

fn mul_add_z(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Guaranteed fused-multiply-add operation. Read more
Source§

fn mul_sub_c(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Guaranteed fused-multiply-subtract operation. Read more
Source§

fn mul_sub_m(self, src: Self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Guaranteed fused-multiply-subtract operation. Read more
Source§

fn mul_sub_z(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Guaranteed fused-multiply-subtract operation. Read more
Source§

fn nmul_add_c(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Guaranteed fused-negated-multiply-add operation. Read more
Source§

fn nmul_add_m(self, src: Self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Guaranteed fused-negated-multiply-add operation. Read more
Source§

fn nmul_add_z(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Guaranteed fused-negated-multiply-add operation. Read more
Source§

fn nmul_sub_c(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Guaranteed fused-negated-multiply-subtract operation. Read more
Source§

fn nmul_sub_m(self, src: Self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Guaranteed fused-negated-multiply-subtract operation. Read more
Source§

fn nmul_sub_z(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Guaranteed fused-negated-multiply-subtract operation. Read more
Source§

fn mul_adde_c(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Fused-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA. Read more
Source§

fn mul_adde_m(self, src: Self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Fused-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA. Read more
Source§

fn mul_adde_z(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Fused-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA. Read more
Source§

fn mul_sube_c(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Fused-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA. Read more
Source§

fn mul_sube_m(self, src: Self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Fused-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA. Read more
Source§

fn mul_sube_z(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Fused-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA. Read more
Source§

fn nmul_adde_c(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Fused-negated-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA. Read more
Source§

fn nmul_adde_m(self, src: Self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Fused-negated-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA. Read more
Source§

fn nmul_adde_z(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Fused-negated-multiply-add operation where possible. May gracefully degrade to separate multiply and add if the target architecture does not support native FMA. Read more
Source§

fn nmul_sube_c(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Fused-negated-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA. Read more
Source§

fn nmul_sube_m(self, src: Self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Fused-negated-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA. Read more
Source§

fn nmul_sube_z(self, mask: Mask<R>, a: Self, b: Self) -> Self::Output

Fused-negated-multiply-subtract operation where possible. May gracefully degrade to separate multiply and subtract if the target architecture does not support native FMA. Read more
Source§

impl<R: NumericRegister + Register> MulAssign for Vector<R>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<R: NumericRegister + Register> MulAssignMasked<Mask<R>> for Vector<R>

Source§

fn mul_assign_c(&mut self, mask: Mask<R>, rhs: Self)

Computes MulAssign with rhs where mask is true.
Source§

fn mul_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: Self)

Merges MulAssign with src using mask, assigning src where mask is false.
Source§

fn mul_assign_z(&mut self, mask: Mask<R>, rhs: Self)

Computes MulAssign masked (zeroed where mask is false).
Source§

impl<R: NumericRegister + Register> MulMasked<Mask<R>> for Vector<R>

Source§

fn mul_c(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes Mul with rhs where mask is true.
Source§

fn mul_m(self, src: Self, mask: Mask<R>, rhs: Self) -> Self::Output

Merges Mul with src using mask, returning src where mask is false.
Source§

fn mul_z(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes Mul masked (zeroed where mask is false).
Source§

impl<R: SignedRegister> Neg for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<R: SignedRegister> NegMasked<Mask<R>> for Vector<R>

Source§

fn neg_c(self, mask: Mask<R>) -> Self::Output

Computes Neg where mask is true, does nothing where false.
Source§

fn neg_m(self, src: Self, mask: Mask<R>) -> Self::Output

Merges Neg with src using mask, returning src where mask is false.
Source§

fn neg_z(self, mask: Mask<R>) -> Self::Output

Computes Neg masked (zeroed where mask is false).
Source§

impl<R: Register> NewVector<<R as Register>::Element, <R as CoreRegister>::Lanes> for Vector<R>

Source§

type New<T: NewConst<R::Element, R::Lanes>> = NewVectorImpl

For a given array carrier T, the type exposing the constructed vector constant via VectorValue.
Source§

impl<R: BitwiseRegister + Register> Not for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<R: BitwiseRegister + Register> NotMasked<Mask<R>> for Vector<R>

Source§

fn not_c(self, mask: Mask<R>) -> Self::Output

Computes Not where mask is true, does nothing where false.
Source§

fn not_m(self, src: Self, mask: Mask<R>) -> Self::Output

Merges Not with src using mask, returning src where mask is false.
Source§

fn not_z(self, mask: Mask<R>) -> Self::Output

Computes Not masked (zeroed where mask is false).
Source§

impl<R: NumericRegister> NumericVector for Vector<R>

Source§

const ZERO: Self

A vector of the value “0” in the element type.
Source§

const ONE: Self

A vector of the value “1” in the element type.
Source§

const TWO: Self

A vector of the value “2” in the element type.
Source§

const MIN: Self

A vector of the minimum value the element type of this vector can represent.
Source§

const MAX: Self

A vector of the maximum value the element type of this vector can represent.
Source§

fn to_signed_integer(self) -> Self::Signed

Convert each lane to the companion signed integer type, with as semantics - round toward zero, saturating at the bounds, NaN to zero. Read more
Source§

fn from_signed_integer(v: Self::Signed) -> Self

Convert each lane from the companion signed integer type, with as semantics. Read more
Source§

fn to_unsigned_integer(self) -> Self::Unsigned

Convert each lane to the companion unsigned integer type, with as semantics. See to_signed_integer.
Source§

fn from_unsigned_integer(v: Self::Unsigned) -> Self

Convert each lane from the companion unsigned integer type, with as semantics. See from_signed_integer.
Source§

fn fast_to_signed_integer(self) -> Self::Signed

Like to_signed_integer, but may relax IEEE corner cases (out-of-range and NaN inputs) for speed. Defaults to the exact form.
Source§

fn fast_to_unsigned_integer(self) -> Self::Unsigned

Like to_unsigned_integer, but may relax IEEE corner cases. Defaults to the exact form.
Source§

fn is_zero(self) -> Self::Mask

For each element in the vector, return a mask indicating whether that element is zero.
Source§

fn is_all_zero(self) -> bool

Returns true if all elements in the vector are zero, false otherwise. Read more
Source§

fn min(self, other: Self) -> Self

Return the minimum of two vectors, element-wise.
Source§

fn max(self, other: Self) -> Self

Return the maximum of two vectors, element-wise.
Source§

fn sort_by<O: SortOrder>(self) -> Self

Sort the lanes of this vector in O order. Read more
Source§

fn bitonic_clean_by<O: SortOrder>(self) -> Self

Sort the lanes of a bitonic vector in O order - one that rises then falls, or a rotation of one. Read more
Source§

fn prefix_sum(self) -> Self

Inclusive forward prefix sum (“running total”): out[i] = self[0] + .. + self[i]. Read more
Source§

fn prefix_min(self) -> Self

Inclusive forward prefix minimum: out[i] = min(self[0], .., self[i]). Read more
Source§

fn prefix_max(self) -> Self

Inclusive forward prefix maximum: out[i] = max(self[0], .., self[i]). Read more
Source§

fn reverse_prefix_sum(self) -> Self

Inclusive reverse (suffix) sum: out[i] = self[i] + .. + self[LANES-1].
Source§

fn reverse_prefix_min(self) -> Self

Inclusive reverse (suffix) minimum: out[i] = min(self[i], .., self[LANES-1]). Read more
Source§

fn reverse_prefix_max(self) -> Self

Inclusive reverse (suffix) maximum: out[i] = max(self[i], .., self[LANES-1]). Read more
Source§

fn clamp(self, min: Self, max: Self) -> Self

Clamps the elements of the vector between the given minimum and maximum values.
Source§

fn min_element(self) -> Self::Element

Returns the minimum value in the vector. Read more
Source§

fn max_element(self) -> Self::Element

Returns the maximum value in the vector. Read more
Source§

fn min_max_element(self) -> (Self::Element, Self::Element)

Returns both the minimum and maximum values in the vector simultaneously. Read more
Source§

fn arg_minmax(self) -> (usize, usize)

Returns the indices of the minimum and maximum elements in the vector, respectively.
Source§

fn scale(self, factor: Self::Element) -> Self

Scales each element in the vector by the given factor. Read more
Source§

fn pairwise_sum(lo: Self, hi: Self) -> Self

Sums adjacent lane pairs from lo and hi, returning a vector of the same width. Read more
Source§

fn relaxed_pairwise_sum(lo: Self, hi: Self) -> Self

Like pairwise_sum, but may return a relaxed (implementation-defined) lane ordering for performance. Treat this as if randomly shuffling the result of pairwise_sum, with better performance than pairwise_sum. Read more
Source§

fn sum_elements(self) -> Self::Element

Returns the sum of all elements in the vector. Read more
Source§

fn prod_elements(self) -> Self::Element

Returns the product of all elements in the vector. Read more
Source§

fn offset() -> Self

Returns a vector whose every lane equals LANES, converted into the element type. Read more
Source§

fn indexed() -> Self

Returns a vector where each lane holds its own index, cast to the element type: [0, 1, 2, ..., LANES-1]. Read more
Source§

fn min_c(self, mask: Mask<R>, other: Self) -> Self

Return the minimum of two vectors, element-wise. Computes min when mask is true, returns self where false.
Source§

fn min_m(self, src: Self, mask: Mask<R>, other: Self) -> Self

Return the minimum of two vectors, element-wise. Merges min with src using mask.
Source§

fn min_z(self, mask: Mask<R>, other: Self) -> Self

Return the minimum of two vectors, element-wise. Computes min masked (zeroed where mask is false).
Source§

fn max_c(self, mask: Mask<R>, other: Self) -> Self

Return the maximum of two vectors, element-wise. Computes max when mask is true, returns self where false.
Source§

fn max_m(self, src: Self, mask: Mask<R>, other: Self) -> Self

Return the maximum of two vectors, element-wise. Merges max with src using mask.
Source§

fn max_z(self, mask: Mask<R>, other: Self) -> Self

Return the maximum of two vectors, element-wise. Computes max masked (zeroed where mask is false).
Source§

fn scale_c(self, mask: Mask<R>, factor: Self::Element) -> Self

Scales each element in the vector by the given factor. Read more
Source§

fn scale_m(self, src: Self, mask: Mask<R>, factor: Self::Element) -> Self

Scales each element in the vector by the given factor. Read more
Source§

fn scale_z(self, mask: Mask<R>, factor: Self::Element) -> Self

Scales each element in the vector by the given factor. Read more
Source§

fn sort(self) -> Self

Sort the lanes ascending. Shorthand for sort_by::<Ascending>.
Source§

fn bitonic_clean(self) -> Self

Sort the lanes of a bitonic vector ascending. Shorthand for bitonic_clean_by::<Ascending>.
Source§

impl<R: NumericRegister> One for Vector<R>

Source§

fn is_one(&self) -> bool

Returns true if all elements in the vector are one.

Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

impl<S, R, FR, B> PackedFloatVector<S, Vector<FR>> for Vector<R>
where S: FloatSpec, B: CastRegister<R>, FR: FloatRegister<Element = f32, Lanes = R::Lanes, Bits = B>, R: PackedFloatRegister<S, FR> + CastRegister<B>,

Source§

fn pack(values: Vector<FR>) -> Self

Encode the f32 vector values into this packed format (round to nearest, ties to even; overflow / non-finite handled per the format S).
Source§

fn unpack(self) -> Vector<FR>

Decode this packed-float vector into the f32 vector it represents (exact).
Source§

impl<R: PartialOrdRegister> PartialEq for Vector<R>

Source§

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

Compare two vectors for equality, returning true only if all elements are equal.

Source§

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

Compare two vectors for inequality, returning true if any element is not equal.

Source§

impl<R: PartialOrdRegister> PartialOrdVector for Vector<R>

Source§

fn cmp_lt(self, other: Self) -> Self::Mask

Lane-wise self < other.
Source§

fn cmp_le(self, other: Self) -> Self::Mask

Lane-wise self <= other.
Source§

fn cmp_gt(self, other: Self) -> Self::Mask

Lane-wise self > other.
Source§

fn cmp_ge(self, other: Self) -> Self::Mask

Lane-wise self >= other.
Source§

fn cmp_eq(self, other: Self) -> Self::Mask

Lane-wise self == other.
Source§

fn cmp_ne(self, other: Self) -> Self::Mask

Lane-wise self != other.
Source§

fn group_by_value(self, valid: Self::Mask) -> ValueGroups<Self>

Partition the lanes selected by valid into groups of equal value. Read more
Source§

impl<R: NumericRegister> Product for Vector<R>

Source§

fn product<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<R: NumericRegister + Register> Rem for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
Source§

impl<R: NumericRegister + Register> RemAssign for Vector<R>

Source§

fn rem_assign(&mut self, rhs: Self)

Performs the %= operation. Read more
Source§

impl<R: NumericRegister + Register> RemAssignMasked<Mask<R>> for Vector<R>

Source§

fn rem_assign_c(&mut self, mask: Mask<R>, rhs: Self)

Computes RemAssign with rhs where mask is true.
Source§

fn rem_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: Self)

Merges RemAssign with src using mask, assigning src where mask is false.
Source§

fn rem_assign_z(&mut self, mask: Mask<R>, rhs: Self)

Computes RemAssign masked (zeroed where mask is false).
Source§

impl<R: NumericRegister + Register> RemMasked<Mask<R>> for Vector<R>

Source§

fn rem_c(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes Rem with rhs where mask is true.
Source§

fn rem_m(self, src: Self, mask: Mask<R>, rhs: Self) -> Self::Output

Merges Rem with src using mask, returning src where mask is false.
Source§

fn rem_z(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes Rem masked (zeroed where mask is false).
Source§

impl<R, W> Sad16Vector<Vector<W>> for Vector<R>
where W: UnsignedIntegerRegister<Element = u16>, R: Sad16Register<W>,

Source§

fn sad16(self, other: Self) -> Vector<W>

Sum of absolute differences over each aligned pair of byte lanes.
Source§

impl<R, W> Sad32Vector<Vector<W>> for Vector<R>
where W: UnsignedIntegerRegister<Element = u32>, R: Sad32Register<W>,

Source§

fn sad32(self, other: Self) -> Vector<W>

Sum of absolute differences over each aligned group of 4 byte lanes.
Source§

fn sad32_accum(self, acc: Vector<W>, other: Self) -> Vector<W>

acc + self.sad32(other) - the accumulate step of a blocked SAD loop.
Source§

impl<R, W> Sad64Vector<Vector<W>> for Vector<R>
where W: UnsignedIntegerRegister<Element = u64>, R: Sad64Register<W>,

Source§

fn sad64(self, other: Self) -> Vector<W>

Sum of absolute differences over each aligned group of 8 byte lanes.
Source§

fn sad64_accum(self, acc: Vector<W>, other: Self) -> Vector<W>

acc + self.sad64(other) - the accumulate step of a blocked SAD loop.
Source§

impl<R: IntegerRegister> Saturating for Vector<R>

Source§

fn saturating_add(self, v: Self) -> Self

Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing.
Source§

fn saturating_sub(self, v: Self) -> Self

Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing.
Source§

impl<R: IntegerRegister> SaturatingAdd for Vector<R>

Source§

fn saturating_add(&self, v: &Self) -> Self

Saturating addition. Computes self + other, saturating at the relevant high or low boundary of the type.
Source§

impl<R: IntegerRegister> SaturatingSub for Vector<R>

Source§

fn saturating_sub(&self, v: &Self) -> Self

Saturating subtraction. Computes self - other, saturating at the relevant high or low boundary of the type.
Source§

impl<R: Register> Selectable<R> for Vector<R>

Source§

fn select<M: Register>(mask: Mask<M>, truthy: Self, falsy: Self) -> Self
where R::Mask: CastMaskRegister<M::Mask, Lanes = M::Lanes>,

For each lane in mask, if the lane is true, the corresponding lane in truthy is selected, otherwise the corresponding lane in falsy is selected.
Source§

impl<R: BitshiftRegister> Shl<Vector<<R as Register>::Unsigned>> for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Vector<R::Unsigned>) -> Self::Output

Performs the << operation. Read more
Source§

impl<R: BitshiftRegister> Shl<u32> for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: u32) -> Self::Output

Performs the << operation. Read more
Source§

impl<R: BitshiftRegister> ShlAssign<Vector<<R as Register>::Unsigned>> for Vector<R>

Source§

fn shl_assign(&mut self, rhs: Vector<R::Unsigned>)

Performs the <<= operation. Read more
Source§

impl<R: BitshiftRegister> ShlAssign<u32> for Vector<R>

Source§

fn shl_assign(&mut self, rhs: u32)

Performs the <<= operation. Read more
Source§

impl<R: BitshiftRegister> ShlAssignMasked<Mask<R>, Vector<<R as Register>::Unsigned>> for Vector<R>

Source§

fn shl_assign_c(&mut self, mask: Mask<R>, rhs: Vector<R::Unsigned>)

Computes ShlAssign with rhs where mask is true.
Source§

fn shl_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: Vector<R::Unsigned>)

Merges ShlAssign with src using mask, assigning src where mask is false.
Source§

fn shl_assign_z(&mut self, mask: Mask<R>, rhs: Vector<R::Unsigned>)

Computes ShlAssign masked (zeroed where mask is false).
Source§

impl<R: BitshiftRegister> ShlAssignMasked<Mask<R>, u32> for Vector<R>

Source§

fn shl_assign_c(&mut self, mask: Mask<R>, rhs: u32)

Computes ShlAssign with rhs where mask is true.
Source§

fn shl_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: u32)

Merges ShlAssign with src using mask, assigning src where mask is false.
Source§

fn shl_assign_z(&mut self, mask: Mask<R>, rhs: u32)

Computes ShlAssign masked (zeroed where mask is false).
Source§

impl<R: BitshiftRegister> ShlMasked<Mask<R>, Vector<<R as Register>::Unsigned>> for Vector<R>

Source§

fn shl_c(self, mask: Mask<R>, rhs: Vector<R::Unsigned>) -> Self::Output

Computes Shl with rhs where mask is true.
Source§

fn shl_m( self, src: Self, mask: Mask<R>, rhs: Vector<R::Unsigned>, ) -> Self::Output

Merges Shl with src using mask, returning src where mask is false.
Source§

fn shl_z(self, mask: Mask<R>, rhs: Vector<R::Unsigned>) -> Self::Output

Computes Shl masked (zeroed where mask is false).
Source§

impl<R: BitshiftRegister> ShlMasked<Mask<R>, u32> for Vector<R>

Source§

fn shl_c(self, mask: Mask<R>, rhs: u32) -> Self::Output

Computes Shl with rhs where mask is true.
Source§

fn shl_m(self, src: Self, mask: Mask<R>, rhs: u32) -> Self::Output

Merges Shl with src using mask, returning src where mask is false.
Source§

fn shl_z(self, mask: Mask<R>, rhs: u32) -> Self::Output

Computes Shl masked (zeroed where mask is false).
Source§

impl<R: BitshiftRegister> Shr<Vector<<R as Register>::Unsigned>> for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Vector<R::Unsigned>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<R: BitshiftRegister> Shr<u32> for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl<R: BitshiftRegister> ShrAssign<Vector<<R as Register>::Unsigned>> for Vector<R>

Source§

fn shr_assign(&mut self, rhs: Vector<R::Unsigned>)

Performs the >>= operation. Read more
Source§

impl<R: BitshiftRegister> ShrAssign<u32> for Vector<R>

Source§

fn shr_assign(&mut self, rhs: u32)

Performs the >>= operation. Read more
Source§

impl<R: BitshiftRegister> ShrAssignMasked<Mask<R>, Vector<<R as Register>::Unsigned>> for Vector<R>

Source§

fn shr_assign_c(&mut self, mask: Mask<R>, rhs: Vector<R::Unsigned>)

Computes ShrAssign with rhs where mask is true.
Source§

fn shr_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: Vector<R::Unsigned>)

Merges ShrAssign with src using mask, assigning src where mask is false.
Source§

fn shr_assign_z(&mut self, mask: Mask<R>, rhs: Vector<R::Unsigned>)

Computes ShrAssign masked (zeroed where mask is false).
Source§

impl<R: BitshiftRegister> ShrAssignMasked<Mask<R>, u32> for Vector<R>

Source§

fn shr_assign_c(&mut self, mask: Mask<R>, rhs: u32)

Computes ShrAssign with rhs where mask is true.
Source§

fn shr_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: u32)

Merges ShrAssign with src using mask, assigning src where mask is false.
Source§

fn shr_assign_z(&mut self, mask: Mask<R>, rhs: u32)

Computes ShrAssign masked (zeroed where mask is false).
Source§

impl<R: BitshiftRegister> ShrMasked<Mask<R>, Vector<<R as Register>::Unsigned>> for Vector<R>

Source§

fn shr_c(self, mask: Mask<R>, rhs: Vector<R::Unsigned>) -> Self::Output

Computes Shr with rhs where mask is true.
Source§

fn shr_m( self, src: Self, mask: Mask<R>, rhs: Vector<R::Unsigned>, ) -> Self::Output

Merges Shr with src using mask, returning src where mask is false.
Source§

fn shr_z(self, mask: Mask<R>, rhs: Vector<R::Unsigned>) -> Self::Output

Computes Shr masked (zeroed where mask is false).
Source§

impl<R: BitshiftRegister> ShrMasked<Mask<R>, u32> for Vector<R>

Source§

fn shr_c(self, mask: Mask<R>, rhs: u32) -> Self::Output

Computes Shr with rhs where mask is true.
Source§

fn shr_m(self, src: Self, mask: Mask<R>, rhs: u32) -> Self::Output

Merges Shr with src using mask, returning src where mask is false.
Source§

fn shr_z(self, mask: Mask<R>, rhs: u32) -> Self::Output

Computes Shr masked (zeroed where mask is false).
Source§

impl<R: SignedIntegerRegister> SignedIntegerVector for Vector<R>
where R::Element: Denominator,

Source§

fn srai<const I: i32>(self) -> Self

For each lane in the vector, right shift in sign bits by the immediate value.
Source§

fn sra(self, count: u32) -> Self

For each lane in the vector, right shift in sign bits by the given value.
Source§

fn srav(self, counts: Self::Unsigned) -> Self

For each lane in the vector, right shift in sign bits by the corresponding lane in the shifts vector.
Source§

fn avg_floor(self, other: Self) -> Self

Floor average: (a + b) >> 1 rounded toward -∞, computed without overflow.
Source§

fn avg_ceil(self, other: Self) -> Self

Ceiling average: (a + b + 1) >> 1 rounded toward +∞, computed without overflow.
Source§

fn mulhrs(self, other: Self) -> Self

Rounded high-half signed multiply: the fixed-point Q(W-1) product (self * other + 2^(W-2)) >> (W-1), where W is the element bit width. Read more
Source§

fn srai_c<const I: i32>(self, mask: Mask<R>) -> Self

For each lane in the vector, right shift in sign bits by the immediate value. Computes srai when mask is true, returns self where false.
Source§

fn srai_m<const I: i32>(self, src: Self, mask: Mask<R>) -> Self

For each lane in the vector, right shift in sign bits by the immediate value. Merges srai with src using mask.
Source§

fn srai_z<const I: i32>(self, mask: Mask<R>) -> Self

For each lane in the vector, right shift in sign bits by the immediate value. Computes srai masked (zeroed where mask is false).
Source§

fn sra_c(self, mask: Mask<R>, count: u32) -> Self

For each lane in the vector, right shift in sign bits by the given value. Computes sra when mask is true, returns self where false.
Source§

fn sra_m(self, src: Self, mask: Mask<R>, count: u32) -> Self

For each lane in the vector, right shift in sign bits by the given value. Merges sra with src using mask.
Source§

fn sra_z(self, mask: Mask<R>, count: u32) -> Self

For each lane in the vector, right shift in sign bits by the given value. Computes sra masked (zeroed where mask is false).
Source§

fn srav_c(self, mask: Mask<R>, counts: Self::Unsigned) -> Self

For each lane in the vector, right shift in sign bits by the corresponding lane in the shifts vector. Computes srav when mask is true, returns self where false.
Source§

fn srav_m(self, src: Self, mask: Mask<R>, counts: Self::Unsigned) -> Self

For each lane in the vector, right shift in sign bits by the corresponding lane in the shifts vector. Merges srav with src using mask.
Source§

fn srav_z(self, mask: Mask<R>, counts: Self::Unsigned) -> Self

For each lane in the vector, right shift in sign bits by the corresponding lane in the shifts vector. Computes srav masked (zeroed where mask is false).
Source§

fn avg_floor_c(self, mask: Mask<R>, other: Self) -> Self

Floor average: (a + b) >> 1 rounded toward -∞, computed without overflow. Computes avg_floor when mask is true, returns self where false.
Source§

fn avg_floor_m(self, src: Self, mask: Mask<R>, other: Self) -> Self

Floor average: (a + b) >> 1 rounded toward -∞, computed without overflow. Merges avg_floor with src using mask.
Source§

fn avg_floor_z(self, mask: Mask<R>, other: Self) -> Self

Floor average: (a + b) >> 1 rounded toward -∞, computed without overflow. Computes avg_floor masked (zeroed where mask is false).
Source§

fn avg_ceil_c(self, mask: Mask<R>, other: Self) -> Self

Ceiling average: (a + b + 1) >> 1 rounded toward +∞, computed without overflow. Computes avg_ceil when mask is true, returns self where false.
Source§

fn avg_ceil_m(self, src: Self, mask: Mask<R>, other: Self) -> Self

Ceiling average: (a + b + 1) >> 1 rounded toward +∞, computed without overflow. Merges avg_ceil with src using mask.
Source§

fn avg_ceil_z(self, mask: Mask<R>, other: Self) -> Self

Ceiling average: (a + b + 1) >> 1 rounded toward +∞, computed without overflow. Computes avg_ceil masked (zeroed where mask is false).
Source§

fn mulhrs_c(self, mask: Mask<R>, other: Self) -> Self

Rounded high-half signed multiply: the fixed-point Q(W-1) product (self * other + 2^(W-2)) >> (W-1), where W is the element bit width. Read more
Source§

fn mulhrs_m(self, src: Self, mask: Mask<R>, other: Self) -> Self

Rounded high-half signed multiply: the fixed-point Q(W-1) product (self * other + 2^(W-2)) >> (W-1), where W is the element bit width. Read more
Source§

fn mulhrs_z(self, mask: Mask<R>, other: Self) -> Self

Rounded high-half signed multiply: the fixed-point Q(W-1) product (self * other + 2^(W-2)) >> (W-1), where W is the element bit width. Read more
Source§

impl<R> SignedIntegerVectorWithRegister for Vector<R>

Source§

type Register = R

The backing hardware register this vector is a thin wrapper over.
Source§

impl<R: SignedRegister> SignedVector for Vector<R>

Source§

const NEG_ONE: Self

A vector of the value “-1” in the element type.
Source§

const MIN_POSITIVE: Self

A vector of the smallest positive (non-zero) value in the element type.
Source§

fn abs(self) -> Self

Take the absolute value of the vector, element-wise.
Source§

fn signum(self) -> Self

For each element in the vector, return a new vector where each element is either -1 or +1 depending on the sign of the element. Read more
Source§

fn copysign(self, sign: Self) -> Self

For each element in the vector, set the sign of that element to the sign of the corresponding element in the other vector.
Source§

fn is_positive(self) -> Self::Mask

For each element in the vector, return a mask indicating whether that element is negative.
Source§

fn is_negative(self) -> Self::Mask

For each element in the vector, return a mask indicating whether that element is positive.
Source§

fn select_negative(self, if_neg: Self, if_pos: Self) -> Self

Based on if self is negative, select between if_neg and if_pos.
Source§

fn abs_c(self, mask: Mask<R>) -> Self

Take the absolute value of the vector, element-wise. Computes abs when mask is true, returns self where false.
Source§

fn abs_m(self, src: Self, mask: Mask<R>) -> Self

Take the absolute value of the vector, element-wise. Merges abs with src using mask.
Source§

fn abs_z(self, mask: Mask<R>) -> Self

Take the absolute value of the vector, element-wise. Computes abs masked (zeroed where mask is false).
Source§

fn copysign_c(self, mask: Mask<R>, sign: Self) -> Self

For each element in the vector, set the sign of that element to the sign of the corresponding element in the other vector. Computes copysign when mask is true, returns self where false.
Source§

fn copysign_m(self, src: Self, mask: Mask<R>, sign: Self) -> Self

For each element in the vector, set the sign of that element to the sign of the corresponding element in the other vector. Merges copysign with src using mask.
Source§

fn copysign_z(self, mask: Mask<R>, sign: Self) -> Self

For each element in the vector, set the sign of that element to the sign of the corresponding element in the other vector. Computes copysign masked (zeroed where mask is false).
Source§

impl<R: Register> SplatVector<<R as Register>::Element> for Vector<R>

Source§

type Splat<T: SplatConst<R::Element>> = SplatVectorImpl

For a given constant carrier T, the type exposing the splatted vector constant via VectorValue.
Source§

impl<R: NumericRegister> Square for Vector<R>

Source§

type Output = Vector<R>

The squared value. Not always Self: a type may widen to hold the product.
Source§

fn square(self) -> Self

Computes self * self.
Source§

impl<R: NumericRegister> SquareMasked<Mask<R>> for Vector<R>

Source§

fn square_c(self, mask: Mask<R>) -> Self

Computes Square where mask is true, does nothing where false.
Source§

fn square_m(self, src: Self, mask: Mask<R>) -> Self

Merges Square with src using mask, returning src where mask is false.
Source§

fn square_z(self, mask: Mask<R>) -> Self

Computes Square masked (zeroed where mask is false).
Source§

impl<R: NumericRegister + Register> Sub for Vector<R>

Source§

type Output = Vector<R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<R: NumericRegister + Register> SubAssign for Vector<R>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<R: NumericRegister + Register> SubAssignMasked<Mask<R>> for Vector<R>

Source§

fn sub_assign_c(&mut self, mask: Mask<R>, rhs: Self)

Computes SubAssign with rhs where mask is true.
Source§

fn sub_assign_m(&mut self, src: Self, mask: Mask<R>, rhs: Self)

Merges SubAssign with src using mask, assigning src where mask is false.
Source§

fn sub_assign_z(&mut self, mask: Mask<R>, rhs: Self)

Computes SubAssign masked (zeroed where mask is false).
Source§

impl<R: NumericRegister + Register> SubMasked<Mask<R>> for Vector<R>

Source§

fn sub_c(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes Sub with rhs where mask is true.
Source§

fn sub_m(self, src: Self, mask: Mask<R>, rhs: Self) -> Self::Output

Merges Sub with src using mask, returning src where mask is false.
Source§

fn sub_z(self, mask: Mask<R>, rhs: Self) -> Self::Output

Computes Sub masked (zeroed where mask is false).
Source§

impl<R: NumericRegister> Sum for Vector<R>

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<R> Swizzle<<R as CoreRegister>::Lanes> for Vector<R>
where R: Register,

Source§

fn swizzle(self, other: Self, indices: GenericArray<u32, R::Lanes>) -> Self

Swizzle lanes from two vectors according to the given indices.
Source§

fn swizzle_const<I: SwizzleIndices<R::Lanes>>(self, other: Self) -> Self

Source§

fn permute(self, indices: GenericArray<u32, R::Lanes>) -> Self

Permute lanes from a single vector according to the given indices.
Source§

fn permute_const<I: SwizzleIndices<R::Lanes>>(self) -> Self

Source§

impl<R: UnsignedIntegerRegister> UnsignedIntegerVector for Vector<R>
where R::Element: Denominator,

Source§

fn is_power_of_two(self) -> Self::Mask

Determines if each unsigned integer element in the vector is a power of two, returning a mask indicating whether or not it is.
Source§

fn in_range(self, lo: Self, hi: Self) -> Self::Mask

Per-lane inclusive unsigned range test: a mask of lo <= self <= hi, assuming lo <= hi. Read more
Source§

fn next_power_of_two_m1(self) -> Self

Returns the next power of two minus one for each unsigned integer element in the vector.
Source§

fn ilog2p1(self) -> Self

Computes log2(x) + 1 for each unsigned integer element in the vector.
Source§

fn parity(self) -> Self

Compute the parity of each unsigned integer lane in the vector.
Source§

fn avg(self, other: Self) -> Self

Ceiling average: (a + b + 1) >> 1, computed without overflow. Read more
Source§

fn abs_diff(self, other: Self) -> Self

Per-lane unsigned absolute difference |self - other|, without overflow. Read more
Source§

fn morton<const N: usize>(values: [Self; N]) -> Self

Per-lane N-dimensional Morton code (Z-order curve index): interleave the low floor(W / N) bits of each of the N coordinate vectors into one, placing bit i of values[d] at output position i * N + d. N = 2 is the classic 2D code, N = 3 the 3D (voxel/octree) code. Read more
Source§

fn reverse_morton<const N: usize>(self) -> [Self; N]

Inverse of morton: de-interleave a Morton code back into its N coordinate vectors, where out[d] gathers output bits d, d + N, d + 2N, ... into the low floor(W / N) bits.
Source§

fn next_power_of_two_m1_c(self, mask: Mask<R>) -> Self

Returns the next power of two minus one for each unsigned integer element in the vector. Computes next_power_of_two_m1 when mask is true, returns self where false.
Source§

fn next_power_of_two_m1_m(self, src: Self, mask: Mask<R>) -> Self

Returns the next power of two minus one for each unsigned integer element in the vector. Merges next_power_of_two_m1 with src using mask.
Source§

fn next_power_of_two_m1_z(self, mask: Mask<R>) -> Self

Returns the next power of two minus one for each unsigned integer element in the vector. Computes next_power_of_two_m1 masked (zeroed where mask is false).
Source§

fn ilog2p1_c(self, mask: Mask<R>) -> Self

Computes log2(x) + 1 for each unsigned integer element in the vector. Computes ilog2p1 when mask is true, returns self where false.
Source§

fn ilog2p1_m(self, src: Self, mask: Mask<R>) -> Self

Computes log2(x) + 1 for each unsigned integer element in the vector. Merges ilog2p1 with src using mask.
Source§

fn ilog2p1_z(self, mask: Mask<R>) -> Self

Computes log2(x) + 1 for each unsigned integer element in the vector. Computes ilog2p1 masked (zeroed where mask is false).
Source§

fn parity_c(self, mask: Mask<R>) -> Self

Compute the parity of each unsigned integer lane in the vector. Computes parity when mask is true, returns self where false.
Source§

fn parity_m(self, src: Self, mask: Mask<R>) -> Self

Compute the parity of each unsigned integer lane in the vector. Merges parity with src using mask.
Source§

fn parity_z(self, mask: Mask<R>) -> Self

Compute the parity of each unsigned integer lane in the vector. Computes parity masked (zeroed where mask is false).
Source§

fn avg_c(self, mask: Mask<R>, other: Self) -> Self

Ceiling average: (a + b + 1) >> 1, computed without overflow. Read more
Source§

fn avg_m(self, src: Self, mask: Mask<R>, other: Self) -> Self

Ceiling average: (a + b + 1) >> 1, computed without overflow. Read more
Source§

fn avg_z(self, mask: Mask<R>, other: Self) -> Self

Ceiling average: (a + b + 1) >> 1, computed without overflow. Read more
Source§

fn abs_diff_c(self, mask: Mask<R>, other: Self) -> Self

Per-lane unsigned absolute difference |self - other|, without overflow. Read more
Source§

fn abs_diff_m(self, src: Self, mask: Mask<R>, other: Self) -> Self

Per-lane unsigned absolute difference |self - other|, without overflow. Read more
Source§

fn abs_diff_z(self, mask: Mask<R>, other: Self) -> Self

Per-lane unsigned absolute difference |self - other|, without overflow. Read more
Source§

impl<R> UnsignedIntegerVectorWithRegister for Vector<R>

Source§

type Register = R

The backing hardware register this vector is a thin wrapper over.
Source§

impl<R: Register> VectorWithRegister<R> for Vector<R>

Source§

fn into_register(self) -> Storage<R>

Consume the vector and yield its raw register storage.
Source§

fn from_register(reg: Storage<R>) -> Self

Wrap a raw register storage value back into a Vector.
Source§

fn as_slice(&self) -> &[R::Element]

Borrow the vector’s elements as a slice. Read more
Source§

fn as_mut_slice(&mut self) -> &mut [R::Element]

Mutably borrow the vector’s elements as a slice. Read more
Source§

impl<R: IntegerRegister> WrappingAdd for Vector<R>

Source§

fn wrapping_add(&self, v: &Self) -> Self

Wrapping (modular) addition. Computes self + other, wrapping around at the boundary of the type.
Source§

impl<R: IntegerRegister> WrappingMul for Vector<R>

Source§

fn wrapping_mul(&self, v: &Self) -> Self

Wrapping (modular) multiplication. Computes self * other, wrapping around at the boundary of the type.
Source§

impl<R: IntegerRegister> WrappingSub for Vector<R>

Source§

fn wrapping_sub(&self, v: &Self) -> Self

Wrapping (modular) subtraction. Computes self - other, wrapping around at the boundary of the type.
Source§

impl<R: NumericRegister> Zero for Vector<R>

Source§

fn is_zero(&self) -> bool

Returns true if all elements in the vector are zero.

Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more

Auto Trait Implementations§

§

impl<R> Freeze for Vector<R>
where <R as CoreRegister>::Mask: Sized, <R as CoreRegister>::Storage: Freeze,

§

impl<R> RefUnwindSafe for Vector<R>

§

impl<R> Send for Vector<R>
where <R as CoreRegister>::Mask: Sized, <R as CoreRegister>::Storage: Send,

§

impl<R> Sync for Vector<R>
where <R as CoreRegister>::Mask: Sized, <R as CoreRegister>::Storage: Sync,

§

impl<R> Unpin for Vector<R>
where <R as CoreRegister>::Mask: Sized, <R as CoreRegister>::Storage: Unpin,

§

impl<R> UnsafeUnpin for Vector<R>

§

impl<R> UnwindSafe for Vector<R>

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<V, Mask, Rhs> AssignMaskedBitshiftOps<Mask, Rhs> for V
where V: ShlAssignMasked<Mask, Rhs> + ShrAssignMasked<Mask, Rhs>,

Source§

impl<V, Mask, Rhs> AssignMaskedBitwiseOps<Mask, Rhs> for V
where V: BitAndAssignMasked<Mask, Rhs> + BitAndNotAssignMasked<Mask, Rhs> + BitOrAssignMasked<Mask, Rhs> + BitXorAssignMasked<Mask, Rhs>,

Source§

impl<V, Mask, Rhs> AssignMaskedNumOps<Mask, Rhs> for V
where V: AddAssignMasked<Mask, Rhs> + SubAssignMasked<Mask, Rhs> + MulAssignMasked<Mask, Rhs> + DivAssignMasked<Mask, Rhs> + RemAssignMasked<Mask, Rhs>,

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<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<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<M> CoreMath for M

Source§

fn poly<const N: usize>(self, coeffs: &[Self::Element; N]) -> Self

Computes the polynomial with the given coefficients at self. Read more
Source§

fn poly_rev<const N: usize>(self, coeffs: &[Self::Element; N]) -> Self

Computes the polynomial with the given coefficients at self, but with the coefficients in reverse order. Read more
Source§

fn poly_rational<const N: usize, const D: usize>( self, numerator: &[Self::Element; N], denominator: &[Self::Element; D], ) -> Self

Computes the ratio of two polynomials at self, given the numerator and denominator coefficients. Read more
Source§

fn reciprocal(self) -> Self

Returns the multiplicative inverse of self, which is 1 / self. Read more
Source§

fn approx_div(self, divisor: Self) -> Self

Returns the result of dividing self by divisor, i.e., self / divisor. Read more
Source§

fn inverse_sqrt(self) -> Self

Returns the inverse square root of self, which is 1 / sqrt(self). Read more
Source§

fn powi(self, e: i32) -> Self

Returns self raised to the signed integer power of e.
Source§

fn powiv(self, e: Self::Signed) -> Self

Returns self raised to the signed integer power of each element in e.
Source§

impl<E, V> CoreMathWithPolicy for V
where E: FloatElement, V: FloatVector<Element = E> + FloatVector + SpecializedCoreMath<E>,

Source§

fn poly_p<P, const N: usize>( self, coeffs: &[<V as GenericVector>::Element; N], ) -> V
where P: Policy,

Computes the polynomial with the given coefficients at self.

This will use fused multiply-add instructions where available for improved performance and accuracy, but falls back to standard operations if not.

Source§

fn poly_rev_p<P, const N: usize>( self, coeffs: &[<V as GenericVector>::Element; N], ) -> V
where P: Policy,

Computes the polynomial with the given coefficients at self, but with the coefficients in reverse order.

This will use fused multiply-add instructions where available for improved performance and accuracy, but falls back to standard operations if not.

Source§

fn poly_rational_p<P, const N: usize, const D: usize>( self, numerator: &[<V as GenericVector>::Element; N], denominator: &[<V as GenericVector>::Element; D], ) -> V
where P: Policy,

Computes the ratio of two polynomials at self, given the numerator and denominator coefficients.

Equivalent to poly(numerator) / poly(denominator), but with improved numerical stability in some cases.

This will use fused multiply-add instructions where available for improved performance and accuracy, but falls back to standard operations if not.

Source§

fn reciprocal_p<P>(self) -> V
where P: Policy,

Returns the multiplicative inverse of self, which is 1 / self.

If using the policy version, you may select lower precision policies for extra performance, at the cost of accuracy.

Source§

fn approx_div_p<P>(self, divisor: V) -> V
where P: Policy,

Returns the result of dividing self by divisor, i.e., self / divisor.

Depending on the precision policy and available features, this may be optimized to use approximate reciprocal and multiplication for better performance, at the cost of accuracy.

Source§

fn inverse_sqrt_p<P>(self) -> V
where P: Policy,

Returns the inverse square root of self, which is 1 / sqrt(self).

If using the policy version, you may select lower precision policies for extra performance, at the cost of accuracy.

Source§

fn powi_p<P>(self, e: i32) -> V
where P: Policy,

Returns self raised to the signed integer power of e.

Source§

fn powiv_p<P>(self, e: <V as GenericVector>::Signed) -> V
where P: Policy,

Returns self raised to the signed integer power of each element in e.

Source§

impl<M> FloatMath for M

Source§

fn ldexp(self, exp: Self::SignedBits) -> Self

Computes self * 2^exp efficiently. Read more
Source§

fn frexp(self) -> (Self, Self::SignedBits)

Decomposes self into its normalized fraction and an integral power of two. Read more
Source§

fn flush_denormals(self) -> Self

Removes denormal/subnormal values, flushing them to zero. Read more
Source§

impl<E, V> FloatMathWithPolicy for V

Source§

fn ldexp_p<P>(self, exp: <V as FloatVectorWithBits>::SignedBits) -> V
where P: Policy,

Computes self * 2^exp efficiently.

The default policy handles the full domain: overflow gives a signed infinity, underflow a signed zero (or a subnormal under a Preserve denormal policy), and infinities/NaNs pass through. That costs a handful of compares and selects around the exponent arithmetic.

A caller whose exponent is known to stay in range (anything fed by frexp, for instance) can drop all of it with ldexp_p::<CheckOverflow<P, false>>(exp), leaving an add, a shift and an or. Out-of-domain inputs are then garbage in, garbage out.

Source§

fn frexp_p<P>(self) -> (V, <V as FloatVectorWithBits>::SignedBits)
where P: Policy,

Decomposes self into its normalized fraction and an integral power of two.

self == frac * 2^exp with 0.5 <= |frac| < 1; +-0 gives (+-0, 0), and infinities and NaNs pass through unchanged.

Unless the DenormalBehavior is set to Ignore, denormal/subnormal values are properly handled regardless, not flushed. Mixed workloads of normal and denormal values will be slower than all-similar workloads due to branch prediction misprediction. This was the fastest approach overall.

Source§

fn flush_denormals_p<P>(self) -> V
where P: Policy,

Removes denormal/subnormal values, flushing them to zero.

If the precision policy is less than Best, this will NOT preserve -0.0. However, at higher precision policies the negative zero will be correctly preserved.

The crate feature preserve_denormals will disable this for default policies, which may be useful when targeting hardware or applications where the processor will handle denormals automatically.

See DenormalBehavior for more options for how to control this function, as it is used extensively internally.

Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<V> GenericVector2 for V
where V: GenericVector<Lanes = UInt<UInt<UTerm, B1>, B0>>,

Source§

fn x(&self) -> Self::Element

Returns the value of lane 0.
Source§

fn y(&self) -> Self::Element

Returns the value of lane 1.
Source§

impl<V> GenericVector3 for V
where V: GenericVector<Lanes = UInt<UInt<UTerm, B1>, B1>>,

Source§

fn x(&self) -> Self::Element

Returns the value of lane 0.
Source§

fn y(&self) -> Self::Element

Returns the value of lane 1.
Source§

fn z(&self) -> Self::Element

Returns the value of lane 2.
Source§

impl<V> GenericVector4 for V
where V: GenericVector<Lanes = UInt<UInt<UInt<UTerm, B1>, B0>, B0>>,

Source§

fn x(&self) -> Self::Element

Returns the value of lane 0.
Source§

fn y(&self) -> Self::Element

Returns the value of lane 1.
Source§

fn z(&self) -> Self::Element

Returns the value of lane 2.
Source§

fn w(&self) -> Self::Element

Returns the value of lane 3.
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> LowerBounded for T
where T: Bounded,

Source§

fn min_value() -> T

Returns the smallest finite number this type can represent
Source§

impl<V, Mask, Rhs> MaskedBitshiftOps<Mask, Rhs> for V
where V: ShlMasked<Mask, Rhs> + ShrMasked<Mask, Rhs>,

Source§

impl<V, Mask, Rhs> MaskedBitwiseOps<Mask, Rhs> for V
where V: BitAndMasked<Mask, Rhs> + BitAndNotMasked<Mask, Rhs> + BitOrMasked<Mask, Rhs> + BitXorMasked<Mask, Rhs>,

Source§

impl<V, Mask, Rhs> MaskedNumOps<Mask, Rhs> for V
where V: AddMasked<Mask, Rhs> + SubMasked<Mask, Rhs> + MulMasked<Mask, Rhs> + DivMasked<Mask, Rhs> + RemMasked<Mask, Rhs>,

Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

Source§

impl<V, F> PackedF8Vector<F> for V

Source§

impl<V, F> PackedF16Vector<F> for V

Source§

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

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<M> RealMath for M

Source§

fn tolerance() -> Self

Returns the precision tolerance based on the selected policy. This is a good default tolerance to use for numerical methods.
Source§

fn to_degrees(self) -> Self

Converts angles from radians to degrees.
Source§

fn to_radians(self) -> Self

Converts angles from degrees to radians.
Source§

fn wrap_angle(self) -> Self

Wraps the angle (radians) in self to the range [-π, π). Read more
Source§

fn angle_diff(self, other: Self) -> Self

Computes the smallest difference between two angles (in radians), taking into account angle wrapping. Read more
Source§

fn atan2(self, x: Self) -> Self

Returns the four-quadrant arctangent of self and x. Read more
Source§

fn lerp(self, a: Self, b: Self) -> Self

Linearly interpolates between a and b based on the value of self. Read more
Source§

fn rescale( self, in_min: Self, in_max: Self, out_min: Self, out_max: Self, ) -> Self

Scales self from the input range [in_min, in_max] to the output range [out_min, out_max]. Read more
Source§

fn logaddexp(self, other: Self) -> Self

Returns $\ln(e^{a} + e^{b})$ computed in a numerically stable way that avoids overflow, where a = self and b = other. Read more
Source§

fn smoothstep<const N: usize>(self, edges: Option<(Self, Self)>) -> Self

Generalized smoothstep function of Order 2N-1. Note: The “smoothness” for higher order is in terms of the number of continuous derivatives, not in terms of visual smoothness, though they are related in some ways. Read more
Source§

fn inverse_smoothstep<const N: usize>(self, edges: Option<(Self, Self)>) -> Self

Returns the inverse smoothstep of self, which is the value that would produce self when passed to smoothstep. Read more
Source§

fn smoothstep_derivative<const N: usize>( self, edges: Option<(Self, Self)>, ) -> Self

Derivative of the smoothstep function of order 2N-1, at the given point.
Source§

fn smooth_interpolator(self, edges: Option<(Self, Self)>, k: Self) -> Self

C∞-smooth interpolation factor between the given edges (defaulting to 0 and 1). Read more
Source§

fn smooth_interpolator_inverse( self, edges: Option<(Self, Self)>, k: Self, ) -> Self

Source§

fn step(self, edge: Self) -> Self

Returns 1 if self is greater than or equal to edge, otherwise returns 0.
Source§

impl<E, V> RealMathWithPolicy for V

Source§

fn tolerance_p<P>() -> V
where P: Policy,

Returns the precision tolerance based on the selected policy. This is a good default tolerance to use for numerical methods.

Source§

fn to_degrees_p<P>(self) -> V
where P: Policy,

Converts angles from radians to degrees.

Source§

fn to_radians_p<P>(self) -> V
where P: Policy,

Converts angles from degrees to radians.

Source§

fn wrap_angle_p<P>(self) -> V
where P: Policy,

Wraps the angle (radians) in self to the range [-π, π).

The formula for this is self - floor((self + π) / 2π) * 2π

Source§

fn angle_diff_p<P>(self, other: V) -> V
where P: Policy,

Computes the smallest difference between two angles (in radians), taking into account angle wrapping.

To get the “distance” between two angles, use the absolute value of the result.

Source§

fn atan2_p<P>(self, x: V) -> V
where P: Policy,

Returns the four-quadrant arctangent of self and x.

This method is only defined for real-valued types.

Source§

fn lerp_p<P>(self, a: V, b: V) -> V
where P: Policy,

Linearly interpolates between a and b based on the value of self.

This operation is not clamped.

Source§

fn rescale_p<P>(self, in_min: V, in_max: V, out_min: V, out_max: V) -> V
where P: Policy,

Scales self from the input range [in_min, in_max] to the output range [out_min, out_max].

This operation is not clamped.

Source§

fn logaddexp_p<P>(self, other: V) -> V
where P: Policy,

Returns $\ln(e^{a} + e^{b})$ computed in a numerically stable way that avoids overflow, where a = self and b = other.

Evaluated as $\max(a, b) + \ln(1 + e^{-|a - b|})$, so the result is accurate even when a and b are large. This is the workhorse of stable log-domain probability arithmetic (e.g. the two-argument log-sum-exp).

Source§

fn smoothstep_p<P, const N: usize>(self, edges: Option<(V, V)>) -> V
where P: Policy,

Generalized smoothstep function of Order 2N-1. Note: The “smoothness” for higher order is in terms of the number of continuous derivatives, not in terms of visual smoothness, though they are related in some ways.

For N=0, this is equivalent to the step function.
For N=1, this is a linear line between 0 and 1.
For N=2, this is equivalent to the standard 3rd-order smoothstep function.
For N=3, this is equivalent to the 5th-order “smootherstep” function.

For single precision, N can go up to 10, whereas for double precision, N can go up to 20.

See smooth_interpolator for a more advanced interpolator with infinite differentiability.

§Examples
use thermite::prelude::*;

type V = Vector<f64>;

// Standard 3rd-order smoothstep (N = 2) over the default [0, 1] edges:
// 3t^2 - 2t^3
let y = V::splat(0.25).smoothstep::<2>(None);
assert!((y.extract::<0>() - 0.15625).abs() < 1e-15);
Source§

fn inverse_smoothstep_p<P, const N: usize>(self, edges: Option<(V, V)>) -> V
where P: Policy,

Returns the inverse smoothstep of self, which is the value that would produce self when passed to smoothstep.

N from 0..=2 have fast closed-form solutions, while higher N use numerical root-finding methods, which will inherently be much slower.

§Examples

Round-trips smoothstep, even at high orders where the inverse must be found numerically:

use thermite::prelude::*;

type V = Vector<f64>;

let x = V::splat(1.0 / 16.0);
let y = x.smoothstep::<12>(None);
let x_back = y.inverse_smoothstep::<12>(None);
assert!((x_back.extract::<0>() - x.extract::<0>()).abs() < 1e-9);
Source§

fn smoothstep_derivative_p<P, const N: usize>(self, edges: Option<(V, V)>) -> V
where P: Policy,

Derivative of the smoothstep function of order 2N-1, at the given point.

Source§

fn smooth_interpolator_p<P>(self, edges: Option<(V, V)>, k: V) -> V
where P: Policy,

C∞-smooth interpolation factor between the given edges (defaulting to 0 and 1).

Constructs a smooth transition function using:

f(x) = e^(-1 / (k * x))
g(x) = f(x) / (f(x) + f(1 - x))

The result is C∞-differentiable (infinitely smooth), with all derivatives vanishing at both endpoints - making it strictly superior to polynomial smoothstep for applications requiring flatness at the edges.

The k parameter controls the shape of the transition:

  • k < 1: sharpens the curve, concentrating the transition near the midpoint.
  • k = 1: the standard balanced sigmoid-like transition.
  • k > 1: stretches the transition region, making the curve more gradual.
  • $k \approx 2/\sqrt{3}$ (~1.1547): the function becomes bimodal - use with caution above this value.
Source§

fn smooth_interpolator_inverse_p<P>(self, edges: Option<(V, V)>, k: V) -> V
where P: Policy,

Inverse of smooth_interpolator.

Given an output value y in [0, 1], recovers the input x such that smooth_interpolator(x, edges, k) ≈ y.

Source§

fn step_p<P>(self, edge: V) -> V
where P: Policy,

Returns 1 if self is greater than or equal to edge, otherwise returns 0.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<M> SpatialMath for M

Source§

fn hypot(self, other: Self) -> Self

Computes the Euclidean norm (hypotenuse) of self and other, i.e., sqrt(self^2 + other^2). Read more
Source§

fn hypot_n<const N: usize>(values: [Self; N]) -> Self

Computes the Euclidean norm (hypotenuse) of N values, i.e., $\sqrt{x_1^2 + x_2^2 + \dots + x_N^2}$. Read more
Source§

fn inv_hypot_n<const N: usize>(values: [Self; N]) -> Self

Computes the inverse Euclidean norm (inverse hypotenuse) of N values, i.e., $1/\sqrt{x_1^2 + x_2^2 + \dots + x_N^2}$. Read more
Source§

fn l1_norm(self) -> Self

L1 Norm, or the “Manhattan” distance from the origin. Read more
Source§

fn l2_norm(self) -> Self

L2 Norm, or the “Euclidean” distance from the origin. Read more
Source§

fn l2_norm_squared(self) -> Self

Squared L2 Norm, or the squared “Euclidean” distance from the origin. Read more
Source§

impl<E, V> SpatialMathWithPolicy for V

Source§

fn hypot_p<P>(self, other: V) -> V
where P: Policy,

Computes the Euclidean norm (hypotenuse) of self and other, i.e., sqrt(self^2 + other^2).

This is not higher performance than the naive implementation, but is more resistant to overflow and underflow. If using the worst precision policy, it becomes equivalent to the naive implementation.

Check out hypot_n for a more general version that computes the hypotenuse of N values.

Source§

fn hypot_n_p<P, const N: usize>(values: [V; N]) -> V
where P: Policy,

Computes the Euclidean norm (hypotenuse) of N values, i.e., $\sqrt{x_1^2 + x_2^2 + \dots + x_N^2}$.

This is typically higher performance than naively computing the sum of squares and then taking the square root, especially for larger N, and is more resistant to overflow and underflow when using average or higher precision policies.

Source§

fn inv_hypot_n_p<P, const N: usize>(values: [V; N]) -> V
where P: Policy,

Computes the inverse Euclidean norm (inverse hypotenuse) of N values, i.e., $1/\sqrt{x_1^2 + x_2^2 + \dots + x_N^2}$.

This is typically higher performance than naively computing the sum of squares, taking the square root, and then inverting, especially for larger N, and is more resistant to overflow and underflow when using average or higher precision policies.

At lower precision policies, we can take advantage of fast approximate inverse square root implementations for better performance.

Source§

fn l1_norm_p<P>(self) -> V
where P: Policy,

L1 Norm, or the “Manhattan” distance from the origin.

For 1D vectors, this is equivalent to the absolute value.

Source§

fn l2_norm_p<P>(self) -> V
where P: Policy,

L2 Norm, or the “Euclidean” distance from the origin.

For 1D vectors, this is equivalent to the absolute value.

Source§

fn l2_norm_squared_p<P>(self) -> V
where P: Policy,

Squared L2 Norm, or the squared “Euclidean” distance from the origin.

For 1D vectors, this is equivalent to squaring the value.

Source§

impl<V> SpecializedCoreMath<f32> for V
where V: FloatVectorWithBits<Element = f32>,

Source§

fn inverse_sqrt<P>(self) -> V
where P: Policy,

Source§

fn poly<P: Policy, const N: usize>(self, coeffs: &[E; N]) -> Self

Source§

fn poly_rev<P: Policy, const N: usize>(self, coeffs: &[E; N]) -> Self

Source§

fn poly_rational<P: Policy, const N: usize, const D: usize>( self, numerator: &[E; N], denominator: &[E; D], ) -> Self

Source§

fn reciprocal<P: Policy>(self) -> Self

Source§

fn approx_div<P: Policy>(self, rhs: Self) -> Self

Source§

fn reciprocal_adde<P: Policy>(self, a: Self) -> Self

Source§

fn powi<P: Policy>(self, e: i32) -> Self

Source§

fn powic<P: Policy, const N: i32>(self) -> Self

Source§

fn powiv<P: Policy>(self, e: Self::Signed) -> Self

Source§

impl<V> SpecializedCoreMath<f64> for V
where V: FloatVectorWithBits<Element = f64>,

Source§

fn inverse_sqrt<P>(self) -> V
where P: Policy,

Source§

fn poly<P: Policy, const N: usize>(self, coeffs: &[E; N]) -> Self

Source§

fn poly_rev<P: Policy, const N: usize>(self, coeffs: &[E; N]) -> Self

Source§

fn poly_rational<P: Policy, const N: usize, const D: usize>( self, numerator: &[E; N], denominator: &[E; D], ) -> Self

Source§

fn reciprocal<P: Policy>(self) -> Self

Source§

fn approx_div<P: Policy>(self, rhs: Self) -> Self

Source§

fn reciprocal_adde<P: Policy>(self, a: Self) -> Self

Source§

fn powi<P: Policy>(self, e: i32) -> Self

Source§

fn powic<P: Policy, const N: i32>(self) -> Self

Source§

fn powiv<P: Policy>(self, e: Self::Signed) -> Self

Source§

impl<E, V> SpecializedFloatMath<E> for V
where E: FloatElement, V: FloatVectorWithBits<Element = E>,

Source§

fn ldexp<P: Policy>(self, exp: Self::SignedBits) -> Self

Source§

fn frexp<P: Policy>(self) -> (Self, Self::SignedBits)

Source§

fn flush_denormals<P: Policy>(self) -> Self

Source§

impl<V> SpecializedRealMath<f32> for V
where V: FloatVectorWithBits<Element = f32>,

Source§

fn wrap_angle<P>(self) -> V
where P: Policy,

Source§

fn atan2<P>(self, x: V) -> V
where P: Policy,

Source§

fn tolerance<P: Policy>() -> Self

Source§

fn to_degrees<P: Policy>(self) -> Self

Source§

fn to_radians<P: Policy>(self) -> Self

Source§

fn angle_diff<P: Policy>(self, other: Self) -> Self

Source§

fn step<P: Policy>(self, t: Self) -> Self

Source§

fn lerp<P: Policy>(self, a: Self, b: Self) -> Self

Source§

fn rescale<P: Policy>( self, in_min: Self, in_max: Self, out_min: Self, out_max: Self, ) -> Self

Source§

fn logaddexp<P: Policy>(self, other: Self) -> Self

Source§

fn smoothstep<P: Policy, const N: usize>( self, edges: Option<(Self, Self)>, ) -> Self

Source§

fn smoothstep_derivative<P: Policy, const N: usize>( self, edges: Option<(Self, Self)>, ) -> Self

Source§

fn inverse_smoothstep<P: Policy, const N: usize>( y: Self, edges: Option<(Self, Self)>, ) -> Self

Source§

fn smooth_interpolator<P: Policy>( x: Self, edges: Option<(Self, Self)>, k: Self, ) -> Self

Source§

fn smooth_interpolator_inverse<P: Policy>( y: Self, edges: Option<(Self, Self)>, k: Self, ) -> Self

Source§

impl<V> SpecializedRealMath<f64> for V
where V: FloatVectorWithBits<Element = f64>,

Source§

fn atan2<P>(self, x: V) -> V
where P: Policy,

Source§

fn wrap_angle<P>(self) -> V
where P: Policy,

Source§

fn tolerance<P: Policy>() -> Self

Source§

fn to_degrees<P: Policy>(self) -> Self

Source§

fn to_radians<P: Policy>(self) -> Self

Source§

fn angle_diff<P: Policy>(self, other: Self) -> Self

Source§

fn step<P: Policy>(self, t: Self) -> Self

Source§

fn lerp<P: Policy>(self, a: Self, b: Self) -> Self

Source§

fn rescale<P: Policy>( self, in_min: Self, in_max: Self, out_min: Self, out_max: Self, ) -> Self

Source§

fn logaddexp<P: Policy>(self, other: Self) -> Self

Source§

fn smoothstep<P: Policy, const N: usize>( self, edges: Option<(Self, Self)>, ) -> Self

Source§

fn smoothstep_derivative<P: Policy, const N: usize>( self, edges: Option<(Self, Self)>, ) -> Self

Source§

fn inverse_smoothstep<P: Policy, const N: usize>( y: Self, edges: Option<(Self, Self)>, ) -> Self

Source§

fn smooth_interpolator<P: Policy>( x: Self, edges: Option<(Self, Self)>, k: Self, ) -> Self

Source§

fn smooth_interpolator_inverse<P: Policy>( y: Self, edges: Option<(Self, Self)>, k: Self, ) -> Self

Source§

impl<V> SpecializedSpatialMath<f32> for V
where V: FloatVectorWithBits<Element = f32>,

Source§

fn l2_norm_squared<P>(self) -> V
where P: Policy,

Source§

fn l2_norm<P>(self) -> V
where P: Policy,

Source§

fn l1_norm<P>(self) -> V
where P: Policy,

Source§

fn hypot<P: Policy>(self, y: Self) -> Self

Source§

fn hypot_n<P: Policy, const N: usize>(values: [Self; N]) -> Self

Source§

fn inv_hypot_n<P: Policy, const N: usize>(values: [Self; N]) -> Self

Source§

impl<V> SpecializedSpatialMath<f64> for V
where V: FloatVectorWithBits<Element = f64>,

Source§

fn l2_norm_squared<P>(self) -> V
where P: Policy,

Source§

fn l2_norm<P>(self) -> V
where P: Policy,

Source§

fn l1_norm<P>(self) -> V
where P: Policy,

Source§

fn hypot<P: Policy>(self, y: Self) -> Self

Source§

fn hypot_n<P: Policy, const N: usize>(values: [Self; N]) -> Self

Source§

fn inv_hypot_n<P: Policy, const N: usize>(values: [Self; N]) -> Self

Source§

impl<V> SpecializedTranscendentalMath<f32> for V
where V: FloatVectorWithBits<Element = f32>,

Source§

fn sinc<P>(self) -> V
where P: Policy,

Source§

fn sinc_pi<P>(self) -> V
where P: Policy,

Source§

fn log_n<P, const N: usize>(self) -> V
where P: Policy,

Source§

fn sin_cos<P>(self) -> (V, V)
where P: Policy,

Source§

fn sin<P>(self) -> V
where P: Policy,

Source§

fn cos<P>(self) -> V
where P: Policy,

Source§

fn tan<P>(self) -> V
where P: Policy,

Source§

fn sincos_pi<P>(self) -> (V, V)
where P: Policy,

Source§

fn sin_pi<P>(self) -> V
where P: Policy,

Source§

fn cos_pi<P>(self) -> V
where P: Policy,

Source§

fn tan_pi<P>(self) -> V
where P: Policy,

Source§

fn sinh_cosh<P>(self) -> (V, V)
where P: Policy,

Source§

fn sinh<P>(self) -> V
where P: Policy,

Source§

fn cosh<P>(self) -> V
where P: Policy,

Source§

fn tanh<P>(self) -> V
where P: Policy,

Source§

fn asin<P>(self) -> V
where P: Policy,

Source§

fn acos<P>(self) -> V
where P: Policy,

Source§

fn atan<P>(self) -> V
where P: Policy,

Source§

fn asinh<P>(self) -> V
where P: Policy,

Source§

fn acosh<P>(self) -> V
where P: Policy,

Source§

fn atanh<P>(self) -> V
where P: Policy,

Source§

fn exp<P>(self) -> V
where P: Policy,

Source§

fn exph<P>(self) -> V
where P: Policy,

Source§

fn exp2<P>(self) -> V
where P: Policy,

Source§

fn exp10<P>(self) -> V
where P: Policy,

Source§

fn exp_m1<P>(self) -> V
where P: Policy,

Source§

fn exp2_m1<P>(self) -> V
where P: Policy,

Source§

fn exp10_m1<P>(self) -> V
where P: Policy,

Source§

fn powf<P>(self, y: V) -> V
where P: Policy,

Source§

fn cbrt<P>(self) -> V
where P: Policy,

Source§

fn ln<P>(self) -> V
where P: Policy,

Source§

fn ln_1p<P>(self) -> V
where P: Policy,

Source§

fn log2<P>(self) -> V
where P: Policy,

Source§

fn log10<P>(self) -> V
where P: Policy,

Source§

fn ln1m_expnx<P>(self) -> V
where P: Policy,

ln(1 - e^(-x))
Source§

fn ln1m_expnx_ext<P>(self, lnx: V) -> V
where P: Policy,

Source§

fn sqrt1pm1<P: Policy>(self) -> Self

Source§

fn compound<P: Policy>(self, n: Self) -> Self

Source§

fn powf_m1<P: Policy>(self, e: Self) -> Self

Source§

fn haversin<P: Policy>(self) -> Self

Source§

fn versin<P: Policy>(self) -> Self

Source§

fn cos_m1<P: Policy>(self) -> Self

Source§

fn nth_root<P: Policy, const N: usize>(self) -> Self

Source§

fn log2_p1<P: Policy>(self) -> Self

Source§

fn log10_p1<P: Policy>(self) -> Self

Source§

fn log<P: Policy>(self, base: Self) -> Self

Source§

impl<V> SpecializedTranscendentalMath<f64> for V
where V: FloatVectorWithBits<Element = f64>,

Source§

fn sinc<P>(self) -> V
where P: Policy,

Source§

fn sinc_pi<P>(self) -> V
where P: Policy,

Source§

fn log_n<P, const N: usize>(self) -> V
where P: Policy,

Source§

fn sin_cos<P>(self) -> (V, V)
where P: Policy,

Source§

fn sincos_pi<P>(self) -> (V, V)
where P: Policy,

Source§

fn sinh_cosh<P>(self) -> (V, V)
where P: Policy,

Source§

fn sinh<P>(self) -> V
where P: Policy,

Source§

fn cosh<P>(self) -> V
where P: Policy,

Source§

fn tanh<P>(self) -> V
where P: Policy,

Source§

fn asin<P>(self) -> V
where P: Policy,

Source§

fn acos<P>(self) -> V
where P: Policy,

Source§

fn atan<P>(self) -> V
where P: Policy,

Source§

fn asinh<P>(self) -> V
where P: Policy,

Source§

fn acosh<P>(self) -> V
where P: Policy,

Source§

fn atanh<P>(self) -> V
where P: Policy,

Source§

fn exp<P>(self) -> V
where P: Policy,

Source§

fn exph<P>(self) -> V
where P: Policy,

Source§

fn exp2<P>(self) -> V
where P: Policy,

Source§

fn exp10<P>(self) -> V
where P: Policy,

Source§

fn exp_m1<P>(self) -> V
where P: Policy,

Source§

fn exp2_m1<P>(self) -> V
where P: Policy,

Source§

fn exp10_m1<P>(self) -> V
where P: Policy,

Source§

fn powf<P>(self, y: V) -> V
where P: Policy,

Source§

fn cbrt<P>(self) -> V
where P: Policy,

Source§

fn ln<P>(self) -> V
where P: Policy,

Source§

fn ln_1p<P>(self) -> V
where P: Policy,

Source§

fn log2<P>(self) -> V
where P: Policy,

Source§

fn log10<P>(self) -> V
where P: Policy,

Source§

fn ln1m_expnx<P>(self) -> V
where P: Policy,

ln(1 - e^(-x))
Source§

fn ln1m_expnx_ext<P>(self, _lnx: V) -> V
where P: Policy,

Source§

fn sin<P: Policy>(self) -> Self

Source§

fn cos<P: Policy>(self) -> Self

Source§

fn tan<P: Policy>(self) -> Self

Source§

fn sin_pi<P: Policy>(self) -> Self

Source§

fn cos_pi<P: Policy>(self) -> Self

Source§

fn tan_pi<P: Policy>(self) -> Self

Source§

fn sqrt1pm1<P: Policy>(self) -> Self

Source§

fn compound<P: Policy>(self, n: Self) -> Self

Source§

fn powf_m1<P: Policy>(self, e: Self) -> Self

Source§

fn haversin<P: Policy>(self) -> Self

Source§

fn versin<P: Policy>(self) -> Self

Source§

fn cos_m1<P: Policy>(self) -> Self

Source§

fn nth_root<P: Policy, const N: usize>(self) -> Self

Source§

fn log2_p1<P: Policy>(self) -> Self

Source§

fn log10_p1<P: Policy>(self) -> Self

Source§

fn log<P: Policy>(self, base: Self) -> Self

Source§

impl<V> Swizzle3 for V
where V: SwizzleVector<Lanes = UInt<UInt<UTerm, B1>, B1>>,

Source§

fn xyz(self) -> V

Source§

fn xxx(self) -> V

Source§

fn xxy(self) -> V

Source§

fn xxz(self) -> V

Source§

fn xyx(self) -> V

Source§

fn xyy(self) -> V

Source§

fn xzx(self) -> V

Source§

fn xzy(self) -> V

Source§

fn xzz(self) -> V

Source§

fn yxx(self) -> V

Source§

fn yxy(self) -> V

Source§

fn yxz(self) -> V

Source§

fn yyx(self) -> V

Source§

fn yyy(self) -> V

Source§

fn yyz(self) -> V

Source§

fn yzx(self) -> V

Source§

fn yzy(self) -> V

Source§

fn yzz(self) -> V

Source§

fn zxx(self) -> V

Source§

fn zxy(self) -> V

Source§

fn zxz(self) -> V

Source§

fn zyx(self) -> V

Source§

fn zyy(self) -> V

Source§

fn zyz(self) -> V

Source§

fn zzx(self) -> V

Source§

fn zzy(self) -> V

Source§

fn zzz(self) -> V

Source§

impl<V> Swizzle4 for V
where V: SwizzleVector<Lanes = UInt<UInt<UInt<UTerm, B1>, B0>, B0>>,

Source§

fn xyzw(self) -> V

Source§

fn xxxx(self) -> V

Source§

fn xxxy(self) -> V

Source§

fn xxxz(self) -> V

Source§

fn xxxw(self) -> V

Source§

fn xxyx(self) -> V

Source§

fn xxyy(self) -> V

Source§

fn xxyz(self) -> V

Source§

fn xxyw(self) -> V

Source§

fn xxzx(self) -> V

Source§

fn xxzy(self) -> V

Source§

fn xxzz(self) -> V

Source§

fn xxzw(self) -> V

Source§

fn xxwx(self) -> V

Source§

fn xxwy(self) -> V

Source§

fn xxwz(self) -> V

Source§

fn xxww(self) -> V

Source§

fn xyxx(self) -> V

Source§

fn xyxy(self) -> V

Source§

fn xyxz(self) -> V

Source§

fn xyxw(self) -> V

Source§

fn xyyx(self) -> V

Source§

fn xyyy(self) -> V

Source§

fn xyyz(self) -> V

Source§

fn xyyw(self) -> V

Source§

fn xyzx(self) -> V

Source§

fn xyzy(self) -> V

Source§

fn xyzz(self) -> V

Source§

fn xywx(self) -> V

Source§

fn xywy(self) -> V

Source§

fn xywz(self) -> V

Source§

fn xyww(self) -> V

Source§

fn xzxx(self) -> V

Source§

fn xzxy(self) -> V

Source§

fn xzxz(self) -> V

Source§

fn xzxw(self) -> V

Source§

fn xzyx(self) -> V

Source§

fn xzyy(self) -> V

Source§

fn xzyz(self) -> V

Source§

fn xzyw(self) -> V

Source§

fn xzzx(self) -> V

Source§

fn xzzy(self) -> V

Source§

fn xzzz(self) -> V

Source§

fn xzzw(self) -> V

Source§

fn xzwx(self) -> V

Source§

fn xzwy(self) -> V

Source§

fn xzwz(self) -> V

Source§

fn xzww(self) -> V

Source§

fn xwxx(self) -> V

Source§

fn xwxy(self) -> V

Source§

fn xwxz(self) -> V

Source§

fn xwxw(self) -> V

Source§

fn xwyx(self) -> V

Source§

fn xwyy(self) -> V

Source§

fn xwyz(self) -> V

Source§

fn xwyw(self) -> V

Source§

fn xwzx(self) -> V

Source§

fn xwzy(self) -> V

Source§

fn xwzz(self) -> V

Source§

fn xwzw(self) -> V

Source§

fn xwwx(self) -> V

Source§

fn xwwy(self) -> V

Source§

fn xwwz(self) -> V

Source§

fn xwww(self) -> V

Source§

fn yxxx(self) -> V

Source§

fn yxxy(self) -> V

Source§

fn yxxz(self) -> V

Source§

fn yxxw(self) -> V

Source§

fn yxyx(self) -> V

Source§

fn yxyy(self) -> V

Source§

fn yxyz(self) -> V

Source§

fn yxyw(self) -> V

Source§

fn yxzx(self) -> V

Source§

fn yxzy(self) -> V

Source§

fn yxzz(self) -> V

Source§

fn yxzw(self) -> V

Source§

fn yxwx(self) -> V

Source§

fn yxwy(self) -> V

Source§

fn yxwz(self) -> V

Source§

fn yxww(self) -> V

Source§

fn yyxx(self) -> V

Source§

fn yyxy(self) -> V

Source§

fn yyxz(self) -> V

Source§

fn yyxw(self) -> V

Source§

fn yyyx(self) -> V

Source§

fn yyyy(self) -> V

Source§

fn yyyz(self) -> V

Source§

fn yyyw(self) -> V

Source§

fn yyzx(self) -> V

Source§

fn yyzy(self) -> V

Source§

fn yyzz(self) -> V

Source§

fn yyzw(self) -> V

Source§

fn yywx(self) -> V

Source§

fn yywy(self) -> V

Source§

fn yywz(self) -> V

Source§

fn yyww(self) -> V

Source§

fn yzxx(self) -> V

Source§

fn yzxy(self) -> V

Source§

fn yzxz(self) -> V

Source§

fn yzxw(self) -> V

Source§

fn yzyx(self) -> V

Source§

fn yzyy(self) -> V

Source§

fn yzyz(self) -> V

Source§

fn yzyw(self) -> V

Source§

fn yzzx(self) -> V

Source§

fn yzzy(self) -> V

Source§

fn yzzz(self) -> V

Source§

fn yzzw(self) -> V

Source§

fn yzwx(self) -> V

Source§

fn yzwy(self) -> V

Source§

fn yzwz(self) -> V

Source§

fn yzww(self) -> V

Source§

fn ywxx(self) -> V

Source§

fn ywxy(self) -> V

Source§

fn ywxz(self) -> V

Source§

fn ywxw(self) -> V

Source§

fn ywyx(self) -> V

Source§

fn ywyy(self) -> V

Source§

fn ywyz(self) -> V

Source§

fn ywyw(self) -> V

Source§

fn ywzx(self) -> V

Source§

fn ywzy(self) -> V

Source§

fn ywzz(self) -> V

Source§

fn ywzw(self) -> V

Source§

fn ywwx(self) -> V

Source§

fn ywwy(self) -> V

Source§

fn ywwz(self) -> V

Source§

fn ywww(self) -> V

Source§

fn zxxx(self) -> V

Source§

fn zxxy(self) -> V

Source§

fn zxxz(self) -> V

Source§

fn zxxw(self) -> V

Source§

fn zxyx(self) -> V

Source§

fn zxyy(self) -> V

Source§

fn zxyz(self) -> V

Source§

fn zxyw(self) -> V

Source§

fn zxzx(self) -> V

Source§

fn zxzy(self) -> V

Source§

fn zxzz(self) -> V

Source§

fn zxzw(self) -> V

Source§

fn zxwx(self) -> V

Source§

fn zxwy(self) -> V

Source§

fn zxwz(self) -> V

Source§

fn zxww(self) -> V

Source§

fn zyxx(self) -> V

Source§

fn zyxy(self) -> V

Source§

fn zyxz(self) -> V

Source§

fn zyxw(self) -> V

Source§

fn zyyx(self) -> V

Source§

fn zyyy(self) -> V

Source§

fn zyyz(self) -> V

Source§

fn zyyw(self) -> V

Source§

fn zyzx(self) -> V

Source§

fn zyzy(self) -> V

Source§

fn zyzz(self) -> V

Source§

fn zyzw(self) -> V

Source§

fn zywx(self) -> V

Source§

fn zywy(self) -> V

Source§

fn zywz(self) -> V

Source§

fn zyww(self) -> V

Source§

fn zzxx(self) -> V

Source§

fn zzxy(self) -> V

Source§

fn zzxz(self) -> V

Source§

fn zzxw(self) -> V

Source§

fn zzyx(self) -> V

Source§

fn zzyy(self) -> V

Source§

fn zzyz(self) -> V

Source§

fn zzyw(self) -> V

Source§

fn zzzx(self) -> V

Source§

fn zzzy(self) -> V

Source§

fn zzzz(self) -> V

Source§

fn zzzw(self) -> V

Source§

fn zzwx(self) -> V

Source§

fn zzwy(self) -> V

Source§

fn zzwz(self) -> V

Source§

fn zzww(self) -> V

Source§

fn zwxx(self) -> V

Source§

fn zwxy(self) -> V

Source§

fn zwxz(self) -> V

Source§

fn zwxw(self) -> V

Source§

fn zwyx(self) -> V

Source§

fn zwyy(self) -> V

Source§

fn zwyz(self) -> V

Source§

fn zwyw(self) -> V

Source§

fn zwzx(self) -> V

Source§

fn zwzy(self) -> V

Source§

fn zwzz(self) -> V

Source§

fn zwzw(self) -> V

Source§

fn zwwx(self) -> V

Source§

fn zwwy(self) -> V

Source§

fn zwwz(self) -> V

Source§

fn zwww(self) -> V

Source§

fn wxxx(self) -> V

Source§

fn wxxy(self) -> V

Source§

fn wxxz(self) -> V

Source§

fn wxxw(self) -> V

Source§

fn wxyx(self) -> V

Source§

fn wxyy(self) -> V

Source§

fn wxyz(self) -> V

Source§

fn wxyw(self) -> V

Source§

fn wxzx(self) -> V

Source§

fn wxzy(self) -> V

Source§

fn wxzz(self) -> V

Source§

fn wxzw(self) -> V

Source§

fn wxwx(self) -> V

Source§

fn wxwy(self) -> V

Source§

fn wxwz(self) -> V

Source§

fn wxww(self) -> V

Source§

fn wyxx(self) -> V

Source§

fn wyxy(self) -> V

Source§

fn wyxz(self) -> V

Source§

fn wyxw(self) -> V

Source§

fn wyyx(self) -> V

Source§

fn wyyy(self) -> V

Source§

fn wyyz(self) -> V

Source§

fn wyyw(self) -> V

Source§

fn wyzx(self) -> V

Source§

fn wyzy(self) -> V

Source§

fn wyzz(self) -> V

Source§

fn wyzw(self) -> V

Source§

fn wywx(self) -> V

Source§

fn wywy(self) -> V

Source§

fn wywz(self) -> V

Source§

fn wyww(self) -> V

Source§

fn wzxx(self) -> V

Source§

fn wzxy(self) -> V

Source§

fn wzxz(self) -> V

Source§

fn wzxw(self) -> V

Source§

fn wzyx(self) -> V

Source§

fn wzyy(self) -> V

Source§

fn wzyz(self) -> V

Source§

fn wzyw(self) -> V

Source§

fn wzzx(self) -> V

Source§

fn wzzy(self) -> V

Source§

fn wzzz(self) -> V

Source§

fn wzzw(self) -> V

Source§

fn wzwx(self) -> V

Source§

fn wzwy(self) -> V

Source§

fn wzwz(self) -> V

Source§

fn wzww(self) -> V

Source§

fn wwxx(self) -> V

Source§

fn wwxy(self) -> V

Source§

fn wwxz(self) -> V

Source§

fn wwxw(self) -> V

Source§

fn wwyx(self) -> V

Source§

fn wwyy(self) -> V

Source§

fn wwyz(self) -> V

Source§

fn wwyw(self) -> V

Source§

fn wwzx(self) -> V

Source§

fn wwzy(self) -> V

Source§

fn wwzz(self) -> V

Source§

fn wwzw(self) -> V

Source§

fn wwwx(self) -> V

Source§

fn wwwy(self) -> V

Source§

fn wwwz(self) -> V

Source§

fn wwww(self) -> V

Source§

impl<V> SwizzleVector for V

Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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<M> TranscendentalMath for M

Source§

fn sin_cos(self) -> (Self, Self)

Trigonometric sine and cosine, together. This will be more efficient than calling sin and cos separately.
Source§

fn sin(self) -> Self

Trigonometric sine
Source§

fn cos(self) -> Self

Trigonometric cosine
Source§

fn tan(self) -> Self

Trigonometric tangent
Source§

fn cos_m1(self) -> Self

Returns cos(x) - 1 of self, which is more precise than cos(x) - 1 directly near zero. Read more
Source§

fn versin(self) -> Self

Returns the versine $1 - \cos(x)$ of self, evaluated as $2\sin^2(x/2)$ (accurate near zero).
Source§

fn haversin(self) -> Self

Returns the haversine $\tfrac{1 - \cos(x)}{2}$ of self, evaluated as $\sin^2(x/2)$ (accurate near zero). Read more
Source§

fn sincos_pi(self) -> (Self, Self)

Sine and cosine of pi * x, together. This will be more efficient than calling sin_pi and cos_pi separately, and more precise than computing them manually with sin(pi * x) and cos(pi * x).
Source§

fn sin_pi(self) -> Self

Trigonometric sine of pi * x, with improved precision when the policy allows.
Source§

fn cos_pi(self) -> Self

Trigonometric cosine of pi * x, with improved precision when the policy allows.
Source§

fn tan_pi(self) -> Self

Trigonometric tangent of pi * x, with improved precision when the policy allows.
Source§

fn sinc(self) -> Self

Computes sin(x) / x with improved precision when the policy allows.
Source§

fn sinc_pi(self) -> Self

Computes $\frac{\sin(\pi x)}{\pi x}$ with improved precision when the policy allows.
Source§

fn sinh_cosh(self) -> (Self, Self)

Hyperbolic sine and cosine, together. This will be more efficient than calling sinh and cosh separately.
Source§

fn sinh(self) -> Self

Hyperbolic sine
Source§

fn cosh(self) -> Self

Hyperbolic cosine
Source§

fn tanh(self) -> Self

Hyperbolic tangent
Source§

fn asin(self) -> Self

Returns the arcsine of self.
Source§

fn acos(self) -> Self

Returns the arccosine of self.
Source§

fn atan(self) -> Self

Returns the arctangent of self.
Source§

fn asinh(self) -> Self

Inverse hyperbolic sine
Source§

fn acosh(self) -> Self

Inverse hyperbolic cosine
Source§

fn atanh(self) -> Self

Inverse hyperbolic tangent
Source§

fn exp(self) -> Self

The exponential function, returns e^(self).
Source§

fn exph(self) -> Self

The Half exponential function, returns 0.5 * e^(self).
Source§

fn exp2(self) -> Self

The base-2 exponential function, returns 2^(self).
Source§

fn exp10(self) -> Self

The base-10 exponential function, returns 10^(self).
Source§

fn exp_m1(self) -> Self

Returns exp(self) - 1 of self, which is more precise than calculating exp(self) - 1 directly.
Source§

fn exp2_m1(self) -> Self

Returns 2^(self) - 1, which is more precise than calculating exp2(self) - 1 directly.
Source§

fn exp10_m1(self) -> Self

Returns 10^(self) - 1, which is more precise than calculating exp10(self) - 1 directly.
Source§

fn sqrt1pm1(self) -> Self

Returns $\sqrt{1 + x} - 1$ of self, which is more precise than sqrt(1 + x) - 1 directly near zero. Read more
Source§

fn powf(self, e: Self) -> Self

Returns self raised to the power of e.
Source§

fn powf_m1(self, e: Self) -> Self

Returns $x^e - 1$ where x = self, computed accurately as $e^{e \ln(x)}$-style expm1. Read more
Source§

fn compound(self, n: Self) -> Self

Returns $(1 + x)^n$ where x = self, computed accurately near x = 0 as $e^{n \ln(1 + x)}$. Read more
Source§

fn cbrt(self) -> Self

Returns the cube root of self.
Source§

fn nth_root<const N: usize>(self) -> Self

Returns the Nth root of self. Read more
Source§

fn ln(self) -> Self

Returns the natural logarithm of self. Read more
Source§

fn ln_1p(self) -> Self

Returns $\ln(1 + x)$ of self.
Source§

fn log2(self) -> Self

Returns the base-2 logarithm of self.
Source§

fn log10(self) -> Self

Returns the base-10 logarithm of self.
Source§

fn log2_p1(self) -> Self

Returns $\log_2(1 + x)$ of self, which is more precise than log2(1 + x) directly near zero.
Source§

fn log10_p1(self) -> Self

Returns $\log_{10}(1 + x)$ of self, which is more precise than log10(1 + x) directly near zero.
Source§

fn log(self, base: Self) -> Self

Returns the logarithm of self with respect to the given base.
Source§

fn log_n<const N: usize>(self) -> Self

Returns the logarithm of self with respect to the given integer base N. Read more
Source§

fn ln1m_expnx(self) -> Self

Returns $\ln(1 - e^{-x})$, which depending on the policy may be an approximation more performant than the exact calculation. If you’re using a policy with below average precision, and happen to have ln(x) available, you can use ln1m_expnx_ext instead to provide that.
Source§

fn ln1m_expnx_ext(self, lnx: Self) -> Self

Returns ln(1 - exp(lnx)), which depending on the policy may be an approximation more performant than the exact calculation. If you’re using a policy with below average precision, it’s recommended to use this function instead of ln1m_expnx to provide ln(x) directly. Read more
Source§

impl<E, V> TranscendentalMathWithPolicy for V

Source§

fn sin_cos_p<P>(self) -> (V, V)
where P: Policy,

Trigonometric sine and cosine, together. This will be more efficient than calling sin and cos separately.

Source§

fn sin_p<P>(self) -> V
where P: Policy,

Trigonometric sine

Source§

fn cos_p<P>(self) -> V
where P: Policy,

Trigonometric cosine

Source§

fn tan_p<P>(self) -> V
where P: Policy,

Trigonometric tangent

Source§

fn cos_m1_p<P>(self) -> V
where P: Policy,

Returns cos(x) - 1 of self, which is more precise than cos(x) - 1 directly near zero.

Evaluated as $-2\sin^2(x/2)$, which has no cancellation near x = 0.

Source§

fn versin_p<P>(self) -> V
where P: Policy,

Returns the versine $1 - \cos(x)$ of self, evaluated as $2\sin^2(x/2)$ (accurate near zero).

Source§

fn haversin_p<P>(self) -> V
where P: Policy,

Returns the haversine $\tfrac{1 - \cos(x)}{2}$ of self, evaluated as $\sin^2(x/2)$ (accurate near zero).

This is the kernel of the haversine great-circle-distance formula.

Source§

fn sincos_pi_p<P>(self) -> (V, V)
where P: Policy,

Sine and cosine of pi * x, together. This will be more efficient than calling sin_pi and cos_pi separately, and more precise than computing them manually with sin(pi * x) and cos(pi * x).

Source§

fn sin_pi_p<P>(self) -> V
where P: Policy,

Trigonometric sine of pi * x, with improved precision when the policy allows.

Source§

fn cos_pi_p<P>(self) -> V
where P: Policy,

Trigonometric cosine of pi * x, with improved precision when the policy allows.

Source§

fn tan_pi_p<P>(self) -> V
where P: Policy,

Trigonometric tangent of pi * x, with improved precision when the policy allows.

Source§

fn sinc_p<P>(self) -> V
where P: Policy,

Computes sin(x) / x with improved precision when the policy allows.

Source§

fn sinc_pi_p<P>(self) -> V
where P: Policy,

Computes $\frac{\sin(\pi x)}{\pi x}$ with improved precision when the policy allows.

Source§

fn sinh_cosh_p<P>(self) -> (V, V)
where P: Policy,

Hyperbolic sine and cosine, together. This will be more efficient than calling sinh and cosh separately.

Source§

fn sinh_p<P>(self) -> V
where P: Policy,

Hyperbolic sine

Source§

fn cosh_p<P>(self) -> V
where P: Policy,

Hyperbolic cosine

Source§

fn tanh_p<P>(self) -> V
where P: Policy,

Hyperbolic tangent

Source§

fn asin_p<P>(self) -> V
where P: Policy,

Returns the arcsine of self.

Source§

fn acos_p<P>(self) -> V
where P: Policy,

Returns the arccosine of self.

Source§

fn atan_p<P>(self) -> V
where P: Policy,

Returns the arctangent of self.

Source§

fn asinh_p<P>(self) -> V
where P: Policy,

Inverse hyperbolic sine

Source§

fn acosh_p<P>(self) -> V
where P: Policy,

Inverse hyperbolic cosine

Source§

fn atanh_p<P>(self) -> V
where P: Policy,

Inverse hyperbolic tangent

Source§

fn exp_p<P>(self) -> V
where P: Policy,

The exponential function, returns e^(self).

Source§

fn exph_p<P>(self) -> V
where P: Policy,

The Half exponential function, returns 0.5 * e^(self).

Source§

fn exp2_p<P>(self) -> V
where P: Policy,

The base-2 exponential function, returns 2^(self).

Source§

fn exp10_p<P>(self) -> V
where P: Policy,

The base-10 exponential function, returns 10^(self).

Source§

fn exp_m1_p<P>(self) -> V
where P: Policy,

Returns exp(self) - 1 of self, which is more precise than calculating exp(self) - 1 directly.

Source§

fn exp2_m1_p<P>(self) -> V
where P: Policy,

Returns 2^(self) - 1, which is more precise than calculating exp2(self) - 1 directly.

Source§

fn exp10_m1_p<P>(self) -> V
where P: Policy,

Returns 10^(self) - 1, which is more precise than calculating exp10(self) - 1 directly.

Source§

fn sqrt1pm1_p<P>(self) -> V
where P: Policy,

Returns $\sqrt{1 + x} - 1$ of self, which is more precise than sqrt(1 + x) - 1 directly near zero.

Evaluated as $\frac{x}{\sqrt{1 + x} + 1}$, which has no cancellation near x = 0.

Source§

fn powf_p<P>(self, e: V) -> V
where P: Policy,

Returns self raised to the power of e.

Source§

fn powf_m1_p<P>(self, e: V) -> V
where P: Policy,

Returns $x^e - 1$ where x = self, computed accurately as $e^{e \ln(x)}$-style expm1.

More precise than powf(x, e) - 1 when the result is near zero (i.e. x near 1 or e near 0), e.g. compound returns/growth rates.

Source§

fn compound_p<P>(self, n: V) -> V
where P: Policy,

Returns $(1 + x)^n$ where x = self, computed accurately near x = 0 as $e^{n \ln(1 + x)}$.

This is the IEEE 754 compound operation, and is more precise than powf(1 + x, n) for small x (e.g. compound-growth/interest over n periods at rate x).

Source§

fn cbrt_p<P>(self) -> V
where P: Policy,

Returns the cube root of self.

Source§

fn nth_root_p<P, const N: usize>(self) -> V
where P: Policy,

Returns the Nth root of self.

This is often faster and more accurate than using powf(1.0 / N as float). Supports negative numbers for odd N.

Source§

fn ln_p<P>(self) -> V
where P: Policy,

Returns the natural logarithm of self.

§Examples

Every math function takes a precision policy via its _p variant; a quick sweep against a scalar reference is the cheapest way to validate that a policy choice is accurate enough for your domain:

use thermite::prelude::*;
use thermite::math::policy::policies::Precision;

type V = Vector<f64>;

let mut max_err = 0.0f64;
for i in 1..=1000 {
    let x = i as f64 * 0.05;
    let y = V::splat(x).ln_p::<Precision>().extract::<0>();
    max_err = max_err.max((y - x.ln()).abs() / x.ln().abs().max(1.0));
}
assert!(max_err < 1e-14, "max relative error {max_err}");
Source§

fn ln_1p_p<P>(self) -> V
where P: Policy,

Returns $\ln(1 + x)$ of self.

Source§

fn log2_p<P>(self) -> V
where P: Policy,

Returns the base-2 logarithm of self.

Source§

fn log10_p<P>(self) -> V
where P: Policy,

Returns the base-10 logarithm of self.

Source§

fn log2_p1_p<P>(self) -> V
where P: Policy,

Returns $\log_2(1 + x)$ of self, which is more precise than log2(1 + x) directly near zero.

Source§

fn log10_p1_p<P>(self) -> V
where P: Policy,

Returns $\log_{10}(1 + x)$ of self, which is more precise than log10(1 + x) directly near zero.

Source§

fn log_p<P>(self, base: V) -> V
where P: Policy,

Returns the logarithm of self with respect to the given base.

Source§

fn log_n_p<P, const N: usize>(self) -> V
where P: Policy,

Returns the logarithm of self with respect to the given integer base N.

This is efficient for bases <=32 using a lookup table, and falls back to the general log(x)/libm::log(N) implementation for larger bases.

For bases 0 and 1, the result is 0 and Infinity respectively.

Source§

fn ln1m_expnx_p<P>(self) -> V
where P: Policy,

Returns $\ln(1 - e^{-x})$, which depending on the policy may be an approximation more performant than the exact calculation. If you’re using a policy with below average precision, and happen to have ln(x) available, you can use ln1m_expnx_ext instead to provide that.

Source§

fn ln1m_expnx_ext_p<P>(self, lnx: V) -> V
where P: Policy,

Returns ln(1 - exp(lnx)), which depending on the policy may be an approximation more performant than the exact calculation. If you’re using a policy with below average precision, it’s recommended to use this function instead of ln1m_expnx to provide ln(x) directly.

Although not obvious, ln(x) is used internally for the approximation, and if it’s already available, you may as well use this function to avoid recomputing it.

Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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> UpperBounded for T
where T: Bounded,

Source§

fn max_value() -> T

Returns the largest finite number this type can represent
Source§

impl<USIZE, U32, U64, R> VectorIndexedBy<USIZE, U32, U64> for R

Source§

impl<I, V> VectorIndices<V> for I
where I: UnsignedIntegerVector<Lanes = <V as GenericVector>::Lanes>, V: IndexableVector<I>,

Source§

unsafe fn gather_ptr(ptr: *const <V as GenericVector>::Element, indices: I) -> V

Gather one element of V per lane from ptr[indices[lane]]. Read more
Source§

unsafe fn gather_ptr_m( src: V, mask: <V as GenericVector>::Mask, ptr: *const <V as GenericVector>::Element, indices: I, ) -> V

Like gather_ptr, but only lanes where mask is true are loaded; the rest are taken from src. Read more
Source§

unsafe fn gather_ptr_z( mask: <V as GenericVector>::Mask, ptr: *const <V as GenericVector>::Element, indices: I, ) -> V

Like gather_ptr_m, but masked-off lanes are zeroed instead of taken from a source vector. Read more
Source§

unsafe fn scatter_ptr( value: V, ptr: *mut <V as GenericVector>::Element, indices: I, )

Scatter each lane of value to ptr[indices[lane]]. Read more
Source§

unsafe fn scatter_ptr_m( value: V, mask: <V as GenericVector>::Mask, ptr: *mut <V as GenericVector>::Element, indices: I, )

Like scatter_ptr, but only lanes where mask is true are written. Read more