[][src]Struct bacon_sci::polynomial::Polynomial

pub struct Polynomial<N: ComplexField> { /* fields omitted */ }

Polynomial on a ComplexField.

Implementations

impl<N: ComplexField> Polynomial<N>[src]

pub fn new() -> Self[src]

Returns the zero polynomial on a given field

pub fn with_tolerance(
    tolerance: <N as ComplexField>::RealField
) -> Result<Self, String>
[src]

pub fn with_capacity(capacity: usize) -> Self[src]

Returns the zero polynomial on a given field with preallocated memory

pub fn from_slice(data: &[N]) -> Self[src]

Create a polynomial from a slice, with the first element of the slice being the highest power

pub fn set_tolerance(
    &mut self,
    tolerance: <N as ComplexField>::RealField
) -> Result<(), String>
[src]

pub fn get_tolerance(&self) -> <N as ComplexField>::RealField[src]

pub fn order(&self) -> usize[src]

Get the order of the polynomial

pub fn get_coefficient(&self, ind: usize) -> N[src]

Get the coefficient of a power

pub fn make_complex(
    &self
) -> Polynomial<Complex<<N as ComplexField>::RealField>>
[src]

Make a polynomial complex

pub fn evaluate(&self, x: N) -> N[src]

Evaluate a polynomial at a value

pub fn evaluate_derivative(&self, x: N) -> (N, N)[src]

Evaluate a polynomial and its derivative at a value

pub fn set_coefficient(&mut self, power: u32, coefficient: N)[src]

Set a coefficient of a power in the polynomial

pub fn purge_coefficient(&mut self, power: usize)[src]

Remove the coefficient of a power in the polynomial

pub fn purge_leading(&mut self)[src]

Remove all leading 0 coefficients

pub fn derivative(&self) -> Self[src]

Get the derivative of the polynomial

pub fn antiderivative(&self, constant: N) -> Self[src]

Get the antiderivative of the polynomial with specified constant

pub fn integrate(&self, lower: N, upper: N) -> N[src]

Integrate this polynomial between to starting points

pub fn divide(&self, divisor: &Polynomial<N>) -> Result<(Self, Self), String>[src]

Divide this polynomial by another, getting a quotient and remainder, using tol to check for 0

pub fn roots(
    &self,
    guesses: &[N],
    tol: <N as ComplexField>::RealField,
    n_max: usize
) -> Result<VecDeque<Complex<<N as ComplexField>::RealField>>, String>
[src]

Get the n (possibly including repeats) of the polynomial given n guesses

pub fn dft(&self, size: usize) -> Vec<Complex<<N as ComplexField>::RealField>>[src]

Get the polynomial in point form evaluated at roots of unity at k points where k is the smallest power of 2 greater than or equal to size

pub fn idft(
    vec: &[Complex<<N as ComplexField>::RealField>],
    tol: <N as ComplexField>::RealField
) -> Self
[src]

Trait Implementations

impl<N: ComplexField> AbstractMagma<Additive> for Polynomial<N>[src]

impl<N: ComplexField, '_> Add<&'_ Polynomial<N>> for Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the + operator.

impl<N: ComplexField, '_, '_> Add<&'_ Polynomial<N>> for &'_ Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the + operator.

impl<N: ComplexField> Add<N> for Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the + operator.

impl<N: ComplexField, '_> Add<N> for &'_ Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the + operator.

impl<N: ComplexField> Add<Polynomial<N>> for Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the + operator.

impl<N: ComplexField, '_> Add<Polynomial<N>> for &'_ Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the + operator.

impl<N: ComplexField, '_> AddAssign<&'_ Polynomial<N>> for Polynomial<N>[src]

impl<N: ComplexField> AddAssign<N> for Polynomial<N>[src]

impl<N: ComplexField> AddAssign<Polynomial<N>> for Polynomial<N>[src]

impl<N: Clone + ComplexField> Clone for Polynomial<N>[src]

impl<N: Debug + ComplexField> Debug for Polynomial<N>[src]

impl<N: ComplexField> Default for Polynomial<N>[src]

impl<N: ComplexField> Div<N> for Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the / operator.

impl<N: ComplexField, '_> Div<N> for &'_ Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the / operator.

