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
Implementations
sourceimpl Expression
impl Expression
sourcepub fn lin_iter<'a>(&'a self) -> Box<dyn Iterator<Item = ID> + 'a>
pub fn lin_iter<'a>(&'a self) -> Box<dyn Iterator<Item = ID> + 'a>
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.
sourcepub fn nlin_iter<'a>(&'a self) -> Box<dyn Iterator<Item = ID> + 'a>
pub fn nlin_iter<'a>(&'a self) -> Box<dyn Iterator<Item = ID> + 'a>
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.