Skip to main content

SimdReal

Struct SimdReal 

Source
#[repr(transparent)]
pub struct SimdReal(pub f32x4);
Expand description

A wrapper type of wide::f32x4 that implements all the relevant traits from num and simba.

This is needed to overcome the orphan rules.

Tuple Fields§

§0: f32x4

Implementations§

Source§

impl WideF32x4

Source

pub const ZERO: WideF32x4

Source

pub const ONE: WideF32x4

Source

pub fn into_arr(self) -> [f32; 4]

Source

pub fn from_arr(arr: [f32; 4]) -> WideF32x4

Source

pub fn map(self, f: impl Fn(f32) -> f32) -> WideF32x4

Source

pub fn zip_map(self, rhs: WideF32x4, f: impl Fn(f32, f32) -> f32) -> WideF32x4

Trait Implementations§

Source§

impl Add for WideF32x4

Source§

type Output = WideF32x4

The resulting type after applying the + operator.
Source§

fn add(self, rhs: WideF32x4) -> WideF32x4

Performs the + operation. Read more
Source§

impl AddAssign for WideF32x4

Source§

fn add_assign(&mut self, rhs: WideF32x4)

Performs the += operation. Read more
Source§

impl Clone for WideF32x4

Source§

fn clone(&self) -> WideF32x4

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

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

Performs copy-assignment from source. Read more
Source§

impl Copy for WideF32x4

Source§

impl Debug for WideF32x4

Source§

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

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

impl Default for WideF32x4

Source§

fn default() -> WideF32x4

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

impl Div for WideF32x4

Source§

type Output = WideF32x4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: WideF32x4) -> WideF32x4

Performs the / operation. Read more
Source§

impl DivAssign for WideF32x4

Source§

fn div_assign(&mut self, rhs: WideF32x4)

Performs the /= operation. Read more
Source§

impl Field for WideF32x4

Source§

impl From<[f32; 4]> for WideF32x4

Source§

fn from(vals: [f32; 4]) -> WideF32x4

Converts to this type from the input type.
Source§

impl FromPrimitive for WideF32x4

Source§

fn from_i64(n: i64) -> Option<WideF32x4>

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u64(n: u64) -> Option<WideF32x4>

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_isize(n: isize) -> Option<WideF32x4>

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i8(n: i8) -> Option<WideF32x4>

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i16(n: i16) -> Option<WideF32x4>

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i32(n: i32) -> Option<WideF32x4>

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_usize(n: usize) -> Option<WideF32x4>

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u8(n: u8) -> Option<WideF32x4>

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u16(n: u16) -> Option<WideF32x4>

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u32(n: u32) -> Option<WideF32x4>

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f32(n: f32) -> Option<WideF32x4>

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f64(n: f64) -> Option<WideF32x4>

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_i128(n: i128) -> Option<Self>

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_u128(n: u128) -> Option<Self>

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

impl Mul for WideF32x4

Source§

type Output = WideF32x4

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: WideF32x4) -> WideF32x4

Performs the * operation. Read more
Source§

impl MulAssign for WideF32x4

Source§

fn mul_assign(&mut self, rhs: WideF32x4)

Performs the *= operation. Read more
Source§

impl Neg for WideF32x4

Source§

type Output = WideF32x4

The resulting type after applying the - operator.
Source§

fn neg(self) -> WideF32x4

Performs the unary - operation. Read more
Source§

impl Num for WideF32x4

Source§

type FromStrRadixErr = <f32 as Num>::FromStrRadixErr

Source§

fn from_str_radix( str: &str, radix: u32, ) -> Result<WideF32x4, <WideF32x4 as Num>::FromStrRadixErr>

Convert from a string and radix (typically 2..=36). Read more
Source§

impl One for WideF32x4

Source§

fn one() -> WideF32x4

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
Source§

impl PartialEq for WideF32x4

Source§

