gtopt/user_model_lp.hpp file

LP representation of a UserModel (generic AMPL capture) element.

A UserModel bundles a set of user variable declarations (cols) + user constraint declarations (rows) into ONE element and captures the named ones to the solution under output/UserModel/<tag>/{sol,cost,dual,slack}.

UserModelLP REUSES the existing element machinery rather than forking it: it owns one internal DecisionVariableLP per declared variable and one internal UserConstraintLP per declared constraint, and delegates the LP build to them verbatim — so the shared expr resolver, the add_ampl_variable routing, the silent_flatten_pass() rebuild gate, the soft-slack folding, the scope routing (block|stage|phase|global) and the aux-col lowering are the SAME code paths as the standalone elements. Only the OUTPUT is re-namespaced: add_to_output reads each delegate's col/row holders (via the additive read-only getters) and emits them under the model's tag instead of the delegates' own DecisionVariable/ / UserConstraint/ directories.

UserConstraint / DecisionVariable are UNCHANGED — irrigation keeps using them as standalone elements.

Namespaces

namespace gtopt

Classes

class gtopt::UserModelLP