OSISolver Class Reference

Interface to COIN OSI. More...

#include <osi.h>

Inheritance diagram for OSISolver:
Inheritance graph
[legend]
Collaboration diagram for OSISolver:
Collaboration graph
[legend]

List of all members.

Classes

class  ColItem
class  RowItem

Public Member Functions

 OSISolver (const MipProblem &mip)
int nr_col ()
int nr_row ()
void set_tol (double tol)
void set_maxiter (int maxiter)
void reset ()
 Next solve will be a cold start.
SolutionStatus solve ()
 Apply warm start if possible.
SolutionStatus solve (const UserVector< double > &x)
 Cold start from primal starting point.
SolutionStatus solveMIP ()
SolutionStatus feasible ()
 Checks the problem for feasiblity.
void get_primal (UserVector< double > &x)
 The last point, we found.
double get_primal (const MIPSolver::ColItem &colitem)
 Gives the primal value for a specific column.
int get_colindex (const MIPSolver::ColItem &colitem)
void get_dual (UserVector< double > &mu)
 Gives the dual variables for the rows.
double get_dual (const MIPSolver::RowItem &rowitem)
 Gives the dual for a specific row.
void get_reducedcosts (UserVector< double > &rc)
 Gives the reduced costs for the columns.
double get_reducedcosts (const MIPSolver::ColItem &colitem)
 Gives the reduced costs for a specific column.
void get_rowactivity (UserVector< double > &rowact)
 Gives the row activities for the rows.
double get_rowactivity (const MIPSolver::RowItem &rowitem)
 Gives the row activities for a specific row.
double get_optval ()
 The last optimal value.
int get_iter ()
void set_obj (const UserVector< double > &obj, double obj_const_=0.)
void modify_obj (int i, double coeff)
const MIPSolver::RowItemadd_row (const UserVector< double > &row, double low, double up)
 Adds a constraint to the problem.
const MIPSolver::RowItemadd_row (const UserVector< double > &row, const ivector &indices, double low, double up)
void add_rows (const vector< pair< dvector, ivector > > &rows, const dvector &low, const dvector &up)
void add_rows (list< const MIPSolver::RowItem * > &rowitems, const vector< pair< dvector, ivector > > &rows, const dvector &low, const dvector &up)
void delete_row (const MIPSolver::RowItem &rowitem)
void delete_rows (const list< const MIPSolver::RowItem * > &rowitems)
void modify_row (const MIPSolver::RowItem &rowitem, double low, double up)
void modify_row (int index, double low, double up)
const MIPSolver::ColItemadd_col (double low, double up, MipProblem::VarType vartype=MipProblem::CONTINUOUS)
const MIPSolver::ColItemadd_col (const UserVector< double > &col, double obj_coeff, double low, double up, MipProblem::VarType vartype=MipProblem::CONTINUOUS)
void add_cols (list< const MIPSolver::ColItem * > &colitems, const dvector &low, const dvector &up)
void add_cols (list< const MIPSolver::ColItem * > &colitems, vector< Pointer< UserVector< double > > > &cols, const vector< double > &obj_coeff, const dvector &low, const dvector &up)
void delete_col (const MIPSolver::ColItem &colitem)
void delete_cols (const list< const MIPSolver::ColItem * > &colitems)
void modify_col (const MIPSolver::ColItem &colitem, double low, double up, MipProblem::VarType type)
void modify_col (const MIPSolver::ColItem &colitem, const UserVector< double > &col, double obj_coeff, double low, double up, MipProblem::VarType vartype)
void modify_col (int index, double low, double up, MipProblem::VarType type)
 If you are sure, which index your variable is.
double get_collow (int index)
double get_colup (int index)
int generate_cuts (list< Pointer< SimpleCut > > &rowcuts)

Private Member Functions

bool lastpoint_feasible ()

Private Attributes

Pointer< OsiSolverInterface > osisolver
 The OSI-Solver, we use.
Pointer< CglCutGenerator > cutgenerator
double obj_const
 To constant of the objective function.
