MutablePolynomial

Trait MutablePolynomial 

Source
pub trait MutablePolynomial<N> {
    // Required methods
    fn try_add_term(
        &mut self,
        coeff: N,
        degree: usize,
    ) -> Result<(), TryAddError>;
    fn try_sub_term(
        &mut self,
        coeff: N,
        degree: usize,
    ) -> Result<(), TryAddError>;
}

Required Methods§

Source

fn try_add_term(&mut self, coeff: N, degree: usize) -> Result<(), TryAddError>

Tries to add the term with given coefficient and degree to self, returning an error if the particular term can not be added to self without violating constraints.

§Errors

Fails if the term with coefficient coeff and degree degree can not be added to self without violating one or more of self’s invariants.

Source

fn try_sub_term(&mut self, coeff: N, degree: usize) -> Result<(), TryAddError>

Tries to subtract the term with given coefficient and degree from self, returning an error if the particular term can not be subtracted from self without violating constraints.

§Errors

Fails if the term with coefficient coeff and degree degree can not be subtracted from self without violating one or more of self’s invariants.

Implementors§

Source§

impl<N> MutablePolynomial<N> for LinearBinomial<N>
where N: Zero + SubAssign + AddAssign + Copy,

Source§

impl<N> MutablePolynomial<N> for Monomial<N>
where N: SubAssign + AddAssign + Copy + Zero,

Source§

impl<N> MutablePolynomial<N> for Polynomial<N>
where N: Zero + Copy + AddAssign + SubAssign + CanNegate,

Source§

impl<N> MutablePolynomial<N> for QuadraticTrinomial<N>
where N: Zero + SubAssign + AddAssign + Copy,

Source§

impl<N> MutablePolynomial<N> for SparsePolynomial<N>
where N: Zero + Copy + AddAssign + SubAssign + CanNegate,