pub struct Polynomial { /* private fields */ }Expand description
Multivariate polynomial
Implementations§
Source§impl Polynomial
impl Polynomial
Sourcepub fn from_terms(term_list: Vec<Term>) -> Self
pub fn from_terms(term_list: Vec<Term>) -> Self
Create from terms
Sourcepub fn num_variables(&self) -> usize
pub fn num_variables(&self) -> usize
Number of variables (max variable index + 1)
Sourcepub fn add(&self, other: &Polynomial) -> Polynomial
pub fn add(&self, other: &Polynomial) -> Polynomial
Add two polynomials
Sourcepub fn sub(&self, other: &Polynomial) -> Polynomial
pub fn sub(&self, other: &Polynomial) -> Polynomial
Subtract polynomials
Sourcepub fn neg(&self) -> Polynomial
pub fn neg(&self) -> Polynomial
Negate polynomial
Sourcepub fn scale(&self, s: f64) -> Polynomial
pub fn scale(&self, s: f64) -> Polynomial
Multiply by scalar
Sourcepub fn mul(&self, other: &Polynomial) -> Polynomial
pub fn mul(&self, other: &Polynomial) -> Polynomial
Multiply two polynomials
Sourcepub fn square(&self) -> Polynomial
pub fn square(&self) -> Polynomial
Square polynomial
Sourcepub fn pow(&self, n: usize) -> Polynomial
pub fn pow(&self, n: usize) -> Polynomial
Power
Trait Implementations§
Source§impl Clone for Polynomial
impl Clone for Polynomial
Source§fn clone(&self) -> Polynomial
fn clone(&self) -> Polynomial
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Polynomial
impl Debug for Polynomial
Auto Trait Implementations§
impl Freeze for Polynomial
impl RefUnwindSafe for Polynomial
impl Send for Polynomial
impl Sync for Polynomial
impl Unpin for Polynomial
impl UnwindSafe for Polynomial
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more