Struct cassowary::Expression
[−]
[src]
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>
constant: f64
Methods
impl Expression[src]
impl Expressionpub fn from_constant(v: f64) -> Expression[src]
pub fn from_constant(v: f64) -> ExpressionConstructs an expression of the form n, where n is a constant real number, not a variable.
pub fn from_term(term: Term) -> Expression[src]
pub fn from_term(term: Term) -> ExpressionConstructs an expression from a single term. Forms an expression of the form n x where n is the coefficient, and x is the variable.
pub fn new(terms: Vec<Term>, constant: f64) -> Expression[src]
pub fn new(terms: Vec<Term>, constant: f64) -> ExpressionGeneral constructor. Each Term in terms is part of the sum forming the expression, as well as constant.
pub fn negate(&mut self)[src]
pub fn negate(&mut self)Mutates this expression by multiplying it by minus one.
Trait Implementations
impl BitOr<WeightedRelation> for Expression[src]
impl BitOr<WeightedRelation> for Expressiontype Output = PartialConstraint
The resulting type after applying the | operator.
fn bitor(self, r: WeightedRelation) -> PartialConstraint[src]
fn bitor(self, r: WeightedRelation) -> PartialConstraintPerforms the | operation.
impl BitOr<Expression> for PartialConstraint[src]
impl BitOr<Expression> for PartialConstrainttype Output = Constraint
The resulting type after applying the | operator.
fn bitor(self, rhs: Expression) -> Constraint[src]
fn bitor(self, rhs: Expression) -> ConstraintPerforms the | operation.
impl Add<Expression> for Variable[src]
impl Add<Expression> for Variabletype Output = Expression
The resulting type after applying the + operator.
fn add(self, e: Expression) -> Expression[src]
fn add(self, e: Expression) -> ExpressionPerforms the + operation.
impl Add<Variable> for Expression[src]
impl Add<Variable> for Expressiontype Output = Expression
The resulting type after applying the + operator.
fn add(self, v: Variable) -> Expression[src]
fn add(self, v: Variable) -> ExpressionPerforms the + operation.
impl AddAssign<Variable> for Expression[src]
impl AddAssign<Variable> for Expressionfn add_assign(&mut self, v: Variable)[src]
fn add_assign(&mut self, v: Variable)Performs the += operation.
impl Sub<Expression> for Variable[src]
impl Sub<Expression> for Variabletype Output = Expression
The resulting type after applying the - operator.
fn sub(self, e: Expression) -> Expression[src]
fn sub(self, e: Expression) -> ExpressionPerforms the - operation.
impl Sub<Variable> for Expression[src]
impl Sub<Variable> for Expressiontype Output = Expression
The resulting type after applying the - operator.
fn sub(self, v: Variable) -> Expression[src]
fn sub(self, v: Variable) -> ExpressionPerforms the - operation.
impl SubAssign<Variable> for Expression[src]
impl SubAssign<Variable> for Expressionfn sub_assign(&mut self, v: Variable)[src]
fn sub_assign(&mut self, v: Variable)Performs the -= operation.
impl Add<Expression> for Term[src]
impl Add<Expression> for Termtype Output = Expression
The resulting type after applying the + operator.
fn add(self, e: Expression) -> Expression[src]
fn add(self, e: Expression) -> ExpressionPerforms the + operation.
impl Add<Term> for Expression[src]
impl Add<Term> for Expressiontype Output = Expression
The resulting type after applying the + operator.
fn add(self, t: Term) -> Expression[src]
fn add(self, t: Term) -> ExpressionPerforms the + operation.
impl AddAssign<Term> for Expression[src]
impl AddAssign<Term> for Expressionfn add_assign(&mut self, t: Term)[src]
fn add_assign(&mut self, t: Term)Performs the += operation.
impl Sub<Expression> for Term[src]
impl Sub<Expression> for Termtype Output = Expression
The resulting type after applying the - operator.
fn sub(self, e: Expression) -> Expression[src]
fn sub(self, e: Expression) -> ExpressionPerforms the - operation.
impl Sub<Term> for Expression[src]
impl Sub<Term> for Expressiontype Output = Expression
The resulting type after applying the - operator.
fn sub(self, t: Term) -> Expression[src]
fn sub(self, t: Term) -> ExpressionPerforms the - operation.
impl SubAssign<Term> for Expression[src]
impl SubAssign<Term> for Expressionfn sub_assign(&mut self, t: Term)[src]
fn sub_assign(&mut self, t: Term)Performs the -= operation.
impl Mul<f64> for Expression[src]
impl Mul<f64> for Expressiontype Output = Expression
The resulting type after applying the * operator.
fn mul(self, v: f64) -> Expression[src]
fn mul(self, v: f64) -> ExpressionPerforms the * operation.
impl MulAssign<f64> for Expression[src]
impl MulAssign<f64> for Expressionfn mul_assign(&mut self, v: f64)[src]
fn mul_assign(&mut self, v: f64)Performs the *= operation.
impl Mul<f32> for Expression[src]
impl Mul<f32> for Expressiontype Output = Expression
The resulting type after applying the * operator.
fn mul(self, v: f32) -> Expression[src]
fn mul(self, v: f32) -> ExpressionPerforms the * operation.
impl MulAssign<f32> for Expression[src]
impl MulAssign<f32> for Expressionfn mul_assign(&mut self, v: f32)[src]
fn mul_assign(&mut self, v: f32)Performs the *= operation.
impl Mul<Expression> for f64[src]
impl Mul<Expression> for f64type Output = Expression
The resulting type after applying the * operator.
fn mul(self, e: Expression) -> Expression[src]
fn mul(self, e: Expression) -> ExpressionPerforms the * operation.
impl Mul<Expression> for f32[src]
impl Mul<Expression> for f32type Output = Expression
The resulting type after applying the * operator.
fn mul(self, e: Expression) -> Expression[src]
fn mul(self, e: Expression) -> ExpressionPerforms the * operation.
impl Div<f64> for Expression[src]
impl Div<f64> for Expressiontype Output = Expression
The resulting type after applying the / operator.
fn div(self, v: f64) -> Expression[src]
fn div(self, v: f64) -> ExpressionPerforms the / operation.
impl DivAssign<f64> for Expression[src]
impl DivAssign<f64> for Expressionfn div_assign(&mut self, v: f64)[src]
fn div_assign(&mut self, v: f64)Performs the /= operation.
impl Div<f32> for Expression[src]
impl Div<f32> for Expressiontype Output = Expression
The resulting type after applying the / operator.
fn div(self, v: f32) -> Expression[src]
fn div(self, v: f32) -> ExpressionPerforms the / operation.
impl DivAssign<f32> for Expression[src]
impl DivAssign<f32> for Expressionfn div_assign(&mut self, v: f32)[src]
fn div_assign(&mut self, v: f32)Performs the /= operation.
impl Add<f64> for Expression[src]
impl Add<f64> for Expressiontype Output = Expression
The resulting type after applying the + operator.
fn add(self, v: f64) -> Expression[src]
fn add(self, v: f64) -> ExpressionPerforms the + operation.
impl AddAssign<f64> for Expression[src]
impl AddAssign<f64> for Expressionfn add_assign(&mut self, v: f64)[src]
fn add_assign(&mut self, v: f64)Performs the += operation.
impl Add<f32> for Expression[src]
impl Add<f32> for Expressiontype Output = Expression
The resulting type after applying the + operator.
fn add(self, v: f32) -> Expression[src]
fn add(self, v: f32) -> ExpressionPerforms the + operation.
impl AddAssign<f32> for Expression[src]
impl AddAssign<f32> for Expressionfn add_assign(&mut self, v: f32)[src]
fn add_assign(&mut self, v: f32)Performs the += operation.
impl Add<Expression> for f64[src]
impl Add<Expression> for f64type Output = Expression
The resulting type after applying the + operator.
fn add(self, e: Expression) -> Expression[src]
fn add(self, e: Expression) -> ExpressionPerforms the + operation.
impl Add<Expression> for f32[src]
impl Add<Expression> for f32type Output = Expression
The resulting type after applying the + operator.
fn add(self, e: Expression) -> Expression[src]
fn add(self, e: Expression) -> ExpressionPerforms the + operation.
impl Add<Expression> for Expression[src]
impl Add<Expression> for Expressiontype Output = Expression
The resulting type after applying the + operator.
fn add(self, e: Expression) -> Expression[src]
fn add(self, e: Expression) -> ExpressionPerforms the + operation.
impl AddAssign<Expression> for Expression[src]
impl AddAssign<Expression> for Expressionfn add_assign(&mut self, e: Expression)[src]
fn add_assign(&mut self, e: Expression)Performs the += operation.
impl Neg for Expression[src]
impl Neg for Expressiontype Output = Expression
The resulting type after applying the - operator.
fn neg(self) -> Expression[src]
fn neg(self) -> ExpressionPerforms the unary - operation.
impl Sub<f64> for Expression[src]
impl Sub<f64> for Expressiontype Output = Expression
The resulting type after applying the - operator.
fn sub(self, v: f64) -> Expression[src]
fn sub(self, v: f64) -> ExpressionPerforms the - operation.
impl SubAssign<f64> for Expression[src]
impl SubAssign<f64> for Expressionfn sub_assign(&mut self, v: f64)[src]
fn sub_assign(&mut self, v: f64)Performs the -= operation.
impl Sub<f32> for Expression[src]
impl Sub<f32> for Expressiontype Output = Expression
The resulting type after applying the - operator.
fn sub(self, v: f32) -> Expression[src]
fn sub(self, v: f32) -> ExpressionPerforms the - operation.
impl SubAssign<f32> for Expression[src]
impl SubAssign<f32> for Expressionfn sub_assign(&mut self, v: f32)[src]
fn sub_assign(&mut self, v: f32)Performs the -= operation.
impl Sub<Expression> for f64[src]
impl Sub<Expression> for f64type Output = Expression
The resulting type after applying the - operator.
fn sub(self, e: Expression) -> Expression[src]
fn sub(self, e: Expression) -> ExpressionPerforms the - operation.
impl Sub<Expression> for f32[src]
impl Sub<Expression> for f32type Output = Expression
The resulting type after applying the - operator.
fn sub(self, e: Expression) -> Expression[src]
fn sub(self, e: Expression) -> ExpressionPerforms the - operation.
impl Sub<Expression> for Expression[src]
impl Sub<Expression> for Expressiontype Output = Expression
The resulting type after applying the - operator.
fn sub(self, e: Expression) -> Expression[src]
fn sub(self, e: Expression) -> ExpressionPerforms the - operation.
impl SubAssign<Expression> for Expression[src]
impl SubAssign<Expression> for Expressionfn sub_assign(&mut self, e: Expression)[src]
fn sub_assign(&mut self, e: Expression)Performs the -= operation.
impl Clone for Expression[src]
impl Clone for Expressionfn clone(&self) -> Expression[src]
fn clone(&self) -> ExpressionReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Expression[src]
impl Debug for Expressionfn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
fn fmt(&self, __arg_0: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl From<f64> for Expression[src]
impl From<f64> for Expressionfn from(v: f64) -> Expression[src]
fn from(v: f64) -> ExpressionPerforms the conversion.
impl From<Variable> for Expression[src]
impl From<Variable> for Expressionfn from(v: Variable) -> Expression[src]
fn from(v: Variable) -> ExpressionPerforms the conversion.
impl From<Term> for Expression[src]
impl From<Term> for Expressionfn from(t: Term) -> Expression[src]
fn from(t: Term) -> ExpressionPerforms the conversion.
Auto Trait Implementations
impl Send for Expression
impl Send for Expressionimpl Sync for Expression
impl Sync for Expression