fn eq(&self, rhs: &WideF32x4) -> bool

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

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

Inequality operator !=. Read more
Source§

impl PrimitiveSimdValue for WideF32x4

Source§

impl Rem for WideF32x4

Source§

type Output = WideF32x4

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: WideF32x4) -> WideF32x4

Performs the % operation. Read more
Source§

impl RemAssign for WideF32x4

Source§

fn rem_assign(&mut self, rhs: WideF32x4)

Performs the %= operation. Read more
Source§

impl SimdComplexField for WideF32x4

Source§

type SimdRealField = WideF32x4

Type of the coefficients of a complex number.
Source§

fn simd_horizontal_sum(self) -> <WideF32x4 as SimdValue>::Element

Computes the sum of all the lanes of self.
Source§

fn simd_horizontal_product(self) -> <WideF32x4 as SimdValue>::Element

Computes the product of all the lanes of self.
Source§

fn from_simd_real( re: <WideF32x4 as SimdComplexField>::SimdRealField, ) -> WideF32x4

Builds a pure-real complex number from the given value.
Source§

fn simd_real(self) -> <WideF32x4 as SimdComplexField>::SimdRealField

The real part of this complex number.
Source§

fn simd_imaginary(self) -> <WideF32x4 as SimdComplexField>::SimdRealField

The imaginary part of this complex number.
Source§

fn simd_norm1(self) -> <WideF32x4 as SimdComplexField>::SimdRealField

The sum of the absolute value of this complex number’s real and imaginary part.
Source§

fn simd_modulus(self) -> <WideF32x4 as SimdComplexField>::SimdRealField

The modulus of this complex number.
Source§

fn simd_modulus_squared(self) -> <WideF32x4 as SimdComplexField>::SimdRealField

The squared modulus of this complex number.
Source§

fn simd_argument(self) -> <WideF32x4 as SimdComplexField>::SimdRealField

The argument of this complex number.
Source§

fn simd_to_exp( self, ) -> (<WideF32x4 as SimdComplexField>::SimdRealField, WideF32x4)

The exponential form of this complex number: (modulus, e^{i arg})
Source§

fn simd_recip(self) -> WideF32x4

Source§

fn simd_conjugate(self) -> WideF32x4

Source§

fn simd_scale( self, factor: <WideF32x4 as SimdComplexField>::SimdRealField, ) -> WideF32x4

Multiplies this complex number by factor.
Source§

fn simd_unscale( self, factor: <WideF32x4 as SimdComplexField>::SimdRealField, ) -> WideF32x4

Divides this complex number by factor.
Source§

fn simd_floor(self) -> WideF32x4

Source§

fn simd_ceil(self) -> WideF32x4

Source§

fn simd_round(self) -> WideF32x4

Source§

fn simd_trunc(self) -> WideF32x4

Source§

fn simd_fract(self) -> WideF32x4

Source§

fn simd_abs(self) -> WideF32x4

The absolute value of this complex number: self / self.signum(). Read more
Source§

fn simd_signum(self) -> WideF32x4

The exponential part of this complex number: self / self.modulus()
Source§

fn simd_mul_add(self, a: WideF32x4, b: WideF32x4) -> WideF32x4

Source§

fn simd_powi(self, n: i32) -> WideF32x4

Source§

fn simd_powf(self, n: WideF32x4) -> WideF32x4

Source§

fn simd_powc(self, n: WideF32x4) -> WideF32x4

Source§

fn simd_sqrt(self) -> WideF32x4

Source§

fn simd_exp(self) -> WideF32x4

Source§

fn simd_exp2(self) -> WideF32x4

Source§

fn simd_exp_m1(self) -> WideF32x4

Source§

fn simd_ln_1p(self) -> WideF32x4

Source§

fn simd_ln(self) -> WideF32x4

Source§

fn simd_log(self, base: WideF32x4) -> WideF32x4

Source§

fn simd_log2(self) -> WideF32x4

