[−][src]Struct rdcl_aoc_helpers::math::polynomial::Polynomial
A polynomial.
Implementations
impl Polynomial
[src]
pub fn new(coefficients: &[i64]) -> Polynomial
[src]
The coefficients of the polynomial. The left-most coefficient corresponds with x^n. The right-most with x^0.
pub fn degree(&self) -> usize
[src]
The degree of a polynomial. I.e. the highest n such that the coefficient for x^n is not zero.
pub fn find_roots(&self) -> Vec<i64>
[src]
Find integer values x, such that the polynomial evaluates to 0 for x. These values are sorted from smallest to largest.
pub fn at(&self, x: i64) -> i64
[src]
Evaluate the polynomial for x.
Trait Implementations
impl Add<Polynomial> for Polynomial
[src]
type Output = Polynomial
The resulting type after applying the +
operator.
pub fn add(self, rhs: Polynomial) -> Self::Output
[src]
impl Clone for Polynomial
[src]
pub fn clone(&self) -> Polynomial
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Polynomial
[src]
impl Display for Polynomial
[src]
impl Eq for Polynomial
[src]
impl Neg for Polynomial
[src]
type Output = Polynomial
The resulting type after applying the -
operator.
pub fn neg(self) -> Self::Output
[src]
impl PartialEq<Polynomial> for Polynomial
[src]
pub fn eq(&self, other: &Polynomial) -> bool
[src]
pub fn ne(&self, other: &Polynomial) -> bool
[src]
impl StructuralEq for Polynomial
[src]
impl StructuralPartialEq for Polynomial
[src]
impl Sub<Polynomial> for Polynomial
[src]
type Output = Polynomial
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Polynomial) -> Self::Output
[src]
Auto Trait Implementations
impl RefUnwindSafe for Polynomial
[src]
impl Send for Polynomial
[src]
impl Sync for Polynomial
[src]
impl Unpin for Polynomial
[src]
impl UnwindSafe for Polynomial
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,