Enum grb::expr::Expr [−][src]
pub enum Expr { Quad(QuadExpr), Linear(LinExpr), QTerm(f64, Var, Var), Term(f64, Var), Constant(f64), }
An algbraic expression of variables.
Variants
Quad(QuadExpr)
A quadratic expression
Linear(LinExpr)
A linear expression
A single quadratic term
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.
fn add(self, rhs: Self) -> Self
[src]
impl Add<Expr> for Var
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: Expr) -> Expr
[src]
impl Add<Expr> for LinExpr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: Expr) -> Expr
[src]
impl Add<Expr> for QuadExpr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: Expr) -> Expr
[src]
impl Add<LinExpr> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: LinExpr) -> Expr
[src]
impl Add<QuadExpr> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: QuadExpr) -> Expr
[src]
impl Add<Var> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: Var) -> Expr
[src]
impl Add<f32> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: f32) -> Expr
[src]
impl Add<f64> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: f64) -> Expr
[src]
impl Add<i16> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: i16) -> Expr
[src]
impl Add<i32> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: i32) -> Expr
[src]
impl Add<i64> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: i64) -> Expr
[src]
impl Add<i8> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: i8) -> Expr
[src]
impl Add<isize> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: isize) -> Expr
[src]
impl Add<u16> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: u16) -> Expr
[src]
impl Add<u32> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: u32) -> Expr
[src]
impl Add<u64> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: u64) -> Expr
[src]
impl Add<u8> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: u8) -> Expr
[src]
impl Add<usize> for Expr
[src]
type Output = Expr
The resulting type after applying the +
operator.
fn add(self, rhs: usize) -> Expr
[src]
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.
fn mul(self, rhs: f32) -> Expr
[src]
impl Mul<f64> for Expr
[src]
type Output = Expr
The resulting type after applying the *
operator.
fn mul(self, rhs: f64) -> Expr
[src]
impl Mul<i16> for Expr
[src]
type Output = Expr
The resulting type after applying the *
operator.
fn mul(self, rhs: i16) -> Expr
[src]
impl Mul<i32> for Expr
[src]
type Output = Expr
The resulting type after applying the *
operator.
fn mul(self, rhs: i32) -> Expr
[src]
impl Mul<i64> for Expr
[src]
type Output = Expr
The resulting type after applying the *
operator.
fn mul(self, rhs: i64) -> Expr
[src]
impl Mul<i8> for Expr
[src]
type Output = Expr
The resulting type after applying the *
operator.
fn mul(self, rhs: i8) -> Expr
[src]
impl Mul<isize> for Expr
[src]
type Output = Expr
The resulting type after applying the *
operator.
fn mul(self, rhs: isize) -> Expr
[src]
impl Mul<u16> for Expr
[src]
type Output = Expr
The resulting type after applying the *
operator.
fn mul(self, rhs: u16) -> Expr
[src]
impl Mul<u32> for Expr
[src]
type Output = Expr
The resulting type after applying the *
operator.
fn mul(self, rhs: u32) -> Expr
[src]
impl Mul<u64> for Expr
[src]
type Output = Expr
The resulting type after applying the *
operator.
fn mul(self, rhs: u64) -> Expr
[src]
impl Mul<u8> for Expr
[src]
type Output = Expr
The resulting type after applying the *
operator.
fn mul(self, rhs: u8) -> Expr
[src]
impl Mul<usize> for Expr
[src]
type Output = Expr
The resulting type after applying the *
operator.
fn mul(self, rhs: usize) -> Expr
[src]
impl Neg for Expr
[src]
impl Sub<Expr> for Expr
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
impl Sub<Expr> for Var
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: Expr) -> Expr
[src]
impl Sub<Expr> for LinExpr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: Expr) -> Expr
[src]
impl Sub<Expr> for QuadExpr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: Expr) -> Expr
[src]
impl Sub<LinExpr> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: LinExpr) -> Expr
[src]
impl Sub<QuadExpr> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: QuadExpr) -> Expr
[src]
impl Sub<Var> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: Var) -> Expr
[src]
impl Sub<f32> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: f32) -> Expr
[src]
impl Sub<f64> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: f64) -> Expr
[src]
impl Sub<i16> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: i16) -> Expr
[src]
impl Sub<i32> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: i32) -> Expr
[src]
impl Sub<i64> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: i64) -> Expr
[src]
impl Sub<i8> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: i8) -> Expr
[src]
impl Sub<isize> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: isize) -> Expr
[src]
impl Sub<u16> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: u16) -> Expr
[src]
impl Sub<u32> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: u32) -> Expr
[src]
impl Sub<u64> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: u64) -> Expr
[src]
impl Sub<u8> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: u8) -> Expr
[src]
impl Sub<usize> for Expr
[src]
type Output = Expr
The resulting type after applying the -
operator.
fn sub(self, rhs: usize) -> Expr
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,