Source§

fn simd_log10(self) -> WideF32x4

Source§

fn simd_cbrt(self) -> WideF32x4

Source§

fn simd_hypot( self, other: WideF32x4, ) -> <WideF32x4 as SimdComplexField>::SimdRealField

Computes (self.conjugate() * self + other.conjugate() * other).sqrt()
Source§

fn simd_sin(self) -> WideF32x4

Source§

fn simd_cos(self) -> WideF32x4

Source§

fn simd_tan(self) -> WideF32x4

Source§

fn simd_asin(self) -> WideF32x4

Source§

fn simd_acos(self) -> WideF32x4

Source§

fn simd_atan(self) -> WideF32x4

Source§

fn simd_sin_cos(self) -> (WideF32x4, WideF32x4)

Source§

fn simd_sinh(self) -> WideF32x4

Source§

fn simd_cosh(self) -> WideF32x4

Source§

fn simd_tanh(self) -> WideF32x4

Source§

fn simd_asinh(self) -> WideF32x4

Source§

fn simd_acosh(self) -> WideF32x4

Source§

fn simd_atanh(self) -> WideF32x4

Source§

fn simd_to_polar(self) -> (Self::SimdRealField, Self::SimdRealField)

The polar form of this complex number: (modulus, arg)
Source§

fn simd_sinh_cosh(self) -> (Self, Self)

Source§

fn simd_sinc(self) -> Self

Cardinal sine
Source§

fn simd_sinhc(self) -> Self

Source§

fn simd_cosc(self) -> Self

Cardinal cos
Source§

fn simd_coshc(self) -> Self

Source§

impl SimdPartialOrd for WideF32x4

Source§

fn simd_gt(self, other: WideF32x4) -> <WideF32x4 as SimdValue>::SimdBool

Lanewise greater than > comparison.
Source§

fn simd_lt(self, other: WideF32x4) -> <WideF32x4 as SimdValue>::SimdBool

Lanewise less than < comparison.
Source§

fn simd_ge(self, other: WideF32x4) -> <WideF32x4 as SimdValue>::SimdBool

Lanewise greater or equal >= comparison.
Source§

fn simd_le(self, other: WideF32x4) -> <WideF32x4 as SimdValue>::SimdBool

Lanewise less or equal <= comparison.
Source§

fn simd_eq(self, other: WideF32x4) -> <WideF32x4 as SimdValue>::SimdBool

Lanewise equal == comparison.
Source§

fn simd_ne(self, other: WideF32x4) -> <WideF32x4 as SimdValue>::SimdBool

Lanewise not equal != comparison.
Source§

fn simd_max(self, other: WideF32x4) -> WideF32x4

Lanewise max value.
Source§

fn simd_min(self, other: WideF32x4) -> WideF32x4

Lanewise min value.
Source§

fn simd_clamp(self, min: WideF32x4, max: WideF32x4) -> WideF32x4

Clamps each lane of self between the corresponding lane of min and max.
Source§

fn simd_horizontal_min(self) -> <WideF32x4 as SimdValue>::Element

The min value among all lanes of self.
Source§

fn simd_horizontal_max(self) -> <WideF32x4 as SimdValue>::Element

The max value among all lanes of self.
Source§

impl SimdRealField for WideF32x4

Source§

impl SimdSigned for WideF32x4

Source§

fn simd_abs(&self) -> WideF32x4

The absolute value of each lane of self.
Source§

fn simd_abs_sub(&self, other: &WideF32x4) -> WideF32x4

The absolute difference of each lane of self. Read more
Source§

fn simd_signum(&self) -> WideF32x4

The signum of each lane of Self.
Source§

fn is_simd_positive(&self) -> <WideF32x4 as SimdValue>::SimdBool

Tests which lane is positive.
Source§

fn is_simd_negative(&self) -> <WideF32x4 as SimdValue>::SimdBool

