MipProblem Class Reference

Container for a MIP problem. More...

#include <problem.h>

Collaboration diagram for MipProblem:
Collaboration graph
[legend]

List of all members.

Public Types

enum  VarType { CONTINUOUS, BINARY, INTEGER }

Public Member Functions

 MipProblem (int nr_col=0, int nr_row=0)
 Constructs an empty MIP.
 MipProblem (const dvector &lower, const dvector &upper, const vector< int > &i_discr=vector< int >(0), const vector< Pointer< char > > &names=vector< Pointer< char > >(0))
 Constructs an MIP for a given column structure with no rows and no objective.
 MipProblem (const MinlpProblem &minlp)
 Transforms a MINLP to a MIP, if the MINLP is a MIP in fact.
void reset ()
 Removes all rows from the MIP.
int dim () const
int rows () const
const SparseMatrixgetMatrix () const
const dvectorgetRowLower () const
const dvectorgetRowUpper () const
const dvectorgetColLower () const
const dvectorgetColUpper () const
const VarTypegetColType (int i) const
const UserVector< double > & getObj () const
double getObjConst () const
void setColBounds (int index, double low, double up)
void setColType (int index, VarType type)
void setColName (int index, Pointer< char > name)
void setCol (int index, double low, double up, VarType type=CONTINUOUS, Pointer< char > name=NULL)
void setObj (Pointer< UserVector< double > > obj_, double obj_const_=0.)
void setRow (int index, const UserVector< double > &row, double low, double up, Pointer< char > name=NULL)
void setRow (int index, const UserVector< double > &row, const ivector &indices, double low, double up, Pointer< char > name=NULL)
void setRowBounds (int index, double low, double up)
void resize_col (int nr_col_)
void resize_row (int nr_row_)
void finish ()

Private Attributes

int nr_col
int nr_row
dvector col_lower
dvector col_upper
vector< Pointer< char > > col_names
vector< VarTypecol_types
Pointer< UserVector< double > > obj
double obj_const
SparseMatrix A
dvector row_lower
dvector row_upper
vector< Pointer< char > > row_names

Friends

ostream & operator<< (ostream &out, const VarType &type)
ostream & operator<< (ostream &out, const MipProblem &mip)

Detailed Description

Container for a MIP problem.

To represent a problem of the form min c^T x+d s.t. b<=Ax<= b, x [ x, x], x_i Z, i J. Optimized for fast access by a MIPSolver. Adding or removing columns or constraints can be very slow.

Definition at line 410 of file problem.h.


Member Enumeration Documentation

Enumerator:
CONTINUOUS 
BINARY 
INTEGER 

Definition at line 412 of file problem.h.


Constructor & Destructor Documentation

MipProblem::MipProblem ( int  nr_col = 0,
int  nr_row = 0 
)

Constructs an empty MIP.

nr_col continuous variables are constructed, which are all unbounded. nr_row constraints of the form 0<=0*x<=0 are constructed. The objective function is zero.

Parameters:
nr_col The number of columns (variables).
nr_row The number of rows (constraints).
MipProblem::MipProblem ( const dvector lower,
const dvector upper,
const vector< int > &  i_discr = vector< int >(0),
const vector< Pointer< char > > &  names = vector< Pointer< char > >(0) 
)

Constructs an MIP for a given column structure with no rows and no objective.

Parameters:
lower The lower bounds of the columns.
upper The upper bounds of the columns.
names The names for the columns, if available. Default is a vector of size 0.
MipProblem::MipProblem ( const MinlpProblem minlp  ) 

Transforms a MINLP to a MIP, if the MINLP is a MIP in fact.


Member Function Documentation

void MipProblem::reset (  ) 

Removes all rows from the MIP.

int MipProblem::dim (  )  const [inline]

Definition at line 467 of file problem.h.

int MipProblem::rows (  )  const [inline]

Definition at line 468 of file problem.h.

const SparseMatrix& MipProblem::getMatrix (  )  const [inline]

Definition at line 470 of file problem.h.

const dvector& MipProblem::getRowLower (  )  const [inline]

Definition at line 471 of file problem.h.

const dvector& MipProblem::getRowUpper (  )  const [inline]

Definition at line 472 of file problem.h.

const dvector& MipProblem::getColLower (  )  const [inline]

Definition at line 473 of file problem.h.

const dvector& MipProblem::getColUpper (  )  const [inline]

Definition at line 474 of file problem.h.

const VarType& MipProblem::getColType ( int  i  )  const [inline]

Definition at line 475 of file problem.h.

const UserVector<double>& MipProblem::getObj (  )  const [inline]

Definition at line 476 of file problem.h.

double MipProblem::getObjConst (  )  const [inline]

Definition at line 477 of file problem.h.

void MipProblem::setColBounds ( int  index,
double  low,
double  up 
)
void MipProblem::setColType ( int  index,
VarType  type 
)
void MipProblem::setColName ( int  index,
Pointer< char >  name 
)
void MipProblem::setCol ( int  index,
double  low,
double  up,
VarType  type = CONTINUOUS,
Pointer< char >  name = NULL 
)
void MipProblem::setObj ( Pointer< UserVector< double > >  obj_,
double  obj_const_ = 0. 
)
void MipProblem::setRow ( int  index,
const UserVector< double > &  row,
double  low,
double  up,
Pointer< char >  name = NULL 
)
void MipProblem::setRow ( int  index,
const UserVector< double > &  row,
const ivector indices,
double  low,
double  up,
Pointer< char >  name = NULL 
)
void MipProblem::setRowBounds ( int  index,
double  low,
double  up 
)
void MipProblem::resize_col ( int  nr_col_  ) 
void MipProblem::resize_row ( int  nr_row_  ) 
void MipProblem::finish (  ) 

Friends And Related Function Documentation

ostream& operator<< ( ostream &  out,
const VarType type 
) [friend]

Definition at line 414 of file problem.h.

ostream& operator<< ( ostream &  out,
const MipProblem mip 
) [friend]

Member Data Documentation

int MipProblem::nr_col [private]

Definition at line 426 of file problem.h.

int MipProblem::nr_row [private]

Definition at line 426 of file problem.h.

Definition at line 429 of file problem.h.

Definition at line 429 of file problem.h.

vector<Pointer<char> > MipProblem::col_names [private]

Definition at line 430 of file problem.h.

vector<VarType> MipProblem::col_types [private]

Definition at line 431 of file problem.h.

Pointer<UserVector<double> > MipProblem::obj [private]

Definition at line 434 of file problem.h.

double MipProblem::obj_const [private]

Definition at line 435 of file problem.h.

Definition at line 438 of file problem.h.

Definition at line 439 of file problem.h.

Definition at line 439 of file problem.h.

vector<Pointer<char> > MipProblem::row_names [private]

Definition at line 440 of file problem.h.


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

Generated on 10 Mar 2013 for LaGO by  doxygen 1.6.1