Struct cassowary::Expression [] [src]

pub struct Expression {
    pub terms: Vec<Term>,
    pub constant: f64,
}

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

Methods

impl Expression
[src]

Constructs an expression of the form n, where n is a constant real number, not a variable.

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.

General constructor. Each Term in terms is part of the sum forming the expression, as well as constant.

Mutates this expression by multiplying it by minus one.

Trait Implementations

impl BitOr<WeightedRelation> for Expression
[src]

The resulting type after applying the | operator.

Performs the | operation.

impl BitOr<Expression> for PartialConstraint
[src]

The resulting type after applying the | operator.

Performs the | operation.

impl Add<Expression> for Variable
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Add<Variable> for Expression
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl AddAssign<Variable> for Expression
[src]

Performs the += operation.

impl Sub<Expression> for Variable
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Sub<Variable> for Expression
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl SubAssign<Variable> for Expression
[src]

Performs the -= operation.

impl Add<Expression> for Term
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Add<Term> for Expression
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl AddAssign<Term> for Expression
[src]

Performs the += operation.

impl Sub<Expression> for Term
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Sub<Term> for Expression
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl SubAssign<Term> for Expression
[src]

Performs the -= operation.

impl Mul<f64> for Expression
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl MulAssign<f64> for Expression
[src]

Performs the *= operation.

impl Mul<f32> for Expression
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl MulAssign<f32> for Expression
[src]

Performs the *= operation.

impl Mul<Expression> for f64
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Expression> for f32
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Div<f64> for Expression
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl DivAssign<f64> for Expression
[src]

Performs the /= operation.

impl Div<f32> for Expression
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl DivAssign<f32> for Expression
[src]

Performs the /= operation.

impl Add<f64> for Expression
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl AddAssign<f64> for Expression
[src]

Performs the += operation.

impl Add<f32> for Expression
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl AddAssign<f32> for Expression
[src]

Performs the += operation.

impl Add<Expression> for f64
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Add<Expression> for f32
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Add<Expression> for Expression
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl AddAssign<Expression> for Expression
[src]

Performs the += operation.

impl Neg for Expression
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl Sub<f64> for Expression
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl SubAssign<f64> for Expression
[src]

Performs the -= operation.

impl Sub<f32> for Expression
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl SubAssign<f32> for Expression
[src]

Performs the -= operation.

impl Sub<Expression> for f64
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Sub<Expression> for f32
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Sub<Expression> for Expression
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl SubAssign<Expression> for Expression
[src]

Performs the -= operation.

impl Clone for Expression
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Expression
[src]

Formats the value using the given formatter. Read more

impl From<f64> for Expression
[src]

Performs the conversion.

impl From<Variable> for Expression
[src]

Performs the conversion.

impl From<Term> for Expression
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for Expression

impl Sync for Expression