pub struct Polynomial { /* private fields */ }Implementations§
Source§impl Polynomial
impl Polynomial
Sourcepub const fn new(coefficients: LinkedList<f32>) -> Polynomial
pub const fn new(coefficients: LinkedList<f32>) -> Polynomial
Create a new polynomial.
Sourcepub fn simplify(&mut self)
pub fn simplify(&mut self)
Remove the leading zeros of the polynomial, both from the right and the left. For example: 0 + 0 x¹ + 1 x² + 0 x³ becomes 1.
Sourcepub fn get_value_at(&self, x: f32) -> f32
pub fn get_value_at(&self, x: f32) -> f32
Evaluate p(x).
pub fn len(&self) -> usize
pub fn iter(&self) -> Iter<'_, f32>
pub fn first(&self) -> Option<&f32>
pub fn last(&self) -> Option<&f32>
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