Class to solve problems through Osi.
More...
#include <OsiSolver.h>
|
| OsiSolver () |
| Constructor.
|
|
| ~OsiSolver () |
| Destructor.
|
|
void | setMaxTime (double time) |
| Set maximum time allowed to solve the problem.
|
|
double | getMaxTime () |
| Get maximum time allowed to solve the problem.
|
|
void | setNumThreads (int numThreads) |
| Set the maximum number of threads that the solver can use to solve the problem.
|
|
int | getNumThreads () |
| Get the maximum number of threads that the solver can use to solve the problem.
|
|
void | setFirstFeasible (bool stopAtFirstFeasible) |
| Set if the execution must be stopped at first feasible solution.
|
|
bool | getFirstFeasible () |
| Get if the execution must be stopped at first feasible solution.
|
|
void | setLogFileName (char *filename) |
| Set the name of the log file.
|
|
const char * | getLogFileName () |
| Get the name of the log file.
|
|
OsiSolverInterface * | getSolverInterface () |
| Get solver interface.
|
|
virtual void | readMps (const char *filename) |
| Load a problem from a mps file.
|
|
void | loadProblem (int numRows, int numColumns, int nz, double obj[], double qobj[], double lb[], double ub[], double lhs[], double rhs[], int begRows[], int indCols[], double values[], bool copy_vectors=true) |
| Load a problem.
|
|
virtual STATUS | solve () |
| Solve the problem loaded.
|
|
double | getObjValue () |
| Get the objective function value.
|
|
virtual const double * | getSolution () |
| Get the solution.
|
|
int | getNumVars () |
| Get the number of variables.
|
|
virtual const string * | getVarNames () |
| Get the name of variables.
|
|
|
void | freeMemory () |
| Free all allocated memory.
|
|
virtual void | loadQuadraticObj (double qobj[]) |
| Load the quadratic objective function cost.
|
|
|
double | maxTime |
| Maximum time allowed to solve the problem.
|
|
bool | stopAtFirstFeasible |
| True if the execution must be stopped at first feasible solution.
|
|
bool | solved |
| True if at least a initial solve has been done.
|
|
int | numThreads |
| Number of threads to use.
|
|
OsiSolverInterface * | si |
| Osi environment.
|
|
CoinMessageHandler * | cmh |
| To redirect the output.
|
|
FILE * | f |
| Output file.
|
|
char * | filename |
| Name of file.
|
|
double | fobj |
| Objective function value.
|
|
Class to solve problems through Osi.
- Note
- Virtual class, not must be instantiated
bool OsiSolver::getFirstFeasible |
( |
| ) |
|
|
inline |
Get if the execution must be stopped at first feasible solution.
- Note
- This option only will be used when the problem loaded contains binary variables
- Returns
- If the execution must be stopped at first feasible solution
double OsiSolver::getMaxTime |
( |
| ) |
|
|
inline |
Get maximum time allowed to solve the problem.
- Returns
- Maximum time allowed to solve the problem
int OsiSolver::getNumThreads |
( |
| ) |
|
|
inline |
Get the maximum number of threads that the solver can use to solve the problem.
- Returns
- Maximum number of threads that the solver can use to solve the problem, -1 if unlimited
int OsiSolver::getNumVars |
( |
| ) |
|
|
inline |
Get the number of variables.
- Returns
- Number of variables
const double * OsiSolver::getSolution |
( |
| ) |
|
|
virtual |
Get the solution.
- Returns
- Solution
Reimplemented in OsiXpress.
OsiSolverInterface * OsiSolver::getSolverInterface |
( |
| ) |
|
|
inline |
Get solver interface.
- Returns
- Solver interface
const string * OsiSolver::getVarNames |
( |
| ) |
|
|
virtual |
Get the name of variables.
- Returns
- Name of variables
Reimplemented in OsiXpress, and OsiCplex.
void OsiSolver::loadProblem |
( |
int |
numRows, |
|
|
int |
numColumns, |
|
|
int |
nz, |
|
|
double |
obj[], |
|
|
double |
qobj[], |
|
|
double |
lb[], |
|
|
double |
ub[], |
|
|
double |
lhs[], |
|
|
double |
rhs[], |
|
|
int |
begRows[], |
|
|
int |
indCols[], |
|
|
double |
values[], |
|
|
bool |
copy_vectors = true |
|
) |
| |
Load a problem.
- Parameters
-
numRows | Number of rows |
numColumns | Number of columns |
nz | Number of non-zero elements in the sparse matrix |
obj | Objective function values, if NULL, all variables have 0 objective coefficient |
qobj | Quadratic coefficients of the separable quadratic objective, if NULL, all variables have 0 quadratic coefficients |
lb | Lower bound of variables |
ub | Upper bound of variables, if NULL, all columns have upper bound infinity. |
lhs | Lower bound of restrictions, if NULL, all columns have lower bound 0 |
rhs | Upper bound of restrictions, if NULL, all rows have upper bound infinity |
begRows | Index to the begining of each row, if NULL, all rows have lower bound -infinity |
indCols | Index of each column |
values | Value of each non-zero element |
copy_vectors | if false the vectors will be used freed with delete[] after optimization TODO |
void OsiSolver::loadQuadraticObj |
( |
double |
qobj[] | ) |
|
|
protectedvirtual |
Load the quadratic objective function cost.
- Parameters
-
qobj | Quadratic coefficients of the separable quadratic objective |
Reimplemented in OsiXpress, OsiCplex, and OsiClp.
void OsiSolver::setFirstFeasible |
( |
bool |
stopAtFirstFeasible | ) |
|
|
inline |
Set if the execution must be stopped at first feasible solution.
- Note
- This option only will be used when the problem loaded contains binary variables
The documentation for this class was generated from the following files:
- /home/jcastro2/intpoint/BlockIPPlatform/OsiInterface/OsiSolver.h
- /home/jcastro2/intpoint/BlockIPPlatform/OsiInterface/OsiSolver.cpp