[−][src]Struct automatica::polynomial::Poly
Polynomial object
Contains the vector of coefficients form the lowest to the highest degree
p(x) = c0 + c1*x + c2*x^2 + ...
Implementations
impl<T: Float + FloatConst> Poly<T>
[src]
impl<T: Clone + Div<Output = T>> Poly<T>
[src]
impl<T> Poly<T>
[src]
Implementation methods for Poly struct
#[must_use]pub fn as_slice(&self) -> &[T]
[src]
Return the coefficients of the polynomial as a slice
Example
use automatica::polynomial::Poly; let c = &[1., 2., 3.]; let p = Poly::new_from_coeffs(c); assert_eq!(c, p.as_slice());
impl<T: Clone + PartialEq + Zero> Poly<T>
[src]
pub fn new_from_coeffs(coeffs: &[T]) -> Self
[src]
Create a new polynomial given a slice of real coefficients. It trims any leading zeros in the high order coefficients.
Arguments
coeffs
- slice of coefficients
Example
use automatica::polynomial::Poly; let p = Poly::new_from_coeffs(&[1., 2., 3.]);
pub fn new_from_coeffs_iter<II>(coeffs: II) -> Self where
II: IntoIterator<Item = T>,
[src]
II: IntoIterator<Item = T>,
Create a new polynomial given a iterator of real coefficients. It trims any leading zeros in the high order coefficients.
Arguments
coeffs
- iterator of coefficients
Example
use automatica::polynomial::Poly; let p = Poly::new_from_coeffs_iter(1..4);
#[must_use]pub fn degree(&self) -> Option<usize>
[src]
Degree of the polynomial
Example
use automatica::polynomial::Poly; let p = Poly::new_from_coeffs(&[1., 2., 3.]); assert_eq!(Some(2), p.degree());
pub fn extend(&mut self, degree: usize)
[src]
Extend the polynomial coefficients with 0 to the given degree in place. It does not truncate the polynomial.
Arguments
degree
- Degree of the new highest coefficient.
Example
use automatica::polynomial::Poly; let mut p = Poly::new_from_coeffs(&[1, 2, 3]); p.extend(5); assert_eq!(vec![1, 2, 3, 0, 0, 0], p.coeffs());
impl<T: Clone + Div<Output = T> + One> Poly<T>
[src]
#[must_use]pub fn monic(&self) -> (Self, T)
[src]
Return the monic polynomial and the leading coefficient.
Example
use automatica::polynomial::Poly; let p = Poly::new_from_coeffs(&[1., 2., 10.]); let (p2, c) = p.monic(); assert_eq!(Poly::new_from_coeffs(&[0.1, 0.2, 1.]), p2); assert_eq!(10., c);
pub fn monic_mut(&mut self) -> T
[src]
Return the monic polynomial and the leading coefficient, it mutates the polynomial in place.
Example
use automatica::polynomial::Poly; let mut p = Poly::new_from_coeffs(&[1., 2., 10.]); let c = p.monic_mut(); assert_eq!(Poly::new_from_coeffs(&[0.1, 0.2, 1.]), p); assert_eq!(10., c);
impl<T: Clone + One> Poly<T>
[src]
Implementation methods for Poly struct
#[must_use]pub fn leading_coeff(&self) -> T
[src]
Return the leading coefficient of the polynomial.
Example
use automatica::polynomial::Poly; let p = Poly::new_from_coeffs(&[1., 2., 10.]); let c = p.leading_coeff(); assert_eq!(10., c);
impl<T: Clone + Mul<Output = T> + Neg<Output = T> + One + PartialEq + Zero> Poly<T>
[src]
Implementation methods for Poly struct
pub fn new_from_roots(roots: &[T]) -> Self
[src]
Create a new polynomial given a slice of real roots It trims any leading zeros in the high order coefficients.
Arguments
roots
- slice of roots
Example
use automatica::polynomial::Poly; let p = Poly::new_from_roots(&[1., 2., 3.]);
pub fn new_from_roots_iter<II>(roots: II) -> Self where
II: IntoIterator<Item = T>,
[src]
II: IntoIterator<Item = T>,
impl<T: ComplexField + Float + RealField> Poly<T>
[src]
Implementation methods for Poly struct
#[must_use]pub fn real_roots(&self) -> Option<Vec<T>>
[src]
Calculate the real roots of the polynomial using companion matrix eigenvalues decomposition.
Example
use automatica::polynomial::Poly; let roots = &[-1., 1., 0.]; let p = Poly::new_from_roots(roots); assert_eq!(roots, p.real_roots().unwrap().as_slice());
#[must_use]pub fn complex_roots(&self) -> Vec<Complex<T>>
[src]
Calculate the complex roots of the polynomial using companion matrix eigenvalues decomposition.
Example
use automatica::polynomial::Poly; let p = Poly::new_from_coeffs(&[1., 0., 1.]); let i = num_complex::Complex::i(); assert_eq!(vec![-i, i], p.complex_roots());
impl<T: Float + FloatConst> Poly<T>
[src]
#[must_use]pub fn iterative_roots(&self) -> Vec<Complex<T>>
[src]
Calculate the complex roots of the polynomial using Aberth-Ehrlich method.
Example
use automatica::polynomial::Poly; let p = Poly::new_from_coeffs(&[1., 0., 1.]); let i = num_complex::Complex::i(); assert_eq!(vec![-i, i], p.iterative_roots());
#[must_use]pub fn iterative_roots_with_max(&self, max_iter: u32) -> Vec<Complex<T>>
[src]
Calculate the complex roots of the polynomial using companion Aberth-Ehrlich method, with the given iteration limit.
Arguments
max_iter
- maximum number of iterations for the algorithm
Example
use automatica::polynomial::Poly; let p = Poly::new_from_coeffs(&[1., 0., 1.]); let i = num_complex::Complex::i(); assert_eq!(vec![-i, i], p.iterative_roots_with_max(10));
impl<T: Clone + PartialEq + PartialOrd + Signed + Zero> Poly<T>
[src]
pub fn roundoff(&self, atol: T) -> Self
[src]
Round off to zero coefficients smaller than atol
.
Arguments
atol
- Absolute tolerance (should be positive)
Example
use automatica::Poly; let p = Poly::new_from_coeffs(&[1., 0.002, 1., -0.0001]); let actual = p.roundoff(0.01); let expected = Poly::new_from_coeffs(&[1., 0., 1.]); assert_eq!(expected, actual);
pub fn roundoff_mut(&mut self, atol: T)
[src]
Round off to zero coefficients smaller than atol
in place.
Arguments
atol
- Absolute tolerance (should be positive)
Example
use automatica::Poly; let mut p = Poly::new_from_coeffs(&[1., 0.002, 1., -0.0001]); p.roundoff_mut(0.01); let expected = Poly::new_from_coeffs(&[1., 0., 1.]); assert_eq!(expected, p);
impl<T: Clone + Mul<Output = T> + NumCast + One + PartialEq + Zero> Poly<T>
[src]
impl<T: Clone + Div<Output = T> + NumCast + PartialEq + Zero> Poly<T>
[src]
Implementation methods for Poly struct
pub fn integrate(&self, constant: T) -> Self
[src]
Calculate the integral of the polynomial. When used with integral types it does not convert the coefficients to floats, division is between integers.
Arguments
constant
- Integration constant
Example
use automatica::polynomial::Poly; let p = Poly::new_from_coeffs(&[1., 0., 3.]); let d = p.integrate(5.3); assert_eq!(Poly::new_from_coeffs(&[5.3, 1., 0., 1.]), d);
Panics
Panics when the exponent of the term (usize
) cannot be converted
to T
.
impl<T: Clone> Poly<T>
[src]
#[must_use]pub fn coeffs(&self) -> Vec<T>
[src]
Vector copy of the polynomial's coefficients
Example
use automatica::polynomial::Poly; let p = Poly::new_from_coeffs(&[1., 2., 3.]); assert_eq!(vec![1., 2., 3.], p.coeffs());
pub fn eval_by_val<U>(&self, x: U) -> U where
U: Add<T, Output = U> + Clone + Mul<U, Output = U> + Zero,
[src]
U: Add<T, Output = U> + Clone + Mul<U, Output = U> + Zero,
Evaluate the polynomial using Horner's method.
Arguments
x
- Value at which the polynomial is evaluated.
Example
use automatica::Poly; use num_complex::Complex; let p = Poly::new_from_coeffs(&[0., 0., 2.]); assert_eq!(18., p.eval_by_val(3.)); assert_eq!(Complex::new(-18., 0.), p.eval_by_val(Complex::new(0., 3.)));
impl<T> Poly<T>
[src]
pub fn eval<'a, U>(&'a self, x: &'a U) -> U where
T: 'a,
U: 'a + Add<&'a T, Output = U> + Mul<&'a U, Output = U> + Zero,
[src]
T: 'a,
U: 'a + Add<&'a T, Output = U> + Mul<&'a U, Output = U> + Zero,
Evaluate the polynomial using Horner's method.
Arguments
x
- Value at which the polynomial is evaluated.
Example
use automatica::Poly; use num_complex::Complex; let p = Poly::new_from_coeffs(&[0., 0., 2.]); assert_eq!(18., p.eval(&3.)); assert_eq!(Complex::new(-18., 0.), p.eval(&Complex::new(0., 3.)));
Trait Implementations
impl<T: Clone + PartialEq + Zero, '_> Add<&'_ Poly<T>> for &'_ Poly<T>
[src]
Implementation of polynomial addition
type Output = Poly<T>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<T>) -> Poly<T>
[src]
impl<'_> Add<&'_ Poly<f32>> for f32
[src]
Implementation of f32 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<f64>> for f64
[src]
Implementation of f64 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<i128>> for i128
[src]
Implementation of i128 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<i16>> for i16
[src]
Implementation of i16 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<i32>> for i32
[src]
Implementation of i32 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<i64>> for i64
[src]
Implementation of i64 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<i8>> for i8
[src]
Implementation of i8 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<isize>> for isize
[src]
Implementation of isize and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<u128>> for u128
[src]
Implementation of u128 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<u16>> for u16
[src]
Implementation of u16 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<u32>> for u32
[src]
Implementation of u32 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<u64>> for u64
[src]
Implementation of u64 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<u8>> for u8
[src]
Implementation of u8 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Add<&'_ Poly<usize>> for usize
[src]
Implementation of usize and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<T: Add<Output = T> + Clone + PartialEq + Zero> Add<Poly<T>> for Poly<T>
[src]
Implementation of polynomial addition
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
impl Add<Poly<f32>> for f32
[src]
Implementation of f32 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<f64>> for f64
[src]
Implementation of f64 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<i128>> for i128
[src]
Implementation of i128 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<i16>> for i16
[src]
Implementation of i16 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<i32>> for i32
[src]
Implementation of i32 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<i64>> for i64
[src]
Implementation of i64 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<i8>> for i8
[src]
Implementation of i8 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<isize>> for isize
[src]
Implementation of isize and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<u128>> for u128
[src]
Implementation of u128 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<u16>> for u16
[src]
Implementation of u16 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<u32>> for u32
[src]
Implementation of u32 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<u64>> for u64
[src]
Implementation of u64 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<u8>> for u8
[src]
Implementation of u8 and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Add<Poly<usize>> for usize
[src]
Implementation of usize and polynomial addition
type Output = Poly<Self>
The resulting type after applying the +
operator.
fn add(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl<T: Add<Output = T> + Clone> Add<T> for Poly<T>
[src]
Implementation of polynomial and real number addition
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: T) -> Self
[src]
impl<T: Add<Output = T> + Clone, '_> Add<T> for &'_ Poly<T>
[src]
Implementation of polynomial and real number addition
type Output = Poly<T>
The resulting type after applying the +
operator.
fn add(self, rhs: T) -> Self::Output
[src]
impl<T> AsRef<[T]> for Poly<T>
[src]
View the Poly
coefficients as slice.
impl<T: Clone> Clone for Poly<T>
[src]
impl<T: Debug> Debug for Poly<T>
[src]
impl<T: Display + Zero> Display for Poly<T>
[src]
Implement printing of polynomial
Example
use automatica::polynomial::Poly; let p = Poly::new_from_coeffs(&[0, 1, 2, 0, 3]); assert_eq!("+1s +2s^2 +3s^4", format!("{}", p));
impl<T: Float, '_> Div<&'_ Poly<T>> for &'_ Poly<T>
[src]
Implementation of division between polynomials
Panics
This method panics if the denominator is zero.
type Output = Poly<T>
The resulting type after applying the /
operator.
fn div(self, rhs: &Poly<T>) -> Self::Output
[src]
impl<T: Float> Div<Poly<T>> for Poly<T>
[src]
Implementation of division between polynomials
Panics
This method panics if the denominator is zero.
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> Self::Output
[src]
impl<T: Clone + Num> Div<T> for Poly<T>
[src]
Implementation of polynomial and real number division
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: T) -> Self
[src]
impl<T: Clone + Num, '_> Div<T> for &'_ Poly<T>
[src]
Implementation of polynomial and real number division
type Output = Poly<T>
The resulting type after applying the /
operator.
fn div(self, rhs: T) -> Self::Output
[src]
impl<T> Index<usize> for Poly<T>
[src]
Implement read only indexing of polynomial returning its coefficients.
Panics
Panics for out of bounds access.
Example
use automatica::polynomial::Poly; let p = Poly::new_from_coeffs(&[0, 1, 2, 3]); assert_eq!(2, p[2]);
impl<T> IndexMut<usize> for Poly<T>
[src]
Implement mutable indexing of polynomial returning its coefficients.
Panics
Panics for out of bounds access.
Example
use automatica::polynomial::Poly; let mut p = Poly::new_from_coeffs(&[0, 1, 2, 3]); p[2] = 4; assert_eq!(4, p[2]);
impl<T: Clone + Mul<Output = T> + PartialEq + Zero, '_> Mul<&'_ Poly<T>> for &'_ Poly<T>
[src]
Implementation of polynomial multiplication
type Output = Poly<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Poly<T>
[src]
impl<'_> Mul<&'_ Poly<f32>> for f32
[src]
Implementation of f32 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<f64>> for f64
[src]
Implementation of f64 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<i128>> for i128
[src]
Implementation of i128 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<i16>> for i16
[src]
Implementation of i16 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<i32>> for i32
[src]
Implementation of i32 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<i64>> for i64
[src]
Implementation of i64 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<i8>> for i8
[src]
Implementation of i8 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<isize>> for isize
[src]
Implementation of isize and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<u128>> for u128
[src]
Implementation of u128 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<u16>> for u16
[src]
Implementation of u16 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<u32>> for u32
[src]
Implementation of u32 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<u64>> for u64
[src]
Implementation of u64 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<u8>> for u8
[src]
Implementation of u8 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Mul<&'_ Poly<usize>> for usize
[src]
Implementation of usize and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<T: Clone + Mul<Output = T> + PartialEq + Zero> Mul<Poly<T>> for Poly<T>
[src]
Implementation of polynomial multiplication
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self
[src]
impl Mul<Poly<f32>> for f32
[src]
Implementation of f32 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<f64>> for f64
[src]
Implementation of f64 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<i128>> for i128
[src]
Implementation of i128 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<i16>> for i16
[src]
Implementation of i16 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<i32>> for i32
[src]
Implementation of i32 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<i64>> for i64
[src]
Implementation of i64 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<i8>> for i8
[src]
Implementation of i8 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<isize>> for isize
[src]
Implementation of isize and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<u128>> for u128
[src]
Implementation of u128 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<u16>> for u16
[src]
Implementation of u16 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<u32>> for u32
[src]
Implementation of u32 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<u64>> for u64
[src]
Implementation of u64 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<u8>> for u8
[src]
Implementation of u8 and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Mul<Poly<usize>> for usize
[src]
Implementation of usize and polynomial multiplication
type Output = Poly<Self>
The resulting type after applying the *
operator.
fn mul(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl<T: Clone + Num> Mul<T> for Poly<T>
[src]
Implementation of polynomial and float multiplication
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: T) -> Self
[src]
impl<T: Clone + Num, '_> Mul<T> for &'_ Poly<T>
[src]
Implementation of polynomial and float multiplication
type Output = Poly<T>
The resulting type after applying the *
operator.
fn mul(self, rhs: T) -> Self::Output
[src]
impl<T: Clone + Neg<Output = T>, '_> Neg for &'_ Poly<T>
[src]
Implementation of polynomial negation
type Output = Poly<T>
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl<T: Clone + Neg<Output = T>> Neg for Poly<T>
[src]
Implementation of polynomial negation
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl<T: Clone + Mul<Output = T> + One + PartialEq + Zero> One for Poly<T>
[src]
Implementation of the multiplicative identity for polynomials
Example
use automatica::polynomial::Poly; use num_traits::One; let one = Poly::<u8>::one(); assert!(one.is_one());
impl<T: PartialEq> PartialEq<Poly<T>> for Poly<T>
[src]
impl<T: Float, '_> Rem<&'_ Poly<T>> for &'_ Poly<T>
[src]
Implementation of reminder between polynomials.
Panics
This method panics if the denominator is zero.
type Output = Poly<T>
The resulting type after applying the %
operator.
fn rem(self, rhs: &Poly<T>) -> Self::Output
[src]
impl<T: Float> Rem<Poly<T>> for Poly<T>
[src]
Implementation of reminder between polynomials.
Panics
This method panics if the denominator is zero.
type Output = Self
The resulting type after applying the %
operator.
fn rem(self, rhs: Self) -> Self::Output
[src]
impl<T> StructuralPartialEq for Poly<T>
[src]
impl<T: Clone + PartialEq + Sub<Output = T> + Zero, '_> Sub<&'_ Poly<T>> for &'_ Poly<T>
[src]
Implementation of polynomial subtraction
type Output = Poly<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Poly<T>
[src]
impl<'_> Sub<&'_ Poly<f32>> for f32
[src]
Implementation of f32 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Sub<&'_ Poly<f64>> for f64
[src]
Implementation of f64 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Sub<&'_ Poly<i128>> for i128
[src]
Implementation of i128 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Sub<&'_ Poly<i16>> for i16
[src]
Implementation of i16 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Sub<&'_ Poly<i32>> for i32
[src]
Implementation of i32 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Sub<&'_ Poly<i64>> for i64
[src]
Implementation of i64 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Sub<&'_ Poly<i8>> for i8
[src]
Implementation of i8 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<'_> Sub<&'_ Poly<isize>> for isize
[src]
Implementation of isize and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: &Poly<Self>) -> Poly<Self>
[src]
impl<T: Clone + PartialEq + Sub<Output = T> + Zero> Sub<Poly<T>> for Poly<T>
[src]
Implementation of polynomial subtraction
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
impl Sub<Poly<f32>> for f32
[src]
Implementation of f32 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Sub<Poly<f64>> for f64
[src]
Implementation of f64 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Sub<Poly<i128>> for i128
[src]
Implementation of i128 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Sub<Poly<i16>> for i16
[src]
Implementation of i16 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Sub<Poly<i32>> for i32
[src]
Implementation of i32 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Sub<Poly<i64>> for i64
[src]
Implementation of i64 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Sub<Poly<i8>> for i8
[src]
Implementation of i8 and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl Sub<Poly<isize>> for isize
[src]
Implementation of isize and polynomial subtraction
type Output = Poly<Self>
The resulting type after applying the -
operator.
fn sub(self, rhs: Poly<Self>) -> Poly<Self>
[src]
impl<T: Clone + Sub<Output = T>> Sub<T> for Poly<T>
[src]
Implementation of polynomial and real number subtraction
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: T) -> Self
[src]
impl<T: Clone + Sub<Output = T>, '_> Sub<T> for &'_ Poly<T>
[src]
Implementation of polynomial and real number subtraction
type Output = Poly<T>
The resulting type after applying the -
operator.
fn sub(self, rhs: T) -> Self::Output
[src]
impl<T: Clone + PartialEq + Zero> Zero for Poly<T>
[src]
Implementation of the additive identity for polynomials
Example
use automatica::polynomial::Poly; use num_traits::Zero; let zero = Poly::<u8>::zero(); assert!(zero.is_zero());
Auto Trait Implementations
impl<T> RefUnwindSafe for Poly<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Poly<T> where
T: Send,
T: Send,
impl<T> Sync for Poly<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Poly<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Poly<T> where
T: UnwindSafe,
T: UnwindSafe,
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> ClosedNeg for T where
T: Neg<Output = T>,
T: Neg<Output = T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
[src]
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,