The routine `CPXchgcoef()`

is used to change a single coefficient in the constraint matrix, objective coefficients, right-hand side or ranges of a CPLEX problem object. The coefficient is specified using its coordinates in the constraint matrix. When changing matrix coefficients from zero to nonzero values, be sure that the corresponding row and column indices exist in the problem, so that `-1 `

` i < `

`CPXgetnumrows`

`(env,lp)`

and `-2 `

` j < `

`CPXgetnumcols`

`(env,lp)`

The routine returns a zero on success, and a nonzero if an error occurs.

int |

The pointer to the CPLEX environment as returned by `CPXopenCPLEX()`

.

A pointer to a CPLEX problem object as returned by `CPXcreateprob()`

.

The new value for the coefficient being changed.

status = CPXchgcoef (env, lp, 10, 15, 23.2); |