Tests which lane is negative.
Source§

impl SimdValue for WideF32x4

Source§

const LANES: usize = 4

The number of lanes of this SIMD value.
Source§

type Element = f32

The type of the elements of each lane of this SIMD value.
Source§

type SimdBool = WideBoolF32x4

Type of the result of comparing two SIMD values like self.
Source§

fn splat(val: <WideF32x4 as SimdValue>::Element) -> WideF32x4

Initializes an SIMD value with each lanes set to val.
Source§

fn extract(&self, i: usize) -> <WideF32x4 as SimdValue>::Element

Extracts the i-th lane of self. Read more
Source§

unsafe fn extract_unchecked( &self, i: usize, ) -> <WideF32x4 as SimdValue>::Element

Extracts the i-th lane of self without bound-checking. Read more
Source§

fn replace(&mut self, i: usize, val: <WideF32x4 as SimdValue>::Element)

Replaces the i-th lane of self by val. Read more
Source§

unsafe fn replace_unchecked( &mut self, i: usize, val: <WideF32x4 as SimdValue>::Element, )

Replaces the i-th lane of self by val without bound-checking. Read more
Source§

fn select( self, cond: <WideF32x4 as SimdValue>::SimdBool, other: WideF32x4, ) -> WideF32x4

Merges self and other depending on the lanes of cond. Read more
Source§

fn map_lanes(self, f: impl Fn(Self::Element) -> Self::Element) -> Self
where Self: Clone,

Applies a function to each lane of self. Read more
Source§

fn zip_map_lanes( self, b: Self, f: impl Fn(Self::Element, Self::Element) -> Self::Element, ) -> Self
where Self: Clone,

Applies a function to each lane of self paired with the corresponding lane of b. Read more
Source§

impl Sub for WideF32x4

Source§

type Output = WideF32x4

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: WideF32x4) -> WideF32x4

Performs the - operation. Read more
Source§

impl SubAssign for WideF32x4

Source§

fn sub_assign(&mut self, rhs: WideF32x4)

Performs the -= operation. Read more
Source§

impl SubsetOf<WideF32x4> for WideF32x4

Source§

fn to_superset(&self) -> WideF32x4

The inclusion map: converts self to the equivalent element of its superset.
Source§

fn from_superset(element: &WideF32x4) -> Option<WideF32x4>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn from_superset_unchecked(element: &WideF32x4) -> WideF32x4

Use with care! Same as self.to_superset but without any property checks. Always succeeds.
Source§

fn is_in_subset(_: &WideF32x4) -> bool

Checks if element is actually part of the subset Self (and can be converted to it).
Source§

impl Zero for WideF32x4

Source§

fn zero() -> WideF32x4

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<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, Right> ClosedAdd<Right> for T
where T: Add<Right, Output = T> + AddAssign<Right>,

Source§

impl<T, Right> ClosedAddAssign<Right> for T
where T: ClosedAdd<Right> + AddAssign<Right>,

Source§

impl<T, Right> ClosedDiv<Right> for T
where T: Div<Right, Output = T> + DivAssign<Right>,

Source§

impl<T, Right> ClosedDivAssign<Right> for T
where T: ClosedDiv<Right> + DivAssign<Right>,

Source§

impl<T, Right> ClosedMul<Right> for T
where T: Mul<Right, Output = T> + MulAssign<Right>,

Source§

impl<T, Right> ClosedMulAssign<Right> for T
where T: ClosedMul<Right> + MulAssign<Right>,

Source§

impl<T> ClosedNeg for T
where T: Neg<Output = T>,

Source§

impl<T, Right> ClosedSub<Right> for T
where T: Sub<Right, Output = T> + SubAssign<Right>,

Source§

impl<T, Right> ClosedSubAssign<Right> for T
where T: ClosedSub<Right> + SubAssign<Right>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

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

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> NumAssign for T
where T: Num + NumAssignOps,

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<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.