Polynomial

Struct Polynomial 

Source
pub struct Polynomial<N> {
    pub terms: Vec<N>,
}
Expand description

A type that stores terms of a polynomial in a Vec.

Fields§

§terms: Vec<N>

Implementations§

Source§

impl<N> Polynomial<N>
where N: Zero + Copy,

Source

pub fn new(terms: Vec<N>) -> Polynomial<N>

Returns a Polynomial with the corresponding terms, in order of ax^n + bx^(n-1) + … + cx + d

§Arguments
  • terms - A vector of constants, in decreasing order of degree.
§Example
use rustnomial::Polynomial;
// Corresponds to 1.0x^2 + 4.0x + 4.0
let polynomial = Polynomial::new(vec![1.0, 4.0, 4.0]);
Source

pub fn trim(&mut self)

Reduces the size of the Polynomial in memory if the leading terms are zero.

§Example
use rustnomial::Polynomial;
let mut polynomial = Polynomial::new(vec![1.0, 4.0, 4.0]);
polynomial.terms = vec![0.0, 0.0, 0.0, 0.0, 1.0, 4.0, 4.0];
polynomial.trim();
assert_eq!(vec![1.0, 4.0, 4.0], polynomial.terms);
Source

pub fn ordered_term_iter(&self) -> impl Iterator<Item = (N, usize)> + '_

Source§

impl Polynomial<f64>

Source

pub fn roots(self) -> Roots<f64>

Return the roots of the Polynomial.

§Example
use rustnomial::{Polynomial, Roots, SizedPolynomial};
let zero = Polynomial::<f64>::zero();
assert_eq!(Roots::InfiniteRoots, zero.roots());
let constant = Polynomial::new(vec![1.]);
assert_eq!(Roots::NoRoots, constant.roots());
let monomial = Polynomial::new(vec![1.0, 0.,]);
assert_eq!(Roots::ManyRealRoots(vec![0.]), monomial.roots());
let binomial = Polynomial::new(vec![1.0, 2.0]);
assert_eq!(Roots::ManyRealRoots(vec![-2.0]), binomial.roots());
let trinomial = Polynomial::new(vec![1.0, 4.0, 4.0]);
assert_eq!(Roots::ManyRealRoots(vec![-2.0, -2.0]), trinomial.roots());
let quadnomial = Polynomial::new(vec![1.0, 6.0, 12.0, 8.0]);
assert_eq!(Roots::ManyRealRoots(vec![-2.0, -2.0, -2.0]), quadnomial.roots());
Source§

impl<N> Polynomial<N>
where N: Mul<Output = N> + AddAssign + Copy + Zero + One,

Source

pub fn pow(&self, exp: usize) -> Polynomial<N>

Raises the Polynomial to the power of exp, using exponentiation by squaring.

§Example
use rustnomial::Polynomial;
let polynomial = Polynomial::new(vec![1.0, 2.0]);
let polynomial_sqr = polynomial.pow(2);
let polynomial_cub = polynomial.pow(3);
assert_eq!(polynomial.clone() * polynomial.clone(), polynomial_sqr);
assert_eq!(polynomial_sqr.clone() * polynomial.clone(), polynomial_cub);
Source§

impl<N> Polynomial<N>
where N: Copy + Zero + SubAssign + Mul<Output = N> + Div<Output = N>,

Source

pub fn div_mod(&self, rhs: &Polynomial<N>) -> (Polynomial<N>, Polynomial<N>)

Divides self by the given Polynomial, and returns the quotient and remainder.

Source§

impl<N> Polynomial<N>
where N: Copy + Zero + SubAssign + Mul<Output = N> + Div<Output = N>,

Source

pub fn floor_div(&self, rhs: &Polynomial<N>) -> Polynomial<N>

Divides self by the given Polynomial, and returns the quotient.

Trait Implementations§

Source§

impl<N> Add for Polynomial<N>
where N: Zero + Copy + AddAssign,

Source§

type Output = Polynomial<N>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Polynomial<N>) -> Polynomial<N>

Performs the + operation. Read more
Source§

impl<N: Copy + Zero + AddAssign> AddAssign for Polynomial<N>

Source§

fn add_assign(&mut self, rhs: Polynomial<N>)

Performs the += operation. Read more
Source§

impl<N: Clone> Clone for Polynomial<N>

Source§

