gtopt::UserConstraint struct

Stores a user-defined linear constraint expression.

The expression field contains the full constraint in AMPL-inspired syntax. It is parsed at LP construction time into a ConstraintExpr AST (see constraint_parser.hpp) and then applied to the LinearProblem.

<tt>constraint_type</tt> and dual-value scaling

The optional constraint_type field controls how the dual (shadow price) of the constraint row is scaled when written to the output files. When absent, "power" is assumed. See ConstraintScaleType for the full table.

ValueDual output scaling
"power" (default)scale_obj / (prob × discount × Δt)
"energy"scale_obj / (prob × discount × Δt)
"raw" / "unitless"scale_obj / discount

Public variables

OptBool active
Activation status (default: active)
OptName constraint_type
OptName description
Optional free-text description of the constraint.
Name expression
Constraint expression in AMPL-inspired syntax.
Name name
Human-readable constraint name.
Uid uid
Unique identifier.

Variable documentation

OptName gtopt::UserConstraint::constraint_type

Scaling hint: "power" (default), "energy", "raw", or "unitless"