pub trait Coefficient:
Clone
+ Debug
+ Send
+ Sync
+ 'static {
Show 13 methods
// Required methods
fn zero() -> Self;
fn one() -> Self;
fn of_rational(r: Rational) -> Self;
fn add(&self, o: &Self) -> Result<Self, ExpansionError>;
fn sub(&self, o: &Self) -> Result<Self, ExpansionError>;
fn neg(&self) -> Result<Self, ExpansionError>;
fn mul(&self, o: &Self) -> Result<Self, ExpansionError>;
fn is_zero(&self) -> Result<bool, ExpansionError>;
fn recip(&self) -> Result<Self, ExpansionError>;
fn sign(&self) -> Result<i32, ExpansionError>;
fn nth_root(&self, n: u32) -> Result<Self, ExpansionError>;
fn exp(&self) -> Result<Self, ExpansionError>;
fn ln(&self) -> Result<Self, ExpansionError>;
}Expand description
The values an expansion’s coefficients are: a field with the operations the recurrences ask for, each refused in the coefficient’s own words when it cannot be done.
Required Methods§
fn zero() -> Self
fn one() -> Self
fn of_rational(r: Rational) -> Self
fn add(&self, o: &Self) -> Result<Self, ExpansionError>
fn sub(&self, o: &Self) -> Result<Self, ExpansionError>
fn neg(&self) -> Result<Self, ExpansionError>
fn mul(&self, o: &Self) -> Result<Self, ExpansionError>
Sourcefn is_zero(&self) -> Result<bool, ExpansionError>
fn is_zero(&self) -> Result<bool, ExpansionError>
Whether the coefficient is zero; refused when that cannot be told.
fn recip(&self) -> Result<Self, ExpansionError>
Sourcefn sign(&self) -> Result<i32, ExpansionError>
fn sign(&self) -> Result<i32, ExpansionError>
−1, 0 or 1; refused when the sign cannot be told.
Sourcefn nth_root(&self, n: u32) -> Result<Self, ExpansionError>
fn nth_root(&self, n: u32) -> Result<Self, ExpansionError>
The real n-th root, the nonnegative one for an even n.
Sourcefn exp(&self) -> Result<Self, ExpansionError>
fn exp(&self) -> Result<Self, ExpansionError>
exp, for an expansion’s exponential.
Sourcefn ln(&self) -> Result<Self, ExpansionError>
fn ln(&self) -> Result<Self, ExpansionError>
The natural logarithm of a positive coefficient, for an expansion’s logarithm.
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.
Implementors§
impl Coefficient for Multi
A value of several infinitesimals is the coefficient of an expansion in a smaller one, exactly.