CPXXgetnumobjs and CPXgetnumobjs
The routine
CPXXgetnumobjs/CPXgetnumobjs
returns the number of objectives in the problem instance.
CPXDIM CPXXgetnumobjs( CPXCENVptr env, CPXCLPptr lp)
int CPXgetnumobjs( CPXCENVptr env, CPXCLPptr lp)
Description
The routine
CPXXgetnumobjs/CPXgetnumobjs
returns the number of objectives in the problem instance.
Note:
The number of objectives is always at least 1. Even an all-zero objective counts as an objective funtion.
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.
Return
If the CPLEX problem object or environment does not exist,CPXXgetnumobjs/CPXgetnumobjs
returns the value 0 (zero); otherwise, it returns the number
objectives in the problem instance.
Example
numobjectives = CPXgetnumobjs (env, lp);
See also the example multiobj.c in the
CPLEX User's Manual and in the standard distribution.