Trait Scalar

Source
pub trait Scalar:
    Copy
    + Default
    + FromPrimitive
    + Inv<Output = Self>
    + Neg<Output = Self>
    + NumAssign
    + NumCast
    + NumOps
    + Pow<Self, Output = Self>
    + Product
    + Sum
    + ToPrimitive
    + 'static {
    type Complex: Scalar<Complex = Self::Complex, Real = Self::Real> + NumOps<Self::Real>;
    type Real: Scalar<Complex = Self::Complex, Real = Self::Real> + NumOps<Self::Complex, Self::Complex>;

Show 33 methods // Required methods fn from_real(re: Self::Real) -> Self; fn abs(self) -> Self::Real; fn acos(self) -> Self; fn acosh(self) -> Self; fn asin(self) -> Self; fn asinh(self) -> Self; fn atan(self) -> Self; fn atanh(self) -> Self; fn as_complex(&self) -> Self::Complex; fn conj(&self) -> Self::Complex; fn re(&self) -> Self::Real; fn cos(self) -> Self; fn cosh(self) -> Self; fn exp(self) -> Self; fn ln(self) -> Self; fn pow(self, exp: Self) -> Self; fn powc(self, exp: Self::Complex) -> Self::Complex; fn powf(self, exp: Self::Real) -> Self; fn sin(self) -> Self; fn sinh(self) -> Self; fn sqrt(self) -> Self; fn tan(self) -> Self; fn tanh(self) -> Self; // Provided methods fn add_complex(&self, other: Self::Complex) -> Self::Complex { ... } fn div_complex(&self, other: Self::Complex) -> Self::Complex { ... } fn mul_complex(&self, other: Self::Complex) -> Self::Complex { ... } fn sub_complex(&self, other: Self::Complex) -> Self::Complex { ... } fn cubed(&self) -> Self { ... } fn im(&self) -> Self::Real { ... } fn inv(self) -> Self { ... } fn powi(self, exp: i32) -> Self { ... } fn recip(self) -> Self { ... } fn sqr(self) -> Self { ... }
}

Required Associated Types§

Source

type Complex: Scalar<Complex = Self::Complex, Real = Self::Real> + NumOps<Self::Real>

Source

type Real: Scalar<Complex = Self::Complex, Real = Self::Real> + NumOps<Self::Complex, Self::Complex>

Required Methods§

Source

fn from_real(re: Self::Real) -> Self

Source

fn abs(self) -> Self::Real

Source

fn acos(self) -> Self

Source

fn acosh(self) -> Self

Source

fn asin(self) -> Self

Source

fn asinh(self) -> Self

Source

fn atan(self) -> Self

Source

fn atanh(self) -> Self

Source

fn as_complex(&self) -> Self::Complex

Source

fn conj(&self) -> Self::Complex

Source

fn re(&self) -> Self::Real

Source

fn cos(self) -> Self

Source

fn cosh(self) -> Self

Source

fn exp(self) -> Self

Source

fn ln(self) -> Self

Source

fn pow(self, exp: Self) -> Self

Source

fn powc(self, exp: Self::Complex) -> Self::Complex

Source

fn powf(self, exp: Self::Real) -> Self

Source

fn sin(self) -> Self

Source

fn sinh(self) -> Self

Source

fn sqrt(self) -> Self

Source

fn tan(self) -> Self

Source

fn tanh(self) -> Self

Provided Methods§

Source

fn add_complex(&self, other: Self::Complex) -> Self::Complex

Source

fn div_complex(&self, other: Self::Complex) -> Self::Complex

Source

fn mul_complex(&self, other: Self::Complex) -> Self::Complex

Source

fn sub_complex(&self, other: Self::Complex) -> Self::Complex

Source

fn cubed(&self) -> Self

Source

fn im(&self) -> Self::Real

Source

fn inv(self) -> Self

Source

fn powi(self, exp: i32) -> Self

Source

fn recip(self) -> Self

Source

fn sqr(self) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Scalar for f32

Source§

type Complex = Complex<f32>

Source§

type Real = f32

Source§

fn from_real(re: <f32 as Scalar>::Real) -> f32

Source§

fn abs(self) -> <f32 as Scalar>::Real

Source§

fn acos(self) -> f32

Source§

fn acosh(self) -> f32

Source§

fn asin(self) -> f32

