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§
Sourcefn 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.
Sourcefn 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.