CPXXmultiobjsetobj and CPXmultiobjsetobj

The routine CPXXmultiobjsetobj/CPXmultiobjsetobj sets the specified objective of the CPLEX problem object.

int   CPXXmultiobjsetobj( CPXCENVptr env, CPXLPptr lp, CPXDIM n, CPXDIM objnz, CPXDIM const * objind, double const * objval, double const  offset, double const  weight, CPXDIM const  priority, double const  abstol, double const  reltol, char const *  objname)

int   CPXmultiobjsetobj( CPXCENVptr env, CPXLPptr lp, int n, int objnz, int const * objind, double const * objval, double const  offset, double const  weight, int const  priority, double const  abstol, double const  reltol, char const *  objname)

Description

The routine CPXXmultiobjsetobj/CPXmultiobjsetobj sets the specified objective of the CPLEX problem object. The objective to be set is specified by the argument n which must be in the interval [0,CPXXgetnumobj(env,lp)-1]. The number of nonzero coefficients in the objective, the nonzero coefficients themselves, and the variable indices they correspond to are specified in objnz, objval, and n. The rest of the arguments specify the other attributes of the objective.

Note:

The objective coefficient of the variables whose index is not present in objind, is set to 0.

For more details on multiobjective optimization in CPLEX, see Multiobjective optimization in the CPLEX User's Manual and Multiobjective optimization for related Callable Library functions.

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.
n
An integer that specifies the objective to be set.
objnz
An integer that specifies the number of nonzero objective coefficients in the objective to be set. This specifies the length of the arrays objind and objval.
objind
The indices of the variables whose objective coefficient is nonzero in the objective to be set. This argument can be NULL if objnz is 0 (zero).
objval
The nonzero coefficients in the objective to be set. This argument can be NULL if objnz is 0 (zero).
offset
The constant term associated with the objective function. Specify 0 if no such term exists.
weight
The weight of the objective to be set.
priority
The priority of the objective to be set.
abstol
A double number that should be the new absolute tolerance of the objective. Pass in CPX_NO_ABSTOL_CHANGE to leave the absolute tolerance unchanged. When specifying a new value, the same limits apply as with the CPXPARAM_MIP_Tolerances_AbsMIPGap parameter. See the section on Specifying multiple objective problems in the CPLEX User's Manual for the details on the meaning of this tolerance.
reltol
A double number that should be the new relative tolerance of the objective. Pass in CPX_NO_RELTOL_CHANGE to leave the relative tolerance unchanged. When specifying a new value, the same limits apply as with the CPXPARAM_MIP_Tolerances_MIPGap parameter. Note that a nondefault setting of this parameter only applies to MIP multiobjective problems. See the section on Specifying multiple objective problems in the CPLEX User's Manual for the details on the meaning of this tolerance.
objname
A string representing the name of the objective to be set.

Return

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

Example


        status = CPXmultiobjsetobj (env, lp, n, objnz, objind, objval, offset,
                                     weight, priority, abstol, reltol, objname);
      

See also the example multiobjex1.c in the CPLEX User's Manual and in the standard distribution.