Struct peroxide::structure::polynomial::Polynomial
source · pub struct Polynomial {
pub coef: Vector,
}
Expand description
Polynomial Structure
Fields
coef: Vector
Implementations
sourceimpl Polynomial
impl Polynomial
sourcepub fn new(coef: Vector) -> Polynomial
pub fn new(coef: Vector) -> Polynomial
Create Polynomial
sourcepub fn eval<T>(&self, x: T) -> f64where
T: Into<f64> + Copy,
pub fn eval<T>(&self, x: T) -> f64where
T: Into<f64> + Copy,
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
Trait Implementations
sourceimpl Add<Polynomial> for Polynomial
impl Add<Polynomial> for Polynomial
type Output = Polynomial
type Output = Polynomial
The resulting type after applying the
+
operator.sourcefn add(self, other: Polynomial) -> Polynomial
fn add(self, other: Polynomial) -> Polynomial
Performs the
+
operation. Read moresourceimpl<T> Add<T> for Polynomialwhere
T: Into<f64> + Copy,
impl<T> Add<T> for Polynomialwhere
T: Into<f64> + Copy,
type Output = Polynomial
type Output = Polynomial
The resulting type after applying the
+
operator.sourcefn add(self, other: T) -> Polynomial
fn add(self, other: T) -> Polynomial
Performs the
+
operation. Read moresourceimpl Clone for Polynomial
impl Clone for Polynomial
sourcefn clone(&self) -> Polynomial
fn clone(&self) -> Polynomial
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for Polynomial
impl Debug for Polynomial
sourceimpl Display for Polynomial
impl Display for Polynomial
Polynomial Print
Examples
extern crate peroxide;
use peroxide::*;
let a = poly(c!(1,3,2));
a.print(); //x^2 + 3x + 2
sourceimpl Div<Polynomial> for Polynomial
impl Div<Polynomial> for Polynomial
type Output = (Polynomial, Polynomial)
type Output = (Polynomial, Polynomial)
The resulting type after applying the
/
operator.sourcefn div(self, other: Polynomial) -> Self::Output
fn div(self, other: Polynomial) -> Self::Output
Performs the
/
operation. Read moresourceimpl<T> Div<T> for Polynomialwhere
T: Into<f64> + Copy,
impl<T> Div<T> for Polynomialwhere
T: Into<f64> + Copy,
type Output = Polynomial
type Output = Polynomial
The resulting type after applying the
/
operator.sourcefn div(self, other: T) -> Polynomial
fn div(self, other: T) -> Polynomial
Performs the
/
operation. Read moresourceimpl Mul<Polynomial> for Polynomial
impl Mul<Polynomial> for Polynomial
type Output = Polynomial
type Output = Polynomial
The resulting type after applying the
*
operator.sourcefn mul(self, other: Polynomial) -> Polynomial
fn mul(self, other: Polynomial) -> Polynomial
Performs the
*
operation. Read moresourceimpl<T> Mul<T> for Polynomialwhere
T: Into<f64> + Copy,
impl<T> Mul<T> for Polynomialwhere
T: Into<f64> + Copy,
type Output = Polynomial
type Output = Polynomial
The resulting type after applying the
*
operator.sourcefn mul(self, other: T) -> Polynomial
fn mul(self, other: T) -> Polynomial
Performs the
*
operation. Read moresourceimpl Neg for Polynomial
impl Neg for Polynomial
sourceimpl PowOps for Polynomial
impl PowOps for Polynomial
type Output = Polynomial
fn pow(&self, n: usize) -> Polynomial
fn powf(&self, _f: f64) -> Polynomial
sourceimpl Printable for Polynomial
impl Printable for Polynomial
sourceimpl Sub<Polynomial> for Polynomial
impl Sub<Polynomial> for Polynomial
type Output = Polynomial
type Output = Polynomial
The resulting type after applying the
-
operator.sourcefn sub(self, other: Polynomial) -> Polynomial
fn sub(self, other: Polynomial) -> Polynomial
Performs the
-
operation. Read moresourceimpl<T> Sub<T> for Polynomialwhere
T: Into<f64> + Copy,
impl<T> Sub<T> for Polynomialwhere
T: Into<f64> + Copy,
type Output = Polynomial
type Output = Polynomial
The resulting type after applying the
-
operator.sourcefn sub(self, other: T) -> Polynomial
fn sub(self, other: T) -> Polynomial
Performs the
-
operation. Read moreAuto Trait Implementations
impl RefUnwindSafe for Polynomial
impl Send for Polynomial
impl Sync for Polynomial
impl Unpin for Polynomial
impl UnwindSafe for Polynomial
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more