AMPL_CONSTRAINTINSTANCE#

group AMPL_CONSTRAINTINSTANCE

Functions for constraint instances:

Functions

AMPL_ERRORINFO *AMPL_ConstraintInstanceSetDual(AMPL *ampl, const char *entityname, AMPL_TUPLE *index, double dual)#

Set the value of the dual variable associated to this constraint.

Equivalent to the AMPL statement:

let c := dual;

Note that dual values are often reset by the underlying AMPL interpreter by the presolve functionalities triggered by some methods. A possible workaround is to set the option presolve to 0.0 (see AMPL_SetDblOption()).

Parameters:
  • ampl – Pointer to the AMPL struct.

  • entityname – Name of constraint instance as string.

  • index – Index of instance as tuple.

  • dual – The value to be assigned to the dual variable.

Returns:

Pointer to the AMPL_ERRORINFO struct.