The routine CPXbaropt() may be used to find a solution to a linear or quadratic program, using the barrier algorithm, at any time after the problem is created via a call to CPXcreateprob(). The optimization results are recorded in the CPLEX problem object.

Return Value

The routine returns zero unless an error occurred during the optimization. Examples of errors include exhausting available memory (CPXERR_NO_MEMORY) or encountering invalid data in the CPLEX problem object (CPXERR_NO_PROBLEM). Exceeding a user-specified CPLEX limit, or proving the model infeasible or unbounded, are not considered errors. Note that a zero return value does not necessarily mean that a solution exists. Use query routines CPXsolninfo(), CPXgetstat(), and CPXsolution() to obtain further information about the status of the optimization.


  int CPXbaropt (CPXCENVptr env, CPXLPptr lp);


CPXCENVptr env

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

CPXLPptr lp

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


  status = CPXbaropt (env, lp);

See Also

Example lpex2.c in the CPLEX User's Manual.

Previous Page: CPXaddsos Return to Top Next Page: CPXboundsa