Struct casuarius::Expression
source · [−]pub struct Expression<T> {
pub terms: Vec<Term<T>>,
pub constant: OrderedFloat<f64>,
}
Expand description
An expression that can be the left hand or right hand side of a constraint equation. It is a linear combination of variables, i.e. a sum of variables weighted by coefficients, plus an optional constant.
Fields
terms: Vec<Term<T>>
constant: OrderedFloat<f64>
Implementations
sourceimpl<T: Clone> Expression<T>
impl<T: Clone> Expression<T>
sourcepub fn from_constant(v: f64) -> Expression<T>
pub fn from_constant(v: f64) -> Expression<T>
Constructs an expression of the form n, where n is a constant real number, not a variable.
sourcepub fn from_term(term: Term<T>) -> Expression<T>
pub fn from_term(term: Term<T>) -> Expression<T>
Constructs an expression from a single term. Forms an expression of the form n x where n is the coefficient, and x is the variable.
Trait Implementations
sourceimpl<T> Add<Expression<T>> for Expression<T>
impl<T> Add<Expression<T>> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the +
operator.
sourcefn add(self, e: Expression<T>) -> Expression<T>
fn add(self, e: Expression<T>) -> Expression<T>
Performs the +
operation. Read more
sourceimpl<T> Add<Expression<T>> for Term<T>
impl<T> Add<Expression<T>> for Term<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the +
operator.
sourcefn add(self, e: Expression<T>) -> Expression<T>
fn add(self, e: Expression<T>) -> Expression<T>
Performs the +
operation. Read more
sourceimpl<T> Add<Expression<T>> for f32
impl<T> Add<Expression<T>> for f32
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the +
operator.
sourcefn add(self, e: Expression<T>) -> Expression<T>
fn add(self, e: Expression<T>) -> Expression<T>
Performs the +
operation. Read more
sourceimpl<T> Add<Expression<T>> for f64
impl<T> Add<Expression<T>> for f64
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the +
operator.
sourcefn add(self, e: Expression<T>) -> Expression<T>
fn add(self, e: Expression<T>) -> Expression<T>
Performs the +
operation. Read more
sourceimpl<T> Add<Expression<T>> for i32
impl<T> Add<Expression<T>> for i32
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the +
operator.
sourcefn add(self, e: Expression<T>) -> Expression<T>
fn add(self, e: Expression<T>) -> Expression<T>
Performs the +
operation. Read more
sourceimpl<T> Add<Expression<T>> for u32
impl<T> Add<Expression<T>> for u32
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the +
operator.
sourcefn add(self, e: Expression<T>) -> Expression<T>
fn add(self, e: Expression<T>) -> Expression<T>
Performs the +
operation. Read more
sourceimpl Add<Expression<Variable>> for Variable
impl Add<Expression<Variable>> for Variable
type Output = Expression<Variable>
type Output = Expression<Variable>
The resulting type after applying the +
operator.
sourcefn add(self, e: Expression<Variable>) -> Expression<Variable>
fn add(self, e: Expression<Variable>) -> Expression<Variable>
Performs the +
operation. Read more
sourceimpl<T> Add<Term<T>> for Expression<T>
impl<T> Add<Term<T>> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the +
operator.
sourcefn add(self, t: Term<T>) -> Expression<T>
fn add(self, t: Term<T>) -> Expression<T>
Performs the +
operation. Read more
sourceimpl Add<Variable> for Expression<Variable>
impl Add<Variable> for Expression<Variable>
type Output = Expression<Variable>
type Output = Expression<Variable>
The resulting type after applying the +
operator.
sourceimpl<T> Add<f32> for Expression<T>
impl<T> Add<f32> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the +
operator.
sourcefn add(self, v: f32) -> Expression<T>
fn add(self, v: f32) -> Expression<T>
Performs the +
operation. Read more
sourceimpl<T> Add<f64> for Expression<T>
impl<T> Add<f64> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the +
operator.
sourcefn add(self, v: f64) -> Expression<T>
fn add(self, v: f64) -> Expression<T>
Performs the +
operation. Read more
sourceimpl<T> Add<i32> for Expression<T>
impl<T> Add<i32> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the +
operator.
sourcefn add(self, v: i32) -> Expression<T>
fn add(self, v: i32) -> Expression<T>
Performs the +
operation. Read more
sourceimpl<T> Add<u32> for Expression<T>
impl<T> Add<u32> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the +
operator.
sourcefn add(self, v: u32) -> Expression<T>
fn add(self, v: u32) -> Expression<T>
Performs the +
operation. Read more
sourceimpl<T> AddAssign<Expression<T>> for Expression<T>
impl<T> AddAssign<Expression<T>> for Expression<T>
sourcefn add_assign(&mut self, e: Expression<T>)
fn add_assign(&mut self, e: Expression<T>)
Performs the +=
operation. Read more
sourceimpl<T> AddAssign<Term<T>> for Expression<T>
impl<T> AddAssign<Term<T>> for Expression<T>
sourcefn add_assign(&mut self, t: Term<T>)
fn add_assign(&mut self, t: Term<T>)
Performs the +=
operation. Read more
sourceimpl AddAssign<Variable> for Expression<Variable>
impl AddAssign<Variable> for Expression<Variable>
sourcefn add_assign(&mut self, v: Variable)
fn add_assign(&mut self, v: Variable)
Performs the +=
operation. Read more
sourceimpl<T> AddAssign<f32> for Expression<T>
impl<T> AddAssign<f32> for Expression<T>
sourcefn add_assign(&mut self, v: f32)
fn add_assign(&mut self, v: f32)
Performs the +=
operation. Read more
sourceimpl<T> AddAssign<f64> for Expression<T>
impl<T> AddAssign<f64> for Expression<T>
sourcefn add_assign(&mut self, v: f64)
fn add_assign(&mut self, v: f64)
Performs the +=
operation. Read more
sourceimpl<T> AddAssign<i32> for Expression<T>
impl<T> AddAssign<i32> for Expression<T>
sourcefn add_assign(&mut self, v: i32)
fn add_assign(&mut self, v: i32)
Performs the +=
operation. Read more
sourceimpl<T> AddAssign<u32> for Expression<T>
impl<T> AddAssign<u32> for Expression<T>
sourcefn add_assign(&mut self, v: u32)
fn add_assign(&mut self, v: u32)
Performs the +=
operation. Read more
sourceimpl<T: Clone> Clone for Expression<T>
impl<T: Clone> Clone for Expression<T>
sourcefn clone(&self) -> Expression<T>
fn clone(&self) -> Expression<T>
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 more
sourceimpl<Var: Clone> Constrainable<Var> for Expression<Var>
impl<Var: Clone> Constrainable<Var> for Expression<Var>
fn equal_to<X>(self, x: X) -> Constraint<Var> where
X: Into<Expression<Var>> + Clone,
fn greater_than_or_equal_to<X>(self, x: X) -> Constraint<Var> where
X: Into<Expression<Var>> + Clone,
fn less_than_or_equal_to<X>(self, x: X) -> Constraint<Var> where
X: Into<Expression<Var>> + Clone,
fn is<X>(self, x: X) -> Constraint<Var> where
X: Into<Expression<Var>> + Clone,
fn is_ge<X>(self, x: X) -> Constraint<Var> where
X: Into<Expression<Var>> + Clone,
fn is_le<X>(self, x: X) -> Constraint<Var> where
X: Into<Expression<Var>> + Clone,
sourceimpl<T: Debug> Debug for Expression<T>
impl<T: Debug> Debug for Expression<T>
sourceimpl<T: Clone> Div<f32> for Expression<T>
impl<T: Clone> Div<f32> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the /
operator.
sourcefn div(self, v: f32) -> Expression<T>
fn div(self, v: f32) -> Expression<T>
Performs the /
operation. Read more
sourceimpl<T: Clone> Div<f64> for Expression<T>
impl<T: Clone> Div<f64> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the /
operator.
sourcefn div(self, v: f64) -> Expression<T>
fn div(self, v: f64) -> Expression<T>
Performs the /
operation. Read more
sourceimpl<T: Clone> Div<i32> for Expression<T>
impl<T: Clone> Div<i32> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the /
operator.
sourcefn div(self, v: i32) -> Expression<T>
fn div(self, v: i32) -> Expression<T>
Performs the /
operation. Read more
sourceimpl<T: Clone> Div<u32> for Expression<T>
impl<T: Clone> Div<u32> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the /
operator.
sourcefn div(self, v: u32) -> Expression<T>
fn div(self, v: u32) -> Expression<T>
Performs the /
operation. Read more
sourceimpl<T: Clone> DivAssign<f32> for Expression<T>
impl<T: Clone> DivAssign<f32> for Expression<T>
sourcefn div_assign(&mut self, v: f32)
fn div_assign(&mut self, v: f32)
Performs the /=
operation. Read more
sourceimpl<T: Clone> DivAssign<f64> for Expression<T>
impl<T: Clone> DivAssign<f64> for Expression<T>
sourcefn div_assign(&mut self, v: f64)
fn div_assign(&mut self, v: f64)
Performs the /=
operation. Read more
sourceimpl<T: Clone> DivAssign<i32> for Expression<T>
impl<T: Clone> DivAssign<i32> for Expression<T>
sourcefn div_assign(&mut self, v: i32)
fn div_assign(&mut self, v: i32)
Performs the /=
operation. Read more
sourceimpl<T: Clone> DivAssign<u32> for Expression<T>
impl<T: Clone> DivAssign<u32> for Expression<T>
sourcefn div_assign(&mut self, v: u32)
fn div_assign(&mut self, v: u32)
Performs the /=
operation. Read more
sourceimpl<T: Clone> From<Term<T>> for Expression<T>
impl<T: Clone> From<Term<T>> for Expression<T>
sourcefn from(t: Term<T>) -> Expression<T>
fn from(t: Term<T>) -> Expression<T>
Converts to this type from the input type.
sourceimpl From<Variable> for Expression<Variable>
impl From<Variable> for Expression<Variable>
sourcefn from(v: Variable) -> Expression<Variable>
fn from(v: Variable) -> Expression<Variable>
Converts to this type from the input type.
sourceimpl<T: Clone> From<f64> for Expression<T>
impl<T: Clone> From<f64> for Expression<T>
sourcefn from(v: f64) -> Expression<T>
fn from(v: f64) -> Expression<T>
Converts to this type from the input type.
sourceimpl<T: Clone> From<i32> for Expression<T>
impl<T: Clone> From<i32> for Expression<T>
sourcefn from(v: i32) -> Expression<T>
fn from(v: i32) -> Expression<T>
Converts to this type from the input type.
sourceimpl<T: Clone> From<u32> for Expression<T>
impl<T: Clone> From<u32> for Expression<T>
sourcefn from(v: u32) -> Expression<T>
fn from(v: u32) -> Expression<T>
Converts to this type from the input type.
sourceimpl<T: Hash> Hash for Expression<T>
impl<T: Hash> Hash for Expression<T>
sourceimpl<T: Clone> Mul<Expression<T>> for f32
impl<T: Clone> Mul<Expression<T>> for f32
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the *
operator.
sourcefn mul(self, e: Expression<T>) -> Expression<T>
fn mul(self, e: Expression<T>) -> Expression<T>
Performs the *
operation. Read more
sourceimpl<T: Clone> Mul<Expression<T>> for f64
impl<T: Clone> Mul<Expression<T>> for f64
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the *
operator.
sourcefn mul(self, e: Expression<T>) -> Expression<T>
fn mul(self, e: Expression<T>) -> Expression<T>
Performs the *
operation. Read more
sourceimpl<T: Clone> Mul<Expression<T>> for i32
impl<T: Clone> Mul<Expression<T>> for i32
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the *
operator.
sourcefn mul(self, e: Expression<T>) -> Expression<T>
fn mul(self, e: Expression<T>) -> Expression<T>
Performs the *
operation. Read more
sourceimpl<T: Clone> Mul<Expression<T>> for u32
impl<T: Clone> Mul<Expression<T>> for u32
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the *
operator.
sourcefn mul(self, e: Expression<T>) -> Expression<T>
fn mul(self, e: Expression<T>) -> Expression<T>
Performs the *
operation. Read more
sourceimpl<T: Clone> Mul<f32> for Expression<T>
impl<T: Clone> Mul<f32> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the *
operator.
sourcefn mul(self, v: f32) -> Expression<T>
fn mul(self, v: f32) -> Expression<T>
Performs the *
operation. Read more
sourceimpl<T: Clone> Mul<f64> for Expression<T>
impl<T: Clone> Mul<f64> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the *
operator.
sourcefn mul(self, v: f64) -> Expression<T>
fn mul(self, v: f64) -> Expression<T>
Performs the *
operation. Read more
sourceimpl<T: Clone> Mul<i32> for Expression<T>
impl<T: Clone> Mul<i32> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the *
operator.
sourcefn mul(self, v: i32) -> Expression<T>
fn mul(self, v: i32) -> Expression<T>
Performs the *
operation. Read more
sourceimpl<T: Clone> Mul<u32> for Expression<T>
impl<T: Clone> Mul<u32> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the *
operator.
sourcefn mul(self, v: u32) -> Expression<T>
fn mul(self, v: u32) -> Expression<T>
Performs the *
operation. Read more
sourceimpl<T: Clone> MulAssign<f32> for Expression<T>
impl<T: Clone> MulAssign<f32> for Expression<T>
sourcefn mul_assign(&mut self, v: f32)
fn mul_assign(&mut self, v: f32)
Performs the *=
operation. Read more
sourceimpl<T: Clone> MulAssign<f64> for Expression<T>
impl<T: Clone> MulAssign<f64> for Expression<T>
sourcefn mul_assign(&mut self, v: f64)
fn mul_assign(&mut self, v: f64)
Performs the *=
operation. Read more
sourceimpl<T: Clone> MulAssign<i32> for Expression<T>
impl<T: Clone> MulAssign<i32> for Expression<T>
sourcefn mul_assign(&mut self, v: i32)
fn mul_assign(&mut self, v: i32)
Performs the *=
operation. Read more
sourceimpl<T: Clone> MulAssign<u32> for Expression<T>
impl<T: Clone> MulAssign<u32> for Expression<T>
sourcefn mul_assign(&mut self, v: u32)
fn mul_assign(&mut self, v: u32)
Performs the *=
operation. Read more
sourceimpl<T: Clone> Neg for Expression<T>
impl<T: Clone> Neg for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the -
operator.
sourcefn neg(self) -> Expression<T>
fn neg(self) -> Expression<T>
Performs the unary -
operation. Read more
sourceimpl<T: PartialEq> PartialEq<Expression<T>> for Expression<T>
impl<T: PartialEq> PartialEq<Expression<T>> for Expression<T>
sourcefn eq(&self, other: &Expression<T>) -> bool
fn eq(&self, other: &Expression<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl<T: Clone> Sub<Expression<T>> for Expression<T>
impl<T: Clone> Sub<Expression<T>> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the -
operator.
sourcefn sub(self, e: Expression<T>) -> Expression<T>
fn sub(self, e: Expression<T>) -> Expression<T>
Performs the -
operation. Read more
sourceimpl<T: Clone> Sub<Expression<T>> for Term<T>
impl<T: Clone> Sub<Expression<T>> for Term<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the -
operator.
sourcefn sub(self, e: Expression<T>) -> Expression<T>
fn sub(self, e: Expression<T>) -> Expression<T>
Performs the -
operation. Read more
sourceimpl<T: Clone> Sub<Expression<T>> for f32
impl<T: Clone> Sub<Expression<T>> for f32
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the -
operator.
sourcefn sub(self, e: Expression<T>) -> Expression<T>
fn sub(self, e: Expression<T>) -> Expression<T>
Performs the -
operation. Read more
sourceimpl<T: Clone> Sub<Expression<T>> for f64
impl<T: Clone> Sub<Expression<T>> for f64
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the -
operator.
sourcefn sub(self, e: Expression<T>) -> Expression<T>
fn sub(self, e: Expression<T>) -> Expression<T>
Performs the -
operation. Read more
sourceimpl<T: Clone> Sub<Expression<T>> for i32
impl<T: Clone> Sub<Expression<T>> for i32
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the -
operator.
sourcefn sub(self, e: Expression<T>) -> Expression<T>
fn sub(self, e: Expression<T>) -> Expression<T>
Performs the -
operation. Read more
sourceimpl<T: Clone> Sub<Expression<T>> for u32
impl<T: Clone> Sub<Expression<T>> for u32
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the -
operator.
sourcefn sub(self, e: Expression<T>) -> Expression<T>
fn sub(self, e: Expression<T>) -> Expression<T>
Performs the -
operation. Read more
sourceimpl Sub<Expression<Variable>> for Variable
impl Sub<Expression<Variable>> for Variable
type Output = Expression<Variable>
type Output = Expression<Variable>
The resulting type after applying the -
operator.
sourcefn sub(self, e: Expression<Variable>) -> Expression<Variable>
fn sub(self, e: Expression<Variable>) -> Expression<Variable>
Performs the -
operation. Read more
sourceimpl<T> Sub<Term<T>> for Expression<T>
impl<T> Sub<Term<T>> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the -
operator.
sourcefn sub(self, t: Term<T>) -> Expression<T>
fn sub(self, t: Term<T>) -> Expression<T>
Performs the -
operation. Read more
sourceimpl Sub<Variable> for Expression<Variable>
impl Sub<Variable> for Expression<Variable>
type Output = Expression<Variable>
type Output = Expression<Variable>
The resulting type after applying the -
operator.
sourceimpl<T> Sub<f32> for Expression<T>
impl<T> Sub<f32> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the -
operator.
sourcefn sub(self, v: f32) -> Expression<T>
fn sub(self, v: f32) -> Expression<T>
Performs the -
operation. Read more
sourceimpl<T> Sub<f64> for Expression<T>
impl<T> Sub<f64> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the -
operator.
sourcefn sub(self, v: f64) -> Expression<T>
fn sub(self, v: f64) -> Expression<T>
Performs the -
operation. Read more
sourceimpl<T> Sub<i32> for Expression<T>
impl<T> Sub<i32> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the -
operator.
sourcefn sub(self, v: i32) -> Expression<T>
fn sub(self, v: i32) -> Expression<T>
Performs the -
operation. Read more
sourceimpl<T> Sub<u32> for Expression<T>
impl<T> Sub<u32> for Expression<T>
type Output = Expression<T>
type Output = Expression<T>
The resulting type after applying the -
operator.
sourcefn sub(self, v: u32) -> Expression<T>
fn sub(self, v: u32) -> Expression<T>
Performs the -
operation. Read more
sourceimpl<T: Clone> SubAssign<Expression<T>> for Expression<T>
impl<T: Clone> SubAssign<Expression<T>> for Expression<T>
sourcefn sub_assign(&mut self, e: Expression<T>)
fn sub_assign(&mut self, e: Expression<T>)
Performs the -=
operation. Read more
sourceimpl<T> SubAssign<Term<T>> for Expression<T>
impl<T> SubAssign<Term<T>> for Expression<T>
sourcefn sub_assign(&mut self, t: Term<T>)
fn sub_assign(&mut self, t: Term<T>)
Performs the -=
operation. Read more
sourceimpl SubAssign<Variable> for Expression<Variable>
impl SubAssign<Variable> for Expression<Variable>
sourcefn sub_assign(&mut self, v: Variable)
fn sub_assign(&mut self, v: Variable)
Performs the -=
operation. Read more
sourceimpl<T> SubAssign<f32> for Expression<T>
impl<T> SubAssign<f32> for Expression<T>
sourcefn sub_assign(&mut self, v: f32)
fn sub_assign(&mut self, v: f32)
Performs the -=
operation. Read more
sourceimpl<T> SubAssign<f64> for Expression<T>
impl<T> SubAssign<f64> for Expression<T>
sourcefn sub_assign(&mut self, v: f64)
fn sub_assign(&mut self, v: f64)
Performs the -=
operation. Read more
sourceimpl<T> SubAssign<i32> for Expression<T>
impl<T> SubAssign<i32> for Expression<T>
sourcefn sub_assign(&mut self, v: i32)
fn sub_assign(&mut self, v: i32)
Performs the -=
operation. Read more
sourceimpl<T> SubAssign<u32> for Expression<T>
impl<T> SubAssign<u32> for Expression<T>
sourcefn sub_assign(&mut self, v: u32)
fn sub_assign(&mut self, v: u32)
Performs the -=
operation. Read more
impl<T: Eq> Eq for Expression<T>
impl<T> StructuralEq for Expression<T>
impl<T> StructuralPartialEq for Expression<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Expression<T> where
T: RefUnwindSafe,
impl<T> Send for Expression<T> where
T: Send,
impl<T> Sync for Expression<T> where
T: Sync,
impl<T> Unpin for Expression<T> where
T: Unpin,
impl<T> UnwindSafe for Expression<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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