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

The method for the | operator

impl Add<Variable> for Expression
[src]

The resulting type after applying the + operator

The method for the + operator

impl Sub<Variable> for Expression
[src]

The resulting type after applying the - operator

The method for the - operator

impl Add<Term> for Expression
[src]

The resulting type after applying the + operator

The method for the + operator

impl Sub<Term> for Expression
[src]

The resulting type after applying the - operator

The method for the - operator

impl Mul<f64> for Expression
[src]

The resulting type after applying the * operator

The method for the * operator

impl Mul<f32> for Expression
[src]

The resulting type after applying the * operator

The method for the * operator

impl Div<f64> for Expression
[src]

The resulting type after applying the / operator

The method for the / operator

impl Div<f32> for Expression
[src]

The resulting type after applying the / operator

The method for the / operator

impl Add<f64> for Expression
[src]

The resulting type after applying the + operator

The method for the + operator

impl Add<f32> for Expression
[src]

The resulting type after applying the + operator

The method for the + operator

impl Add<Expression> for Expression
[src]

The resulting type after applying the + operator

The method for the + operator

impl Neg for Expression
[src]

The resulting type after applying the - operator

The method for the unary - operator

impl Sub<f64> for Expression
[src]

The resulting type after applying the - operator

The method for the - operator

impl Sub<f32> for Expression
[src]

The resulting type after applying the - operator

The method for the - operator

impl Sub<Expression> for Expression
[src]

The resulting type after applying the - operator

The method for the - operator

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.

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.