pub trait LinalgScalar:
Clone
+ Debug
+ Default
+ PartialEq
+ NumAssign
+ Sum
+ for<'a> Sum<&'a Self>
+ ScalarOperand
+ 'static {
type Real: Float + NumAssign + Sum + Debug + Default + 'static;
// Required methods
fn to_f64(&self) -> Result<f64, LinalgError>;
fn from_f64(v: f64) -> Result<Self, LinalgError>;
fn abs(&self) -> Self::Real;
fn is_zero(&self) -> bool;
fn zero() -> Self;
fn one() -> Self;
fn sqrt(&self) -> Self;
fn conj(&self) -> Self;
fn real(&self) -> Self::Real;
fn epsilon() -> Self::Real;
}
Expand description
A trait that unifies numeric types suitable for linear algebra operations
Required Associated Types§
Required Methods§
Sourcefn to_f64(&self) -> Result<f64, LinalgError>
fn to_f64(&self) -> Result<f64, LinalgError>
Convert to f64 for certain calculations
Sourcefn from_f64(v: f64) -> Result<Self, LinalgError>
fn from_f64(v: f64) -> Result<Self, LinalgError>
Create from f64
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.