pub struct Polynomial {
pub coeffs: Vec<BigRational>,
}Expand description
A univariate polynomial over Q.
Fields§
§coeffs: Vec<BigRational>Coefficients in increasing degree order: a_0 + a_1x + a_2x^2 + …
Implementations§
Source§impl Polynomial
impl Polynomial
Sourcepub fn new(coeffs: Vec<BigRational>) -> Self
pub fn new(coeffs: Vec<BigRational>) -> Self
Create a polynomial from coefficients.
Sourcepub fn eval(&self, x: &BigRational) -> BigRational
pub fn eval(&self, x: &BigRational) -> BigRational
Evaluate the polynomial at a point.
Sourcepub fn derivative(&self) -> Polynomial
pub fn derivative(&self) -> Polynomial
Compute the derivative.
Sourcepub fn remainder(&self, other: &Polynomial) -> Polynomial
pub fn remainder(&self, other: &Polynomial) -> Polynomial
Compute polynomial remainder: self mod other.
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 (const: unstable) · 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
impl Eq for Polynomial
Source§impl PartialEq for Polynomial
impl PartialEq for Polynomial
impl StructuralPartialEq 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 UnsafeUnpin 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