ensure_mats_and_parsed#
- ams.opt.optzbase.ensure_mats_and_parsed(func)[source]#
Decorator to ensure that system matrices are built and the OModel is parsed before evaluation. If not, it runs the necessary methods to initialize them.
Designed to be used on the evaluate method of optimization elements (OptzBase) and the optimization model (OModel), i.e., Var, Param, Constraint, Objective, and ExpressionCalc.
Evaluation before building matrices and parsing the OModel can lead to errors. Ensure that system matrices are built and the OModel is parsed before calling the evaluate method.