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]

[src]

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

[src]

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.

[src]

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

[src]

Mutates this expression by multiplying it by minus one.

Trait Implementations

impl BitOr<WeightedRelation> for Expression
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl Add<Variable> for Expression
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Sub<Variable> for Expression
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl Add<Term> for Expression
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Sub<Term> for Expression
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl Mul<f64> for Expression
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<f32> for Expression
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Div<f64> for Expression
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<f32> for Expression
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Add<f64> for Expression
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Add<f32> for Expression
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Add<Expression> for Expression
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Neg for Expression
[src]

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

impl Sub<f64> for Expression
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl Sub<f32> for Expression
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl Sub<Expression> for Expression
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl Clone for Expression
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Expression
[src]

[src]

Formats the value using the given formatter.

impl From<f64> for Expression
[src]

[src]

Performs the conversion.

impl From<Variable> for Expression
[src]

[src]

Performs the conversion.

impl From<Term> for Expression
[src]

[src]

Performs the conversion.