Previous Page: CPXchgbdsFirst PageNext Page: CPXchgcoeflist

CPXchgcoef


Description

The routine CPXchgcoef() is used to change a single coefficient in the constraint matrix, objective coefficients, right-hand side or ranges of a LP 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.

Synopsis

int CPXchgcoef (CPXENVptr env,
                CPXLPptr lp,
                int i,
                int j,
                double newvalue);

Arguments


CPXENVptr env
The pointer to the CPLEX environment as returned by one of the CPXopenCPLEX routines.

CPXLPptr lp
A pointer to a CPLEX LP problem object as returned by CPXcreateprob().

int i
An integer that indicates the numerical index of the row in which the coefficient is located. The objective row is referenced with i = -1.

int j
An integer that indicates the numerical index of the column in which the coefficient is located. The RHS column is referenced with j = -1. The range value column is referenced with j = -2. If j = -2 is specified and row i is not a ranged row, an error status is returned.

double newvalue
The new value for the coefficient being changed.

Example

status = CPXchgcoef (env, lp, 10, 15, 23.2);
Previous Page: CPXchgbdsFirst PageNext Page: CPXchgcoeflist