bool cold_start
 Indicates, whether the next solve() will be a cold start or not.
list< RowItemaddedrows
list< ColItemaddedcols

Detailed Description

Interface to COIN OSI.

Definition at line 19 of file osi.h.


Constructor & Destructor Documentation

OSISolver::OSISolver ( const MipProblem mip  ) 

Member Function Documentation

bool OSISolver::lastpoint_feasible (  )  [private]
int OSISolver::nr_col (  )  [virtual]

Implements MIPSolver.

int OSISolver::nr_row (  )  [virtual]

Implements MIPSolver.

void OSISolver::set_tol ( double  tol  )  [virtual]

Implements MIPSolver.

void OSISolver::set_maxiter ( int  maxiter  )  [virtual]

Implements MIPSolver.

void OSISolver::reset (  )  [virtual]

Next solve will be a cold start.

All added rows and columns will be deleted. Modified columns and rows are NOT set to their original values!

Implements MIPSolver.

SolutionStatus OSISolver::solve (  )  [virtual]

Apply warm start if possible.

Implements MIPSolver.

SolutionStatus OSISolver::solve ( const UserVector< double > &  x  )  [virtual]

Cold start from primal starting point.

Reimplemented from MIPSolver.

SolutionStatus OSISolver::solveMIP (  )  [virtual]

Implements MIPSolver.

SolutionStatus OSISolver::feasible (  )  [virtual]

Checks the problem for feasiblity.

This method can never return the SolutionStatus SOLVED.

Implements MIPSolver.

void OSISolver::get_primal ( UserVector< double > &  x  )  [virtual]

The last point, we found.

If last SolutionStatus was SOLVED, the solution. If it was FEASIBLE, a feasible point. Sets x to the primal values of the first x.dim() columns.

Implements MIPSolver.

double OSISolver::get_primal ( const MIPSolver::ColItem colitem  )  [virtual]

Gives the primal value for a specific column.

Implements MIPSolver.

int OSISolver::get_colindex ( const MIPSolver::ColItem colitem  )  [inline, virtual]

Implements MIPSolver.

Definition at line 84 of file osi.h.

void OSISolver::get_dual ( UserVector< double > &  mu  )  [virtual]

Gives the dual variables for the rows.

Sets mu to the dual values of the first mu.dim() rows.

Parameters:
mu To store the duals.

Implements MIPSolver.

double OSISolver::get_dual ( const MIPSolver::RowItem rowitem  )  [virtual]

Gives the dual for a specific row.

Implements MIPSolver.

void OSISolver::get_reducedcosts ( UserVector< double > &  rc  )  [virtual]

Gives the reduced costs for the columns.

Sets rc to the reduced costs of the first rc.dim() columns.

Parameters:
rc To store the reduced costs.

Implements MIPSolver.

double OSISolver::get_reducedcosts ( const MIPSolver::ColItem colitem  )  [virtual]

Gives the reduced costs for a specific column.

Implements MIPSolver.

void OSISolver::get_rowactivity ( UserVector< double > &  rowact  )  [virtual]

Gives the row activities for the rows.

Parameters:
rowact To store the row activities of the first rowact.dim() rows.

Implements MIPSolver.

double OSISolver::get_rowactivity ( const MIPSolver::RowItem rowitem  )  [virtual]

Gives the row activities for a specific row.

Implements MIPSolver.

double OSISolver::get_optval (  )  [virtual]

The last optimal value.

Implements MIPSolver.

int OSISolver::get_iter (  )  [virtual]

Implements MIPSolver.

void OSISolver::set_obj ( const UserVector< double > &  obj,
double  obj_const_ = 0. 
) [virtual]

Implements MIPSolver.

void OSISolver::modify_obj ( int  i,
double  coeff 
) [virtual]

Implements MIPSolver.

const MIPSolver::RowItem* OSISolver::add_row ( const UserVector< double > &  row,
double  low,
double  up 
) [virtual]

Adds a constraint to the problem.

Parameters:
rowitem A RowItem, where we can store the row identification.
row The row.
lb The lower bounds.
ub The upper bounds.

