[−][src]Trait lair::Scalar
A trait for real and complex numbers.
Associated Types
type Real: Scalar + Float + NumOps<Self::Real, Self::Real>
type Complex: Scalar + NumOps<Self::Real, Self::Complex> + NumOps<Self::Complex, Self::Complex>
Required methods
fn real<T>(re: T) -> Self::Real where
T: ToPrimitive,
T: ToPrimitive,
Create a new real number
fn complex<T>(re: T, im: T) -> Self::Complex where
T: ToPrimitive,
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
Generate an random number from rand::distributions::Standard
Implementations on Foreign Types
impl Scalar for Complex<f64>
[src]
type Real = f64
type Complex = Complex<f64>
fn re(&self) -> <Complex<f64> as Scalar>::Real
[src]
fn im(&self) -> <Complex<f64> as Scalar>::Real
[src]
fn from_real(re: <Complex<f64> as Scalar>::Real) -> Complex<f64>
[src]
fn pow(self, n: Complex<f64>) -> Complex<f64>
[src]
fn powi(self, n: i32) -> Complex<f64>
[src]
fn powf(self, n: <Complex<f64> as Scalar>::Real) -> Complex<f64>
[src]
fn powc(
self,
n: <Complex<f64> as Scalar>::Complex
) -> <Complex<f64> as Scalar>::Complex
[src]
self,
n: <Complex<f64> as Scalar>::Complex
) -> <Complex<f64> as Scalar>::Complex
fn real<T>(re: T) -> <Complex<f64> as Scalar>::Real where
T: ToPrimitive,
[src]
T: ToPrimitive,
fn complex<T>(re: T, im: T) -> <Complex<f64> as Scalar>::Complex where
T: ToPrimitive,
[src]
T: ToPrimitive,
fn as_c(&self) -> <Complex<f64> as Scalar>::Complex
[src]
fn conj(&self) -> Complex<f64>
[src]
fn square(self) -> <Complex<f64> as Scalar>::Real
[src]
fn abs(self) -> <Complex<f64> as Scalar>::Real
[src]
fn rand(rng: &mut impl Rng) -> Complex<f64>
[src]
fn add_real(self, re: <Complex<f64> as Scalar>::Real) -> Complex<f64>
[src]
fn sub_real(self, re: <Complex<f64> as Scalar>::Real) -> Complex<f64>
[src]
fn mul_real(self, re: <Complex<f64> as Scalar>::Real) -> Complex<f64>
[src]
fn div_real(self, re: <Complex<f64> as Scalar>::Real) -> Complex<f64>
[src]
fn add_complex(
self,
im: <Complex<f64> as Scalar>::Complex
) -> <Complex<f64> as Scalar>::Complex
[src]
self,
im: <Complex<f64> as Scalar>::Complex
) -> <Complex<f64> as Scalar>::Complex
fn sub_complex(
self,
im: <Complex<f64> as Scalar>::Complex
) -> <Complex<f64> as Scalar>::Complex
[src]
self,
im: <Complex<f64> as Scalar>::Complex
) -> <Complex<f64> as Scalar>::Complex
fn mul_complex(
self,
im: <Complex<f64> as Scalar>::Complex
) -> <Complex<f64> as Scalar>::Complex
[src]
self,
im: <Complex<f64> as Scalar>::Complex
) -> <Complex<f64> as Scalar>::Complex
fn div_complex(
self,
im: <Complex<f64> as Scalar>::Complex
) -> <Complex<f64> as Scalar>::Complex
[src]
self,
im: <Complex<f64> as Scalar>::Complex
) -> <Complex<f64> as Scalar>::Complex
fn sqrt(self) -> Complex<f64>
[src]
fn exp(self) -> Complex<f64>
[src]
fn ln(self) -> Complex<f64>
[src]
fn sin(self) -> Complex<f64>
[src]
fn cos(self) -> Complex<f64>
[src]
fn tan(self) -> Complex<f64>
[src]
fn sinh(self) -> Complex<f64>
[src]
fn cosh(self) -> Complex<f64>
[src]
fn tanh(self) -> Complex<f64>
[src]
fn asin(self) -> Complex<f64>
[src]
fn acos(self) -> Complex<f64>
[src]
fn atan(self) -> Complex<f64>
[src]
fn asinh(self) -> Complex<f64>
[src]
fn acosh(self) -> Complex<f64>
[src]
fn atanh(self) -> Complex<f64>
[src]
impl Scalar for f32
[src]
type Real = f32
type Complex = Complex<f32>
fn re(&self) -> <f32 as Scalar>::Real
[src]
fn im(&self) -> <f32 as Scalar>::Real
[src]
fn from_real(re: <f32 as Scalar>::Real) -> f32
[src]
fn pow(self, n: f32) -> f32
[src]
fn powi(self, n: i32) -> f32
[src]
fn powf(self, n: <f32 as Scalar>::Real) -> f32
[src]
fn powc(self, n: <f32 as Scalar>::Complex) -> <f32 as Scalar>::Complex
[src]
fn real<T>(re: T) -> <f32 as Scalar>::Real where
T: ToPrimitive,
[src]
T: ToPrimitive,
fn complex<T>(re: T, im: T) -> <f32 as Scalar>::Complex where
T: ToPrimitive,
[src]
T: ToPrimitive,
fn as_c(&self) -> <f32 as Scalar>::Complex
[src]
fn conj(&self) -> f32
[src]
fn square(self) -> <f32 as Scalar>::Real
[src]
fn rand(rng: &mut impl Rng) -> f32
[src]
fn add_real(self, re: <f32 as Scalar>::Real) -> f32
[src]
fn sub_real(self, re: <f32 as Scalar>::Real) -> f32
[src]
fn mul_real(self, re: <f32 as Scalar>::Real) -> f32
[src]
fn div_real(self, re: <f32 as Scalar>::Real) -> f32
[src]
fn add_complex(self, im: <f32 as Scalar>::Complex) -> <f32 as Scalar>::Complex
[src]
fn sub_complex(self, im: <f32 as Scalar>::Complex) -> <f32 as Scalar>::Complex
[src]
fn mul_complex(self, im: <f32 as Scalar>::Complex) -> <f32 as Scalar>::Complex
[src]
fn div_complex(self, im: <f32 as Scalar>::Complex) -> <f32 as Scalar>::Complex
[src]
fn sqrt(self) -> f32
[src]
fn abs(self) -> f32
[src]
fn exp(self) -> f32
[src]
fn ln(self) -> f32
[src]
fn sin(self) -> f32
[src]
fn cos(self) -> f32
[src]
fn tan(self) -> f32
[src]
fn sinh(self) -> f32
[src]
fn cosh(self) -> f32
[src]
fn tanh(self) -> f32
[src]
fn asin(self) -> f32
[src]
fn acos(self) -> f32
[src]
fn atan(self) -> f32
[src]
fn asinh(self) -> f32
[src]
fn acosh(self) -> f32
[src]
fn atanh(self) -> f32
[src]
impl Scalar for f64
[src]
type Real = f64
type Complex = Complex<f64>
fn re(&self) -> <f64 as Scalar>::Real
[src]
fn im(&self) -> <f64 as Scalar>::Real
[src]
fn from_real(re: <f64 as Scalar>::Real) -> f64
[src]
fn pow(self, n: f64) -> f64
[src]
fn powi(self, n: i32) -> f64
[src]
fn powf(self, n: <f64 as Scalar>::Real) -> f64
[src]
fn powc(self, n: <f64 as Scalar>::Complex) -> <f64 as Scalar>::Complex
[src]
fn real<T>(re: T) -> <f64 as Scalar>::Real where
T: ToPrimitive,
[src]
T: ToPrimitive,
fn complex<T>(re: T, im: T) -> <f64 as Scalar>::Complex where
T: ToPrimitive,
[src]
T: ToPrimitive,
fn as_c(&self) -> <f64 as Scalar>::Complex
[src]
fn conj(&self) -> f64
[src]
fn square(self) -> <f64 as Scalar>::Real
[src]
fn rand(rng: &mut impl Rng) -> f64
[src]
fn add_real(self, re: <f64 as Scalar>::Real) -> f64
[src]
fn sub_real(self, re: <f64 as Scalar>::Real) -> f64
[src]
fn mul_real(self, re: <f64 as Scalar>::Real) -> f64
[src]
fn div_real(self, re: <f64 as Scalar>::Real) -> f64
[src]
fn add_complex(self, im: <f64 as Scalar>::Complex) -> <f64 as Scalar>::Complex
[src]
fn sub_complex(self, im: <f64 as Scalar>::Complex) -> <f64 as Scalar>::Complex
[src]
fn mul_complex(self, im: <f64 as Scalar>::Complex) -> <f64 as Scalar>::Complex
[src]
fn div_complex(self, im: <f64 as Scalar>::Complex) -> <f64 as Scalar>::Complex
[src]
fn sqrt(self) -> f64
[src]
fn abs(self) -> f64
[src]
fn exp(self) -> f64
[src]
fn ln(self) -> f64
[src]
fn sin(self) -> f64
[src]
fn cos(self) -> f64
[src]
fn tan(self) -> f64
[src]
fn sinh(self) -> f64
[src]
fn cosh(self) -> f64
[src]
fn tanh(self) -> f64
[src]
fn asin(self) -> f64
[src]
fn acos(self) -> f64
[src]
fn atan(self) -> f64
[src]
fn asinh(self) -> f64
[src]
fn acosh(self) -> f64
[src]
fn atanh(self) -> f64
[src]
impl Scalar for Complex<f32>
[src]
type Real = f32
type Complex = Complex<f32>
fn re(&self) -> <Complex<f32> as Scalar>::Real
[src]
fn im(&self) -> <Complex<f32> as Scalar>::Real
[src]
fn from_real(re: <Complex<f32> as Scalar>::Real) -> Complex<f32>
[src]
fn pow(self, n: Complex<f32>) -> Complex<f32>
[src]
fn powi(self, n: i32) -> Complex<f32>
[src]
fn powf(self, n: <Complex<f32> as Scalar>::Real) -> Complex<f32>
[src]
fn powc(
self,
n: <Complex<f32> as Scalar>::Complex
) -> <Complex<f32> as Scalar>::Complex
[src]
self,
n: <Complex<f32> as Scalar>::Complex
) -> <Complex<f32> as Scalar>::Complex
fn real<T>(re: T) -> <Complex<f32> as Scalar>::Real where
T: ToPrimitive,
[src]
T: ToPrimitive,
fn complex<T>(re: T, im: T) -> <Complex<f32> as Scalar>::Complex where
T: ToPrimitive,
[src]
T: ToPrimitive,
fn as_c(&self) -> <Complex<f32> as Scalar>::Complex
[src]
fn conj(&self) -> Complex<f32>
[src]
fn square(self) -> <Complex<f32> as Scalar>::Real
[src]
fn abs(self) -> <Complex<f32> as Scalar>::Real
[src]
fn rand(rng: &mut impl Rng) -> Complex<f32>
[src]
fn add_real(self, re: <Complex<f32> as Scalar>::Real) -> Complex<f32>
[src]
fn sub_real(self, re: <Complex<f32> as Scalar>::Real) -> Complex<f32>
[src]
fn mul_real(self, re: <Complex<f32> as Scalar>::Real) -> Complex<f32>
[src]
fn div_real(self, re: <Complex<f32> as Scalar>::Real) -> Complex<f32>
[src]
fn add_complex(
self,
im: <Complex<f32> as Scalar>::Complex
) -> <Complex<f32> as Scalar>::Complex
[src]
self,
im: <Complex<f32> as Scalar>::Complex
) -> <Complex<f32> as Scalar>::Complex
fn sub_complex(
self,
im: <Complex<f32> as Scalar>::Complex
) -> <Complex<f32> as Scalar>::Complex
[src]
self,
im: <Complex<f32> as Scalar>::Complex
) -> <Complex<f32> as Scalar>::Complex
fn mul_complex(
self,
im: <Complex<f32> as Scalar>::Complex
) -> <Complex<f32> as Scalar>::Complex
[src]
self,
im: <Complex<f32> as Scalar>::Complex
) -> <Complex<f32> as Scalar>::Complex
fn div_complex(
self,
im: <Complex<f32> as Scalar>::Complex
) -> <Complex<f32> as Scalar>::Complex
[src]
self,
im: <Complex<f32> as Scalar>::Complex
) -> <Complex<f32> as Scalar>::Complex