Interface class to solve problems through Osi.
More...
#include <OsiInterface.h>
|
| OsiInterface (SOLVER solver) |
| Constructor.
|
|
| ~OsiInterface () |
| 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.
|
|
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.
|
|
OPT_STATUS | solve () |
| Solve the problem loaded.
|
|
double | getObjValue () |
| Get the objective function value.
|
|
const double * | getSolution () |
| Get the solution.
|
|
int | getNumVars () |
| Get the number of variables.
|
|
const string * | getVarNames () |
| Get the name of variables.
|
|
|
OsiSolver * | os |
| Main class to solve problems through Osi.
|
|
Interface class to solve problems through Osi.
OsiInterface::OsiInterface |
( |
SOLVER |
solver | ) |
|
Constructor.
- Exceptions
-
SOLVER_NOT_AVAILABLE | if the selected solver does not exist in the current compilation |
LICENCE_ERROR | if the selected solver needs a license and has not been founded or it is not valid |
- Note
- No binary variables are allowed
bool OsiInterface::getFirstFeasible |
( |
| ) |
|
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
const char * OsiInterface::getLogFileName |
( |
| ) |
|
Get the name of the log file.
- Returns
- Name of the log file
double OsiInterface::getMaxTime |
( |
| ) |
|
Get maximum time allowed to solve the problem.
- Returns
- Maximum time allowed to solve the problem
int OsiInterface::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 OsiInterface::getNumVars |
( |
| ) |
|
Get the number of variables.
- Returns
- Number of variables
const double * OsiInterface::getSolution |
( |
| ) |
|
Get the solution.
- Returns
- Solution
OsiSolverInterface * OsiInterface::getSolverInterface |
( |
| ) |
|
Get solver interface.
- Returns
- Solver interface
const string * OsiInterface::getVarNames |
( |
| ) |
|
Get the name of variables.
- Returns
- Name of variables
void OsiInterface::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 OsiInterface::setFirstFeasible |
( |
bool |
stopAtFirstFeasible | ) |
|
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
OsiInterface::OPT_STATUS OsiInterface::solve |
( |
| ) |
|
Solve the problem loaded.
- Returns
- Optimization exit status
The documentation for this class was generated from the following files:
- /home/jcastro2/intpoint/BlockIPPlatform/OsiInterface/OsiInterface.h
- /home/jcastro2/intpoint/BlockIPPlatform/OsiInterface/OsiInterface.cpp