Source§

fn asinh(self) -> f32

Source§

fn atan(self) -> f32

Source§

fn atanh(self) -> f32

Source§

fn as_complex(&self) -> <f32 as Scalar>::Complex

Source§

fn conj(&self) -> <f32 as Scalar>::Complex

Source§

fn re(&self) -> <f32 as Scalar>::Real

Source§

fn cos(self) -> f32

Source§

fn cosh(self) -> f32

Source§

fn exp(self) -> f32

Source§

fn ln(self) -> f32

Source§

fn pow(self, exp: f32) -> f32

Source§

fn powc(self, exp: <f32 as Scalar>::Complex) -> <f32 as Scalar>::Complex

Source§

fn powf(self, exp: <f32 as Scalar>::Real) -> f32

Source§

fn powi(self, exp: i32) -> f32

Source§

fn sin(self) -> f32

Source§

fn sinh(self) -> f32

Source§

fn sqrt(self) -> f32

Source§

fn tan(self) -> f32

Source§

fn tanh(self) -> f32

Source§

impl Scalar for f64

Source§

type Complex = Complex<f64>

Source§

type Real = f64

Source§

fn from_real(re: <f64 as Scalar>::Real) -> f64

Source§

fn abs(self) -> <f64 as Scalar>::Real

Source§

fn acos(self) -> f64

Source§

fn acosh(self) -> f64

Source§

fn asin(self) -> f64

Source§

fn asinh(self) -> f64

Source§

fn atan(self) -> f64

Source§

fn atanh(self) -> f64

Source§

fn as_complex(&self) -> <f64 as Scalar>::Complex

Source§

fn conj(&self) -> <f64 as Scalar>::Complex

Source§

fn re(&self) -> <f64 as Scalar>::Real

Source§

fn cos(self) -> f64

Source§

fn cosh(self) -> f64

Source§

fn exp(self) -> f64

Source§

fn ln(self) -> f64

Source§

fn pow(self, exp: f64) -> f64

Source§

fn powc(self, exp: <f64 as Scalar>::Complex) -> <f64 as Scalar>::Complex

Source§

fn powf(self, exp: <f64 as Scalar>::Real) -> f64

Source§

fn powi(self, exp: i32) -> f64

Source§

fn sin(self) -> f64

Source§

fn sinh(self) -> f64

Source§

fn sqrt(self) -> f64

Source§

fn tan(self) -> f64

Source§

fn tanh(self) -> f64

Source§

impl<T> Scalar for Complex<T>
where T: Scalar<Complex = Complex<T>, Real = T>, <T as Scalar>::Real: NumOps<Complex<T>, Complex<T>> + Float,

Source§

type Complex = Complex<T>

Source§

type Real = T

Source§

fn from_real(re: <Complex<T> as Scalar>::Real) -> Complex<T>

Source§

fn abs(self) -> <Complex<T> as Scalar>::Real

Source§

fn acos(self) -> Complex<T>

Source§

fn acosh(self) -> Complex<T>

Source§

fn asin(self) -> Complex<T>

Source§

fn asinh(self) -> Complex<T>

Source§

fn atan(self) -> Complex<T>

Source§

fn atanh(self) -> Complex<T>

Source§

fn as_complex(&self) -> <Complex<T> as Scalar>::Complex

Source§

fn conj(&self) -> <Complex<T> as Scalar>::Complex

Source§

fn re(&self) -> <Complex<T> as Scalar>::Real

Source§

fn im(&self) -> <Complex<T> as Scalar>::Real

Source§

fn cos(self) -> Complex<T>

Source§

fn cosh(self) -> Complex<T>

Source§

fn exp(self) -> Complex<T>

Source§

fn ln(self) -> Complex<T>

Source§

fn pow(self, exp: Complex<T>) -> Complex<T>

Source§

fn powc( self, exp: <Complex<T> as Scalar>::Complex, ) -> <Complex<T> as Scalar>::Complex

Source§

fn powf(self, exp: T) -> Complex<T>

Source§

fn powi(self, exp: i32) -> Complex<T>

Source§

fn sin(self) -> Complex<T>

Source§

fn sinh(self) -> Complex<T>

Source§

fn sqrt(self) -> Complex<T>

Source§

fn tan(self) -> Complex<T>

Source§

fn tanh(self) -> Complex<T>

Implementors§