[][src]Struct peroxide::structure::polynomial::Polynomial

pub struct Polynomial {
    pub coef: Vector,
}

Polynomial Structure

Fields

coef: Vector

Methods

impl Polynomial[src]

pub fn new(coef: Vector) -> Self[src]

Create Polynomial

pub fn eval<T>(&self, x: T) -> f64 where
    T: Into<f64> + Copy
[src]

Evaluate polynomial with value

Examples

extern crate peroxide;
use peroxide::*;

let a = poly(c!(1,3,2));
assert_eq!(a.eval(1), 6_f64);

pub fn eval_vec(&self, v: Vector) -> Vector[src]

Trait Implementations

impl Add<Polynomial> for Polynomial[src]

type Output = Self

The resulting type after applying the + operator.

impl<T> Add<T> for Polynomial where
    T: Into<f64> + Copy
[src]

type Output = Self

The resulting type after applying the + operator.

impl Calculus for Polynomial[src]

impl Clone for Polynomial[src]

impl Debug for Polynomial[src]

impl Display for Polynomial[src]

Polynomial Print

Examples

extern crate peroxide;
use peroxide::*;

let a = poly(c!(1,3,2));
a.print(); //x^2 + 3x + 2

impl Div<Polynomial> for Polynomial[src]

type Output = (Self, Self)

The resulting type after applying the / operator.

impl<T> Div<T> for Polynomial where
    T: Into<f64> + Copy
[src]

type Output = Self

The resulting type after applying the / operator.

impl Mul<Polynomial> for Polynomial[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<Polynomial> for usize[src]

type Output = Polynomial

The resulting type after applying the * operator.

impl Mul<Polynomial> for i32[src]

type Output = Polynomial

The resulting type after applying the * operator.

impl Mul<Polynomial> for i64[src]

type Output = Polynomial

The resulting type after applying the * operator.

impl Mul<Polynomial> for f32[src]

type Output = Polynomial

The resulting type after applying the * operator.

impl Mul<Polynomial> for f64[src]

type Output = Polynomial

The resulting type after applying the * operator.

impl<T> Mul<T> for Polynomial where
    T: Into<f64> + Copy
[src]

type Output = Self

The resulting type after applying the * operator.

impl Neg for Polynomial[src]

type Output = Self

The resulting type after applying the - operator.

impl PowOps for Polynomial[src]

impl Printable for Polynomial[src]

impl Sub<Polynomial> for Polynomial[src]

type Output = Self

The resulting type after applying the - operator.

impl<T> Sub<T> for Polynomial where
    T: Into<f64> + Copy
[src]

type Output = Self

The resulting type after applying the - operator.

Auto Trait Implementations

Blanket Implementations

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> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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>,