fn clone(&self) -> Polynomial<N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N: Debug> Debug for Polynomial<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<N> Derivable<N> for Polynomial<N>
where N: Zero + One + TryFromUsizeContinuous + Copy + MulAssign + SubAssign,

Source§

fn derivative(&self) -> Polynomial<N>

Returns the derivative of the Polynomial.

§Example
use rustnomial::{Polynomial, Derivable};
let polynomial = Polynomial::new(vec![4, 1, 5]);
assert_eq!(Polynomial::new(vec![8, 1]), polynomial.derivative());
§Errors

Will panic if N can not losslessly encode the numbers from 0 to the degree of self.

Source§

impl<N> Display for Polynomial<N>
where N: Zero + One + IsPositive + PartialEq + Abs + Copy + IsNegativeOne + Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<N> Div<N> for Polynomial<N>
where N: Zero + Copy + Div<Output = N>,

Source§

type Output = Polynomial<N>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: N) -> Polynomial<N>

Performs the / operation. Read more
Source§

impl<N: Copy + DivAssign> DivAssign<N> for Polynomial<N>

Source§

fn div_assign(&mut self, rhs: N)

Performs the /= operation. Read more
Source§

impl<N> Evaluable<N> for Polynomial<N>
where N: Zero + Copy + AddAssign + MulAssign + Mul<Output = N>,

Source§

fn eval(&self, point: N) -> N

Returns the value of the Polynomial at the given point.

§Example
use rustnomial::{Polynomial, Evaluable};
let a = Polynomial::new(vec![1, 2, 3, 4]);
assert_eq!(10, a.eval(1));
assert_eq!(1234, a.eval(10));
Source§

impl<N> FreeSizePolynomial<N> for Polynomial<N>
where N: Zero + Copy + AddAssign,

Source§

fn from_terms(terms: &[(N, usize)]) -> Self

Returns a Polynomial with the corresponding terms, in order of ax^n + bx^(n-1) + … + cx + d

§Arguments
  • terms - A slice of (coefficient, degree) pairs.
§Example
use rustnomial::{FreeSizePolynomial, Polynomial};
// Corresponds to 1.0x^2 + 4.0x + 4.0
let polynomial = Polynomial::from_terms(&[(1.0, 2), (4.0, 1), (4.0, 0)]);
assert_eq!(Polynomial::new(vec![1., 4., 4.]), polynomial);
Source§

fn add_term(&mut self, coeff: N, degree: usize)

Adds the term with given coefficient coeff and degree degree to self.
Source§

impl From<Polynomial<f32>> for Polynomial<f64>

Source§

