Expand description
§oximo-macros
Internal procedural macros backing oximo’s modeling surface:
variable!, constraint!, soc_constraint!, objective!, sum!, set!,
and param!.
This crate is an implementation detail, do not depend on it directly.
The macros are re-exported through oximo-core and oximo::prelude, which is the
supported entry point:
ⓘ
use oximo::prelude::*;The macros expand to the typed builder API in oximo-core (Model, Set,
Expr, sum_over, …). See the oximo crate docs for the macro grammar and examples.
Macros§
- constraint
constraint!(model, [name|name[idx]], lhs <op> rhs), register a constraint, an auto-named anonymous constraint, or an indexed family of constraints.- objective
objective!(model, Min|Max, expr), set the model objective and sense.objective!(model, Feasibility)(alsofeasibility/feas) declares a feasibility problem with no objective to optimize.- param
param!(model, name = value), declare a re-bindable scalar parameter and bind it to a local of the same name.- set
set!(name = domain), bind a local to an indexSet. A plain right side (0..5,a * b) is normalized to an owned set (a top-level*is a borrowing Cartesian product). Apat in domain[ if cond]comprehension builds (and optionally filters) the set. See the crate docs.- soc_
constraint soc_constraint!(model, [name|name = expr|name[idx]], [terms] <= bound), register the second-order cone constraint||terms||_2 <= bound(every term and the bound must be affine), an auto-named anonymous cone, or an indexed family of cones.- sum
sum!(body for pat in domain[, pat in domain ...]), algebraic summation, lowered to nestedsum_overfolds.- variable
variable!(model, spec), declare a decision variable (or an indexed family) and bind it to a local of the same name. See the crate docs for the grammar.