Enum grb::expr::Expr[][src]

pub enum Expr {
    Quad(QuadExpr),
    Linear(LinExpr),
    QTerm(f64VarVar),
    Term(f64Var),
    Constant(f64),
}

An algbraic expression of variables.

Variants

Quad(QuadExpr)

A quadratic expression

Linear(LinExpr)

A linear expression

QTerm(f64VarVar)

A single quadratic term

Term(f64Var)

A single linear term

Constant(f64)

A constant term

Implementations

impl Expr[src]

pub fn is_linear(&self) -> bool[src]

Returns false if quadratic terms are present.

pub fn into_quadexpr(self) -> QuadExpr[src]

Transform into a QuadExpr, possibly with no quadratic terms)

pub fn into_linexpr(self) -> Result<LinExpr>[src]

Transform into a LinExpr, possible with no linear terms (just a constant)

Errors

Returns an Error::AlgebraicError if Expr is not linear.

Trait Implementations

impl Add<Expr> for Expr[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Expr> for Var[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<Expr> for LinExpr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<Expr> for QuadExpr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<LinExpr> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<QuadExpr> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<Var> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<f32> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<f64> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<i16> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<i32> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<i64> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<i8> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<isize> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<u16> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<u32> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<u64> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<u8> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl Add<usize> for Expr[src]

type Output = Expr

The resulting type after applying the + operator.

impl AttachModel for Expr[src]

impl Clone for Expr[src]

impl Debug for Expr[src]

impl Default for Expr[src]

impl<T: Copy + Into<Expr>> From<&'_ T> for Expr[src]

impl From<LinExpr> for Expr[src]

impl From<QuadExpr> for Expr[src]

impl From<Var> for Expr[src]

impl From<f32> for Expr[src]

impl From<f64> for Expr[src]

impl From<i16> for Expr[src]

impl From<i32> for Expr[src]

impl From<i64> for Expr[src]

impl From<i8> for Expr[src]

impl From<isize> for Expr[src]

impl From<u16> for Expr[src]

impl From<u32> for Expr[src]

impl From<u64> for Expr[src]

impl From<u8> for Expr[src]

impl From<usize> for Expr[src]

impl Mul<f32> for Expr[src]

type Output = Expr

The resulting type after applying the * operator.

impl Mul<f64> for Expr[src]

type Output = Expr

The resulting type after applying the * operator.

impl Mul<i16> for Expr[src]

type Output = Expr

The resulting type after applying the * operator.

impl Mul<i32> for Expr[src]

type Output = Expr

The resulting type after applying the * operator.

impl Mul<i64> for Expr[src]

type Output = Expr

The resulting type after applying the * operator.

impl Mul<i8> for Expr[src]

type Output = Expr

The resulting type after applying the * operator.

impl Mul<isize> for Expr[src]

type Output = Expr

The resulting type after applying the * operator.

impl Mul<u16> for Expr[src]

type Output = Expr

The resulting type after applying the * operator.

impl Mul<u32> for Expr[src]

type Output = Expr

The resulting type after applying the * operator.

impl Mul<u64> for Expr[src]

type Output = Expr

The resulting type after applying the * operator.

impl Mul<u8> for Expr[src]

type Output = Expr

The resulting type after applying the * operator.

impl Mul<usize> for Expr[src]

type Output = Expr

The resulting type after applying the * operator.

impl Neg for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<Expr> for Expr[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Expr> for Var[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<Expr> for LinExpr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<Expr> for QuadExpr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<LinExpr> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<QuadExpr> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<Var> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<f32> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<f64> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<i16> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<i32> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<i64> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<i8> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<isize> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<u16> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<u32> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<u64> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<u8> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl Sub<usize> for Expr[src]

type Output = Expr

The resulting type after applying the - operator.

impl<A: Into<Expr>> Sum<A> for Expr[src]

Auto Trait Implementations

impl RefUnwindSafe for Expr

impl Send for Expr

impl Sync for Expr

impl Unpin for Expr

impl UnwindSafe for Expr

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