impl<N: ComplexField> DivAssign<N> for Polynomial<N>[src]

impl<N: ComplexField> From<N> for Polynomial<N>[src]

impl<N: RealField> From<Polynomial<N>> for Polynomial<Complex<N>>[src]

impl<N: ComplexField> FromIterator<N> for Polynomial<N>[src]

impl<N: ComplexField, '_> Mul<&'_ Polynomial<N>> for Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the * operator.

impl<N: ComplexField, '_, '_> Mul<&'_ Polynomial<N>> for &'_ Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the * operator.

impl<N: ComplexField> Mul<N> for Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the * operator.

impl<N: ComplexField, '_> Mul<N> for &'_ Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the * operator.

impl<N: ComplexField> Mul<Polynomial<N>> for Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the * operator.

impl<N: ComplexField, '_> Mul<Polynomial<N>> for &'_ Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the * operator.

impl<N: ComplexField, '_> MulAssign<&'_ Polynomial<N>> for Polynomial<N>[src]

impl<N: ComplexField> MulAssign<N> for Polynomial<N>[src]

impl<N: ComplexField> MulAssign<Polynomial<N>> for Polynomial<N>[src]

impl<N: ComplexField> Neg for Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the - operator.

impl<N: ComplexField, '_> Neg for &'_ Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the - operator.

impl<N: ComplexField, '_> Sub<&'_ Polynomial<N>> for Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the - operator.

impl<N: ComplexField, '_, '_> Sub<&'_ Polynomial<N>> for &'_ Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the - operator.

impl<N: ComplexField> Sub<N> for Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the - operator.

impl<N: ComplexField, '_> Sub<N> for &'_ Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the - operator.

impl<N: ComplexField> Sub<Polynomial<N>> for Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the - operator.

impl<N: ComplexField, '_> Sub<Polynomial<N>> for &'_ Polynomial<N>[src]

type Output = Polynomial<N>

The resulting type after applying the - operator.

impl<N: ComplexField, '_> SubAssign<&'_ Polynomial<N>> for Polynomial<N>[src]

impl<N: ComplexField> SubAssign<N> for Polynomial<N>[src]

impl<N: ComplexField> SubAssign<Polynomial<N>> for Polynomial<N>[src]

impl<N: ComplexField> Zero for Polynomial<N>[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for Polynomial<N> where
    N: RefUnwindSafe,
    <N as ComplexField>::RealField: RefUnwindSafe
[src]

impl<N> Send for Polynomial<N> where
    <N as ComplexField>::RealField: Send
[src]

impl<N> Sync for Polynomial<N> where
    <N as ComplexField>::RealField: Sync
[src]

impl<N> Unpin for Polynomial<N> where
    N: Unpin,
    <N as ComplexField>::RealField: Unpin
[src]

impl<N> UnwindSafe for Polynomial<N> where
    N: UnwindSafe,
    <N as ComplexField>::RealField: UnwindSafe
[src]

Blanket Implementations

impl<T> AdditiveMagma for T where
    T: AbstractMagma<Additive>, 
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, Right> ClosedAdd<Right> for T where
    T: Add<Right, Output = T> + AddAssign<Right>, 
[src]

impl<T, Right> ClosedAdd<Right> for T where
    T: Add<Right, Output = T> + AddAssign<Right>, 

impl<T, Right> ClosedDiv<Right> for T where
    T: Div<Right, Output = T> + DivAssign<Right>, 
[src]

impl<T, Right> ClosedDiv<Right> for T where
    T: Div<Right, Output = T> + DivAssign<Right>, 

impl<T, Right> ClosedMul<Right> for T where
    T: Mul<Right, Output = T> + MulAssign<Right>, 
[src]

impl<T, Right> ClosedMul<Right> for T where
    T: Mul<Right, Output = T> + MulAssign<Right>, 

impl<T> ClosedNeg for T where
    T: Neg<Output = T>, 
[src]

impl<T> ClosedNeg for T where
    T: Neg<Output = T>, 

impl<T, Right> ClosedSub<Right> for T where
    T: Sub<Right, Output = T> + SubAssign<Right>, 
[src]

impl<T, Right> ClosedSub<Right> for T where
    T: Sub<Right, Output = T> + SubAssign<Right>, 

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,