fn from(item: Polynomial<f32>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i16>> for Polynomial<f32>

Source§

fn from(item: Polynomial<i16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i16>> for Polynomial<f64>

Source§

fn from(item: Polynomial<i16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i16>> for Polynomial<i128>

Source§

fn from(item: Polynomial<i16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i16>> for Polynomial<i32>

Source§

fn from(item: Polynomial<i16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i16>> for Polynomial<i64>

Source§

fn from(item: Polynomial<i16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i32>> for Polynomial<f64>

Source§

fn from(item: Polynomial<i32>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i32>> for Polynomial<i128>

Source§

fn from(item: Polynomial<i32>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i32>> for Polynomial<i64>

Source§

fn from(item: Polynomial<i32>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i64>> for Polynomial<i128>

Source§

fn from(item: Polynomial<i64>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i8>> for Polynomial<f32>

Source§

fn from(item: Polynomial<i8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i8>> for Polynomial<f64>

Source§

fn from(item: Polynomial<i8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i8>> for Polynomial<i128>

Source§

fn from(item: Polynomial<i8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i8>> for Polynomial<i16>

Source§

fn from(item: Polynomial<i8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i8>> for Polynomial<i32>

Source§

fn from(item: Polynomial<i8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<i8>> for Polynomial<i64>

Source§

fn from(item: Polynomial<i8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u16>> for Polynomial<f32>

Source§

fn from(item: Polynomial<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u16>> for Polynomial<f64>

Source§

fn from(item: Polynomial<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u16>> for Polynomial<i128>

Source§

fn from(item: Polynomial<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u16>> for Polynomial<i32>

Source§

fn from(item: Polynomial<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u16>> for Polynomial<i64>

Source§

fn from(item: Polynomial<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u16>> for Polynomial<u128>

Source§

fn from(item: Polynomial<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u16>> for Polynomial<u32>

Source§

fn from(item: Polynomial<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u16>> for Polynomial<u64>

Source§

fn from(item: Polynomial<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u32>> for Polynomial<f64>

Source§

fn from(item: Polynomial<u32>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u32>> for Polynomial<i128>

Source§

fn from(item: Polynomial<u32>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u32>> for Polynomial<i64>

Source§

fn from(item: Polynomial<u32>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u32>> for Polynomial<u128>

Source§

fn from(item: Polynomial<u32>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u32>> for Polynomial<u64>

Source§

fn from(item: Polynomial<u32>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u64>> for Polynomial<i128>

Source§

fn from(item: Polynomial<u64>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u64>> for Polynomial<u128>

Source§

fn from(item: Polynomial<u64>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u8>> for Polynomial<f32>

Source§

fn from(item: Polynomial<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u8>> for Polynomial<f64>

Source§

fn from(item: Polynomial<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u8>> for Polynomial<i128>

Source§

fn from(item: Polynomial<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u8>> for Polynomial<i16>

Source§

fn from(item: Polynomial<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u8>> for Polynomial<i32>

Source§

fn from(item: Polynomial<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u8>> for Polynomial<i64>

Source§

fn from(item: Polynomial<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u8>> for Polynomial<u128>

Source§

fn from(item: Polynomial<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u8>> for Polynomial<u16>

Source§

fn from(item: Polynomial<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u8>> for Polynomial<u32>

Source§

fn from(item: Polynomial<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<Polynomial<u8>> for Polynomial<u64>

Source§

fn from(item: Polynomial<u8>) -> Self

Converts to this type from the input type.
Source§

impl<N> From<Vec<N>> for Polynomial<N>
where N: Copy + Zero,

Source§

fn from(term_vec: Vec<N>) -> Self

Returns a SparsePolynomial with the corresponding terms, in order of ax^n + bx^(n-1) + … + cx + d

§Arguments
  • term_vec - A vector of constants, in decreasing order of degree.
§Example
use rustnomial::{Polynomial};
// Corresponds to 1.0x^2 + 4.0x + 4.0
let polynomial = Polynomial::from(vec![1.0, 4.0, 4.0]);
let polynomial: Polynomial<f64> = vec![1.0, 4.0, 4.0].into();
Source§

impl<N> FromStr for Polynomial<N>
where N: Zero + One + Copy + SubAssign + AddAssign + FromStr + CanNegate,

Source§

type Err = PolynomialFromStringError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl<N> Integrable<N, Polynomial<N>> for LinearBinomial<N>
where N: Zero + Copy + DivAssign + Mul<Output = N> + MulAssign + AddAssign + Div<Output = N> + TryFromUsizeContinuous,

Source§

fn integral(&self) -> Integral<N, Polynomial<N>>

Returns the integral of the LinearBinomial.

§Example
use rustnomial::{LinearBinomial, Integrable, Polynomial};
let binomial = LinearBinomial::new([2.0, 0.]);
let integral = binomial.integral();
assert_eq!(&Polynomial::new(vec![1.0, 0.0, 0.0]), integral.inner());

Will panic if N can not losslessly represent 2usize.

Source§

impl<N> Integrable<N, Polynomial<N>> for Polynomial<N>
where N: Zero + One + Copy + DivAssign + Mul<Output = N> + MulAssign + AddAssign + TryFromUsizeContinuous + SubAssign,

Source§

fn integral(&self) -> Integral<N, Polynomial<N>>

Returns the integral of the Polynomial.

§Example
use rustnomial::{Polynomial, Integrable};
let polynomial = Polynomial::new(vec![1.0, 2.0, 5.0]);
let integral = polynomial.integral();
assert_eq!(&Polynomial::new(vec![1.0/3.0, 1.0, 5.0, 0.0]), integral.inner());
§Errors

Will panic if N can not losslessly encode the numbers from 0 to the degree of self self.

Source§

impl<N> Integrable<N, Polynomial<N>> for QuadraticTrinomial<N>
where N: Zero + TryFromUsizeExact + Copy + DivAssign + Mul<Output = N> + MulAssign + AddAssign + Div<Output = N>,

Source§

fn integral(&self) -> Integral<N, Polynomial<N>>

Returns the integral of the Monomial.

§Example
use rustnomial::{QuadraticTrinomial, Integrable, Polynomial};
let trinomial = QuadraticTrinomial::new([3.0, 0., 0.]);
let integral = trinomial.integral();
assert_eq!(&Polynomial::new(vec![1.0, 0.0, 0.0, 0.0]), integral.inner());
§Errors

Will panic if N can not losslessly represent 2usize or 3usize.

Source§

impl<N> Mul<&Polynomial<N>> for &Polynomial<N>
where N: Mul<Output = N> + AddAssign + Copy + Zero,

Source§

type Output = Polynomial<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Polynomial<N>) -> Polynomial<N>

Performs the * operation. Read more
Source§

impl<N> Mul<&Polynomial<N>> for Polynomial<N>
where N: Mul<Output = N> + AddAssign + Copy + Zero,

Source§

type Output = Polynomial<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Polynomial<N>) -> Polynomial<N>

Performs the * operation. Read more
Source§

impl<N: Zero + Copy + Mul<Output = N>> Mul<N> for Polynomial<N>

Source§

type Output = Polynomial<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: N) -> Polynomial<N>

Performs the * operation. Read more
Source§

impl<N> Mul<Polynomial<N>> for &Polynomial<N>
where N: Mul<Output = N> + AddAssign + Copy + Zero,

Source§

type Output = Polynomial<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Polynomial<N>) -> Polynomial<N>

Performs the * operation. Read more
Source§

impl<N> Mul for Polynomial<N>
where N: Mul<Output = N> + AddAssign + Copy + Zero,

Source§

type Output = Polynomial<N>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Polynomial<N>) -> Polynomial<N>

Performs the * operation. Read more
Source§

impl<N> MulAssign<&Polynomial<N>> for Polynomial<N>
where N: Mul<Output = N> + AddAssign + Copy + Zero,

Source§

fn mul_assign(&mut self, rhs: &Polynomial<N>)

Performs the *= operation. Read more
Source§

impl<N: Copy + MulAssign> MulAssign<N> for Polynomial<N>

Source§

fn mul_assign(&mut self, rhs: N)

Performs the *= operation. Read more
Source§

impl<N> MulAssign for Polynomial<N>
where N: Mul<Output = N> + AddAssign + Copy + Zero,

Source§

fn mul_assign(&mut self, rhs: Polynomial<N>)

Performs the *= operation. Read more
Source§

impl<N> MutablePolynomial<N> for Polynomial<N>
where N: Zero + Copy + AddAssign + SubAssign + CanNegate,

Source§

fn try_add_term(&mut self, coeff: N, degree: usize) -> Result<(), TryAddError>

Tries to add the term with given coefficient and degree to self, returning an error if the particular term can not be added to self without violating constraints. Read more
Source§

fn try_sub_term(&mut self, coeff: N, degree: usize) -> Result<(), TryAddError>

Tries to subtract the term with given coefficient and degree from self, returning an error if the particular term can not be subtracted from self without violating constraints. Read more
Source§

impl<N> Neg for Polynomial<N>
where N: Zero + Copy + Neg<Output = N>,

Source§

type Output = Polynomial<N>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Polynomial<N>

Performs the unary - operation. Read more
Source§

impl<N> PartialEq for Polynomial<N>
where N: PartialEq + Zero + Copy,

Source§

fn eq(&self, other: &Self) -> bool

Returns true if self and other have the same terms.

§Example
use rustnomial::Polynomial;
let a = Polynomial::new(vec![1.0, 2.0]);
let b = Polynomial::new(vec![2.0, 2.0]);
let c = Polynomial::new(vec![1.0, 0.0]);
assert_ne!(a, b);
assert_ne!(a, c);
assert_eq!(a, b - c);
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<N> Rem for Polynomial<N>
where N: Copy + Zero + SubAssign + Mul<Output = N> + Div<Output = N>,

Source§

fn rem(self, rhs: Polynomial<N>) -> Polynomial<N>

Returns the remainder of dividing self by rhs.

Source§

type Output = Polynomial<N>

The resulting type after applying the % operator.
Source§

impl<N> RemAssign for Polynomial<N>
where N: Copy + Zero + SubAssign + Mul<Output = N> + Div<Output = N>,

Source§

fn rem_assign(&mut self, rhs: Polynomial<N>)

Assign the remainder of dividing self by rhs to self.

Source§

impl<N: Zero + Copy> Shl<i32> for Polynomial<N>

Source§

type Output = Polynomial<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: i32) -> Polynomial<N>

Performs the << operation. Read more
Source§

impl<N: Zero + Copy> ShlAssign<i32> for Polynomial<N>

Source§

fn shl_assign(&mut self, rhs: i32)

Performs the <<= operation. Read more
Source§

impl<N: Zero + Copy> Shr<i32> for Polynomial<N>

Source§

type Output = Polynomial<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: i32) -> Polynomial<N>

Performs the >> operation. Read more
Source§

impl<N: Zero + Copy> ShrAssign<i32> for Polynomial<N>

Source§

fn shr_assign(&mut self, rhs: i32)

Performs the >>= operation. Read more
Source§

impl<N: Copy + Zero> SizedPolynomial<N> for Polynomial<N>

Source§

fn degree(&self) -> Degree

Returns the degree of the Polynomial it is called on, corresponding to the largest non-zero term.

§Example
use rustnomial::{SizedPolynomial, Polynomial, Degree};
let polynomial = Polynomial::new(vec![1.0, 4.0, 4.0]);
assert_eq!(Degree::Num(2), polynomial.degree());
Source§

fn zero() -> Polynomial<N>

Returns a Polynomial with no terms.

§Example
use rustnomial::{SizedPolynomial, Polynomial};
let zero = Polynomial::<i32>::zero();
assert!(zero.is_zero());
assert!(zero.ordered_term_iter().next().is_none());
assert!(zero.terms.is_empty());
Source§

fn set_to_zero(&mut self)

Sets self to zero.

§Example
use rustnomial::{Polynomial, SizedPolynomial};
let mut non_zero = Polynomial::from(vec![0, 1]);
assert!(!non_zero.is_zero());
non_zero.set_to_zero();
assert!(non_zero.is_zero());
Source§

fn term_with_degree(&self, degree: usize) -> Term<N>

Returns the term with the given degree from self. If the term degree is larger than the actual degree, ZeroTerm will be returned. However, terms which are zero will also be returned as ZeroTerm, so this does not indicate that the final term has been reached.
Source§

fn terms_as_vec(&self) -> Vec<(N, usize)>

Returns a Vec containing all of the terms of self, where each item is the coefficient and degree of each non-zero term, in order of descending degree. Read more
Source§

fn is_zero(&self) -> bool

Returns true if all terms of self are zero, and false if a non-zero term exists. Read more
Source§

impl<N> Sub<&Polynomial<N>> for Polynomial<N>
where N: Zero + Copy + Sub<Output = N> + SubAssign + Neg<Output = N>,

Source§

type Output = Polynomial<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Polynomial<N>) -> Polynomial<N>

Performs the - operation. Read more
Source§

impl<N> Sub<Polynomial<N>> for SparsePolynomial<N>
where N: Zero + Copy + Sub<Output = N> + SubAssign + Neg<Output = N>,

Source§

type Output = SparsePolynomial<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Polynomial<N>) -> SparsePolynomial<N>

Performs the - operation. Read more
Source§

impl<N> Sub for Polynomial<N>
where N: Zero + Copy + Sub<Output = N> + SubAssign + Neg<Output = N>,

Source§

type Output = Polynomial<N>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Polynomial<N>) -> Polynomial<N>

Performs the - operation. Read more
Source§

impl<N> SubAssign<&Polynomial<N>> for Polynomial<N>
where N: Neg<Output = N> + Sub<Output = N> + SubAssign + Copy + Zero,

Source§

fn sub_assign(&mut self, rhs: &Polynomial<N>)

Performs the -= operation. Read more
Source§

impl<N> SubAssign for Polynomial<N>
where N: Neg<Output = N> + Sub<Output = N> + SubAssign + Copy + Zero,

Source§

fn sub_assign(&mut self, rhs: Polynomial<N>)

Performs the -= operation. Read more

Auto Trait Implementations§

§

impl<N> Freeze for Polynomial<N>

§

impl<N> RefUnwindSafe for Polynomial<N>
where N: RefUnwindSafe,

§

impl<N> Send for Polynomial<N>
where N: Send,

§

impl<N> Sync for Polynomial<N>
where N: Sync,

§

impl<N> Unpin for Polynomial<N>
where N: Unpin,

§

impl<N> UnwindSafe for Polynomial<N>
where N: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,