[][src]Trait ndarray_linalg::types::Scalar

pub trait Scalar: 'static + Copy + Neg<Output = Self> + Clone + Sum<Self> + Product<Self> + Debug + Display + LowerExp + UpperExp + FromPrimitive + NumCast + NumAssign + Deserialize<'de> + Serialize where
    <Self::Real as Scalar>::Real == Self::Real,
    <Self::Real as Scalar>::Complex == Self::Complex,
    <Self::Complex as Scalar>::Real == Self::Real,
    <Self::Complex as Scalar>::Complex == Self::Complex
{ type Real: Scalar + Float + NumOps<Self::Real, Self::Real>; type Complex: Scalar + NumOps<Self::Real, Self::Complex> + NumOps<Self::Complex, Self::Complex>; fn real<T>(re: T) -> Self::Real
    where
        T: ToPrimitive
;
fn complex<T>(re: T, im: T) -> Self::Complex
    where
        T: ToPrimitive
;
fn from_real(re: Self::Real) -> Self;
fn add_real(self, re: Self::Real) -> Self;
fn sub_real(self, re: Self::Real) -> Self;
fn mul_real(self, re: Self::Real) -> Self;
fn div_real(self, re: Self::Real) -> Self;
fn add_complex(self, im: Self::Complex) -> Self::Complex;
fn sub_complex(self, im: Self::Complex) -> Self::Complex;
fn mul_complex(self, im: Self::Complex) -> Self::Complex;
fn div_complex(self, im: Self::Complex) -> Self::Complex;
fn pow(&self, n: Self) -> Self;
fn powi(&self, n: i32) -> Self;
fn powf(&self, n: Self::Real) -> Self;
fn powc(&self, n: Self::Complex) -> Self::Complex;
fn re(&self) -> Self::Real;
fn im(&self) -> Self::Real;
fn as_c(&self) -> Self::Complex;
fn conj(&self) -> Self;
fn abs(&self) -> Self::Real;
fn square(&self) -> Self::Real;
fn sqrt(&self) -> Self;
fn exp(&self) -> Self;
fn ln(&self) -> Self;
fn sin(&self) -> Self;
fn cos(&self) -> Self;
fn tan(&self) -> Self;
fn asin(&self) -> Self;
fn acos(&self) -> Self;
fn atan(&self) -> Self;
fn sinh(&self) -> Self;
fn cosh(&self) -> Self;
fn tanh(&self) -> Self;
fn asinh(&self) -> Self;
fn acosh(&self) -> Self;
fn atanh(&self) -> Self;
fn rand(rng: &mut impl Rng) -> Self; }

Associated Types

type Real: Scalar + Float + NumOps<Self::Real, Self::Real>

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

Loading content...

Required methods

fn real<T>(re: T) -> Self::Real where
    T: ToPrimitive

Create a new real number

fn complex<T>(re: T, im: T) -> Self::Complex where
    T: ToPrimitive

Create a new complex number

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

fn add_real(self, re: Self::Real) -> Self

fn sub_real(self, re: Self::Real) -> Self

fn mul_real(self, re: Self::Real) -> Self

fn div_real(self, re: Self::Real) -> Self

fn add_complex(self, im: Self::Complex) -> Self::Complex

fn sub_complex(self, im: Self::Complex) -> Self::Complex

fn mul_complex(self, im: Self::Complex) -> Self::Complex

fn div_complex(self, im: Self::Complex) -> Self::Complex

fn pow(&self, n: Self) -> Self

fn powi(&self, n: i32) -> Self

fn powf(&self, n: Self::Real) -> Self

fn powc(&self, n: Self::Complex) -> Self::Complex

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

Real part

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

Imaginary part

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

As a complex number

fn conj(&self) -> Self

Complex conjugate

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

Absolute value

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

Sqaure of absolute value

fn sqrt(&self) -> Self

fn exp(&self) -> Self

fn ln(&self) -> Self

fn sin(&self) -> Self

fn cos(&self) -> Self

fn tan(&self) -> Self

fn asin(&self) -> Self

fn acos(&self) -> Self

fn atan(&self) -> Self

fn sinh(&self) -> Self

fn cosh(&self) -> Self

fn tanh(&self) -> Self

fn asinh(&self) -> Self

fn acosh(&self) -> Self

fn atanh(&self) -> Self

fn rand(rng: &mut impl Rng) -> Self

Loading content...

Implementations on Foreign Types

impl Scalar for f64[src]

type Real = f64

type Complex = Complex<f64>

impl Scalar for Complex<f64>[src]

type Real = f64

type Complex = Complex<f64>

impl Scalar for f32[src]

type Real = f32

type Complex = Complex<f32>

impl Scalar for Complex<f32>[src]

type Real = f32

type Complex = Complex<f32>

Loading content...

Implementors

Loading content...