[][src]Enum expression_num::NumExpr

pub enum NumExpr<T: NumType> {
    Const(T),
    Var(usize),
    Add(Box<NumExpr<T>>, Box<NumExpr<T>>),
    Sub(Box<NumExpr<T>>, Box<NumExpr<T>>),
    Mul(Box<NumExpr<T>>, Box<NumExpr<T>>),
    Div(Box<NumExpr<T>>, Box<NumExpr<T>>),
    Divz(Box<NumExpr<T>>, Box<NumExpr<T>>),
    Recip(Box<NumExpr<T>>),
    Recipz(Box<NumExpr<T>>),
}

An expression evaluates to a numeric value of type NumType.

Variants

Const(T)

A constant value.

Var(usize)

References a variable by position

Add(Box<NumExpr<T>>, Box<NumExpr<T>>)Sub(Box<NumExpr<T>>, Box<NumExpr<T>>)Mul(Box<NumExpr<T>>, Box<NumExpr<T>>)Div(Box<NumExpr<T>>, Box<NumExpr<T>>)Divz(Box<NumExpr<T>>, Box<NumExpr<T>>)

Safe division with x/0 = 0.0

Recip(Box<NumExpr<T>>)

Reciprocal (1 / x).

Recipz(Box<NumExpr<T>>)

Reciprocal using safe division

Methods

impl<T: NumType> NumExpr<T>[src]

pub fn op_add(self, other: NumExpr<T>) -> NumExpr<T>[src]

pub fn op_sub(self, other: NumExpr<T>) -> NumExpr<T>[src]

pub fn op_mul(self, other: NumExpr<T>) -> NumExpr<T>[src]

pub fn op_div(self, other: NumExpr<T>) -> NumExpr<T>[src]

pub fn op_divz(self, other: NumExpr<T>) -> NumExpr<T>[src]

pub fn op_recip(self) -> NumExpr<T>[src]

pub fn op_recipz(self) -> NumExpr<T>[src]

Trait Implementations

impl<T: Clone + NumType> Clone for NumExpr<T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Eq + NumType> Eq for NumExpr<T>[src]

impl<'a, T: NumType + Into<Sexp>> Into<Sexp> for &'a NumExpr<T>[src]

impl<T: PartialEq + NumType> PartialEq<NumExpr<T>> for NumExpr<T>[src]

impl<T: Debug + NumType> Debug for NumExpr<T>[src]

impl<T: NumType> Expression for NumExpr<T>[src]

type Element = T

Auto Trait Implementations

impl<T> Send for NumExpr<T> where
    T: Send

impl<T> Sync for NumExpr<T> where
    T: Sync

Blanket Implementations

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, 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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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