Implements MIPSolver.

const MIPSolver::RowItem* OSISolver::add_row ( const UserVector< double > &  row,
const ivector indices,
double  low,
double  up 
) [virtual]

Reimplemented from MIPSolver.

void OSISolver::add_rows ( const vector< pair< dvector, ivector > > &  rows,
const dvector low,
const dvector up 
) [virtual]

Reimplemented from MIPSolver.

void OSISolver::add_rows ( list< const MIPSolver::RowItem * > &  rowitems,
const vector< pair< dvector, ivector > > &  rows,
const dvector low,
const dvector up 
)
void OSISolver::delete_row ( const MIPSolver::RowItem rowitem  )  [inline, virtual]

Implements MIPSolver.

Definition at line 106 of file osi.h.

void OSISolver::delete_rows ( const list< const MIPSolver::RowItem * > &  rowitems  ) 
void OSISolver::modify_row ( const MIPSolver::RowItem rowitem,
double  low,
double  up 
) [virtual]

Implements MIPSolver.

void OSISolver::modify_row ( int  index,
double  low,
double  up 
) [virtual]

Implements MIPSolver.

const MIPSolver::ColItem* OSISolver::add_col ( double  low,
double  up,
MipProblem::VarType  vartype = MipProblem::CONTINUOUS 
) [virtual]

Implements MIPSolver.

const MIPSolver::ColItem* OSISolver::add_col ( const UserVector< double > &  col,
double  obj_coeff,
double  low,
double  up,
MipProblem::VarType  vartype = MipProblem::CONTINUOUS 
) [virtual]

Implements MIPSolver.

void OSISolver::add_cols ( list< const MIPSolver::ColItem * > &  colitems,
const dvector low,
const dvector up 
)
void OSISolver::add_cols ( list< const MIPSolver::ColItem * > &  colitems,
vector< Pointer< UserVector< double > > > &  cols,
const vector< double > &  obj_coeff,
const dvector low,
const dvector up 
)
void OSISolver::delete_col ( const MIPSolver::ColItem colitem  )  [inline, virtual]

Implements MIPSolver.

Definition at line 115 of file osi.h.

void OSISolver::delete_cols ( const list< const MIPSolver::ColItem * > &  colitems  ) 
void OSISolver::modify_col ( const MIPSolver::ColItem colitem,
double  low,
double  up,
MipProblem::VarType  type 
) [virtual]

Implements MIPSolver.

void OSISolver::modify_col ( const MIPSolver::ColItem colitem,
const UserVector< double > &  col,
double  obj_coeff,
double  low,
double  up,
MipProblem::VarType  vartype 
) [virtual]

Implements MIPSolver.

void OSISolver::modify_col ( int  index,
double  low,
double  up,
MipProblem::VarType  type 
) [virtual]

If you are sure, which index your variable is.

Implements MIPSolver.

double OSISolver::get_collow ( int  index  )  [virtual]

Implements MIPSolver.

double OSISolver::get_colup ( int  index  )  [virtual]

Implements MIPSolver.

int OSISolver::generate_cuts ( list< Pointer< SimpleCut > > &  rowcuts  )  [virtual]

Implements MIPSolver.


Member Data Documentation

Pointer<OsiSolverInterface> OSISolver::osisolver [private]

The OSI-Solver, we use.

Definition at line 46 of file osi.h.

Pointer<CglCutGenerator> OSISolver::cutgenerator [private]

Definition at line 48 of file osi.h.

double OSISolver::obj_const [private]

To constant of the objective function.

Definition at line 52 of file osi.h.

bool OSISolver::cold_start [private]

Indicates, whether the next solve() will be a cold start or not.

Definition at line 56 of file osi.h.

list<RowItem> OSISolver::addedrows [private]

Definition at line 60 of file osi.h.

list<ColItem> OSISolver::addedcols [private]

Definition at line 61 of file osi.h.


The documentation for this class was generated from the following file:

Generated on 10 Mar 2013 for LaGO by  doxygen 1.6.1