CPXXchgobj and CPXchgobj

The routine CPXXchgobj/CPXchgobj changes the linear objective coefficients of a set of variables in a CPLEX problem object.

int  CPXXchgobj( CPXCENVptr env, CPXLPptr lp, CPXDIM cnt, CPXDIM const * indices, double const * values )

int  CPXchgobj( CPXCENVptr env, CPXLPptr lp, int cnt, int const * indices, double const * values )

Description

The routine CPXXchgobj/CPXchgobj changes the linear objective coefficients of a set of variables in a CPLEX problem object.

Arguments

env
A pointer to the CPLEX environment as returned by CPXXopenCPLEX/CPXopenCPLEX.
lp
A pointer to a CPLEX problem object as returned by CPXXcreateprob/CPXcreateprob.
cnt
An integer that specifies the total number of objective coefficients to be changed, and thus specifies the length of the arrays indices and values.
indices
An array of length cnt containing the numeric indices of the columns corresponding to the variables for which objective coefficients are to be changed.
values
An array of length cnt containing the new values of the objective coefficients of the variables specified in indices.

Return

The routine returns 0 (zero) if successful and nonzero if an error occurs.

Example


status = CPXchgobj (env, lp, cnt, indices, values);