Skip to main content

Coefficient

Trait Coefficient 

Source
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§

Source

fn zero() -> Self

Source

fn one() -> Self

Source

fn of_rational(r: Rational) -> Self

Source

fn add(&self, o: &Self) -> Result<Self, ExpansionError>

Source

fn sub(&self, o: &Self) -> Result<Self, ExpansionError>

Source

fn neg(&self) -> Result<Self, ExpansionError>

Source

fn mul(&self, o: &Self) -> Result<Self, ExpansionError>

Source

fn is_zero(&self) -> Result<bool, ExpansionError>

Whether the coefficient is zero; refused when that cannot be told.

Source

fn recip(&self) -> Result<Self, ExpansionError>

Source

fn sign(&self) -> Result<i32, ExpansionError>

−1, 0 or 1; refused when the sign cannot be told.

Source

fn nth_root(&self, n: u32) -> Result<Self, ExpansionError>

The real n-th root, the nonnegative one for an even n.

Source

fn exp(&self) -> Result<Self, ExpansionError>

exp, for an expansion’s exponential.

Source

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§

Source§

impl Coefficient for Multi

A value of several infinitesimals is the coefficient of an expansion in a smaller one, exactly.

Source§

impl Coefficient for Number