Enum descent::expr::Expression

source ·
pub enum Expression {
    ExprFix(ExprFix),
    ExprFixSum(ExprFixSum),
    ExprDyn(ExprDyn),
    ExprDynSum(ExprDynSum),
}
Expand description

Most general representation of an expression.

This wraps up fixed and dynamic types of expressions and their respective summation forms. The user typically doesn’t directly need to care about this type unless they want a way to easily store different types of expressions in the same collection. See the fixed or dynam sub-modules for details about constructing and working with expressions.

Only a few methods are implemented directly for this type. More could be developed to provide a cleaner interface to solvers.

Variants

ExprFix(ExprFix)

ExprFixSum(ExprFixSum)

ExprDyn(ExprDyn)

ExprDynSum(ExprDynSum)

Implementations

Iterate over variables that we want to treat as linear.

Implemtation assumes all varialbes in ExprFix are non-linear, because it will have minimal extra overhead doing so.

Iterate over variables that we want to treat as non-linear.

Can contain variables at that are actually linear if we don’t want special treatment for them.

Number of entries calculated for first derivative.

These will typically be the non-zeros but not necessarily. Also, one variable could be accounted for twice if one of the summation types.

Number of entries calculated for second derivative.

These will typically be the non-zeros but not necessarily. Also, pairs of variables could be accounted for twice if one of the summation types.

Trait Implementations

Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.