MIPSolver Class Reference

A general solver for mixed-integer linear programs (MIPs). More...

#include <opt.h>

Inheritance diagram for MIPSolver:
Inheritance graph
[legend]

List of all members.

Classes

class  ColItem
 Used to identify a column in the LP. More...
class  RowItem
 Used to identify a row in the LP. More...

Public Types

enum  SolutionStatus {
  SOLVED, FEASIBLE, UNBOUNDED, INFEASIBLE,
  ITERATIONLIMITEXCEEDED, ABORTED, UNKNOWN
}
 

The solution statuses.

More...

Public Member Functions

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

Static Public Member Functions

static Pointer< MIPSolverget_solver (const MipProblem &mip, Pointer< Param > param)

Friends

ostream & operator<< (ostream &out, const SolutionStatus status)

Detailed Description

A general solver for mixed-integer linear programs (MIPs).

Definition at line 317 of file opt.h.


Member Enumeration Documentation

The solution statuses.

  • SOLVED problem is solved and optimum found.
    • FEASIBLE Feasible point found, but not proven optimal.
    • UNBOUNDED Problem is unbounded.
    • INFEASIBLE Problem is infeasible.
    • ITERATIONLIMITEXCEEDED The iteration limit is exceeded.
    • ABORTED Solve process aborted for some other reason.
Enumerator:
SOLVED 
FEASIBLE 
UNBOUNDED 
INFEASIBLE 
ITERATIONLIMITEXCEEDED 
ABORTED 
UNKNOWN 

Definition at line 327 of file opt.h.


Constructor & Destructor Documentation

virtual MIPSolver::~MIPSolver (  )  [inline, virtual]

Definition at line 365 of file opt.h.


Member Function Documentation

static Pointer<MIPSolver> MIPSolver::get_solver ( const MipProblem mip,
Pointer< Param param 
) [static]
virtual int MIPSolver::nr_col (  )  [pure virtual]

Implemented in OSISolver.

virtual int MIPSolver::nr_row (  )  [pure virtual]

Implemented in OSISolver.

virtual void MIPSolver::set_tol ( double  tol  )  [pure virtual]

Implemented in OSISolver.

virtual void MIPSolver::set_maxiter ( int  maxiter  )  [pure virtual]

Implemented in OSISolver.

virtual void MIPSolver::reset (  )  [pure 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!

Implemented in OSISolver.

virtual SolutionStatus MIPSolver::solve (  )  [pure virtual]

Apply warm start if possible.

Implemented in OSISolver.

virtual SolutionStatus MIPSolver::solve ( const UserVector< double > &  x  )  [inline, virtual]

Cold start from primal starting point.

Reimplemented in OSISolver.

Definition at line 384 of file opt.h.

virtual SolutionStatus MIPSolver::solveMIP (  )  [pure virtual]

Implemented in OSISolver.

virtual SolutionStatus MIPSolver::feasible (  )  [pure virtual]

Checks the problem for feasiblity.

This method can never return the SolutionStatus SOLVED.

Implemented in OSISolver.

virtual void MIPSolver::get_primal ( UserVector< double > &  x  )  [pure 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.

Implemented in OSISolver.

virtual dvector MIPSolver::get_primal (  )  [inline, virtual]

Definition at line 398 of file opt.h.

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

Gives the primal value for a specific column.

Implemented in OSISolver.

virtual int MIPSolver::get_colindex ( const ColItem colitem  )  [pure virtual]

Implemented in OSISolver.

virtual void MIPSolver::get_dual ( UserVector< double > &  mu  )  [pure 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.

Implemented in OSISolver.

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

Gives the dual for a specific row.

Implemented in OSISolver.

virtual void MIPSolver::get_reducedcosts ( UserVector< double > &  rc  )  [pure 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.

Implemented in OSISolver.

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

Gives the reduced costs for a specific column.

Implemented in OSISolver.

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

Gives the row activities for the rows.

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

Implemented in OSISolver.

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

Gives the row activities for a specific row.

Implemented in OSISolver.

virtual double MIPSolver::get_optval (  )  [pure virtual]

The last optimal value.

Implemented in OSISolver.

virtual int MIPSolver::get_iter (  )  [pure virtual]

Implemented in OSISolver.

virtual void MIPSolver::set_obj ( const UserVector< double > &  obj,
double  obj_const = 0. 
) [pure virtual]

Implemented in OSISolver.

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

Implemented in OSISolver.

virtual const RowItem* MIPSolver::add_row ( const UserVector< double > &  row,
double  low,
double  up 
) [pure 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.

Implemented in OSISolver.

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

Reimplemented in OSISolver.

Definition at line 448 of file opt.h.

virtual void MIPSolver::add_rows ( const vector< Pointer< UserVector< double > > > &  rows,
const dvector low,
const dvector up 
) [inline, virtual]

Definition at line 452 of file opt.h.

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

Reimplemented in OSISolver.

Definition at line 455 of file opt.h.

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

Definition at line 458 of file opt.h.

virtual void MIPSolver::delete_row ( const RowItem rowitem  )  [pure virtual]

Implemented in OSISolver.

virtual void MIPSolver::delete_rows ( const list< const RowItem * > &  rowitems  )  [inline, virtual]

Definition at line 462 of file opt.h.

virtual void MIPSolver::modify_row ( const RowItem rowitem,
double  low,
double  up 
) [pure virtual]

Implemented in OSISolver.

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

Implemented in OSISolver.

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

Implemented in OSISolver.

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

Implemented in OSISolver.

virtual void MIPSolver::add_cols ( list< const ColItem * > &  colitems,
const dvector low,
const dvector up 
) [pure virtual]

Adds several columns.

Parameters:
colitems A list, where we can add the ColItem's to.
low Lower bounds for new columns. -INFINITY values in low are replaced by the - representation of the MIPSolver.
up Upper bounds for new columns. INFINITY values in up are replaced by the representation of the MIPSolver.
virtual void MIPSolver::add_cols ( list< const ColItem * > &  colitems,
vector< Pointer< UserVector< double > > > &  cols,
const vector< double > &  obj_coeff,
const dvector low,
const dvector up 
) [pure virtual]
virtual void MIPSolver::delete_col ( const ColItem colitem  )  [pure virtual]

Implemented in OSISolver.

virtual void MIPSolver::delete_cols ( const list< const ColItem * > &  colitems  )  [inline, virtual]

Definition at line 478 of file opt.h.

virtual void MIPSolver::modify_col ( const ColItem colitem,
double  low,
double  up,
MipProblem::VarType  vartype 
) [pure virtual]

Implemented in OSISolver.

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

Implemented in OSISolver.

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

If you are sure, which index your variable is.

Implemented in OSISolver.

virtual double MIPSolver::get_collow ( int  index  )  [pure virtual]

Implemented in OSISolver.

virtual double MIPSolver::get_colup ( int  index  )  [pure virtual]

Implemented in OSISolver.

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

Implemented in OSISolver.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  out,
const SolutionStatus  status 
) [friend]

Definition at line 329 of file opt.h.


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

Generated on 10 Mar 2013 for LaGO by  doxygen 1.6.1