Change the problem object

Tells how to modify a problem in the C API.

In analyzing a given mathematical program, you may make changes in a model and study their effect. As you make such changes, you must keep CPLEX informed about the modifications so that  CPLEX can efficiently re-optimize your changed problem. Always use the problem modification routines from the Callable Library to make such changes and thus keep CPLEX informed. In other words, do not change a problem by altering the original data arrays and calling CPXcopylp again. That tempting strategy usually will not make the best use of CPLEX. Instead, modify your problem by means of the problem modification routines.

Use the routines whose names begin with CPXchg to modify existing objects in the model, or use the routines CPXaddcols, CPXaddqconstr, CPXaddrows, CPXnewcols, and CPXnewrows to add new constraints and new variables to the model.

For example, let’s say a user has already solved a given LP problem and then changes the upper bound on a variable by means of an appropriate call to the Callable Library routine CPXchgbds. CPLEX will then begin any further optimization from the previous optimal basis. If that basis is still optimal with respect to the new bound, then CPLEX will return that information without even needing to refactor the basis.