Trait rustnomial::MutablePolynomial [−][src]
pub trait MutablePolynomial<N> { 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
fn try_add_term(&mut self, coeff: N, degree: usize) -> Result<(), TryAddError>
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.
fn try_sub_term(&mut self, coeff: N, degree: usize) -> Result<(), TryAddError>
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
impl<N> MutablePolynomial<N> for LinearBinomial<N> where
N: Zero + SubAssign + AddAssign + Copy,
impl<N> MutablePolynomial<N> for Polynomial<N> where
N: Zero + Copy + AddAssign + SubAssign + CanNegate,
impl<N> MutablePolynomial<N> for QuadraticTrinomial<N> where
N: Zero + SubAssign + AddAssign + Copy,
impl<N> MutablePolynomial<N> for SparsePolynomial<N> where
N: Zero + Copy + AddAssign + SubAssign + CanNegate,