[ library(eplex) | Reference Manual | Alphabetic Index ]

eplex_add_constraints(+Constraints,+Integers)

EplexInstance: eplex_add_constraints(+Constraints,+Integers)

Add new constraints to the eplex instance EplexInstance, possibly triggering it.
Constraints
A (possibly empty) list of equality or inequality constraints
Integers
A (possibly empty) list of variables to be considered as integers

Description

Add new constraints (with possibly new variables) to the eplex instance EplexInstance. Cstrs is a list of equality or inequality constraints; NewIntegers is a list of (possibly new) variables that should be consider as integers This is logically the same as posting the constraints one by one to the solver, but it may be more convenient if the constraints are already collected as a list.

Operationally, if a solver state has been associated with the eplex instance, the constraints are added to the solver state in one go. For some solvers, this can be more efficient than adding the constraints incrementally.

If the new_constraint trigger option was selected, then the solver will be invoked after the adding of the constraints if these constraints are not already satisfied. The constraints will be removed on backtracking.

The constraints are normalised and simplified before being passed to the external solver. If any constraint is ground, they are tested for consistency.

The constraints can be linear equalities and inequalities, sos/1 and sos2/1 constraints, and =≥/2 indicator constraints.

Note that variables in NewIntegers can be any problem variables. In previous versions of ECLiPSe, there was a restriction that the variables be new problem variables; this restriction has been removed.

Fail Conditions

Any ground (no variable) or bound constraints (one variable) is self-inconsistent.

Resatisfiable

no

Exceptions

(4) instantiation fault
Constraints or Integers uninstantiated.
(5) type error
Some constraint in Constraints is non-linear.
(40) stale object handle
Solver state had been previously destroyed.

See Also

lp_add_constraints / 3, lp_demon_setup / 5, lp_add / 3, lp_add_constraints / 4, $= / 2, $=< / 2, $>= / 2, =:= / 2, =< / 2, >= / 2, sos1 / 1, sos2 / 1, => / 2