pub struct Polynomial {
pub coeffs: Vec<f64>,
}Fields§
§coeffs: Vec<f64>Implementations§
Source§impl Polynomial
impl Polynomial
pub fn new(coeffs: Vec<f64>) -> Self
pub fn zero() -> Self
pub fn one() -> Self
pub fn monomial(degree: usize, coeff: f64) -> Self
pub fn degree(&self) -> usize
pub fn eval(&self, x: f64) -> f64
pub fn derivative(&self) -> Self
pub fn integral(&self, constant: f64) -> Self
pub fn definite_integral(&self, a: f64, b: f64) -> f64
pub fn scale(&self, s: f64) -> Self
pub fn compose(&self, other: &Self) -> Self
pub fn div_rem(&self, divisor: &Self) -> (Self, Self)
pub fn gcd(&self, other: &Self) -> Self
pub fn from_roots(roots: &[f64]) -> Self
Trait Implementations§
Source§impl Add for Polynomial
impl Add for Polynomial
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
Source§impl Display for Polynomial
impl Display for Polynomial
Source§impl Div for Polynomial
impl Div for Polynomial
Source§impl Mul for Polynomial
impl Mul for Polynomial
Source§impl Neg for Polynomial
impl Neg 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