MipProblem Class Reference
Container for a MIP problem.
More...
#include <problem.h>
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 SparseMatrix & | getMatrix () const |
const dvector & | getRowLower () const |
const dvector & | getRowUpper () const |
const dvector & | getColLower () const |
const dvector & | getColUpper () const |
const VarType & | getColType (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< VarType > | col_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. |
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] |
int MipProblem::rows |
( |
|
) |
const [inline] |
const SparseMatrix& MipProblem::getMatrix |
( |
|
) |
const [inline] |
const dvector& MipProblem::getRowLower |
( |
|
) |
const [inline] |
const dvector& MipProblem::getRowUpper |
( |
|
) |
const [inline] |
const dvector& MipProblem::getColLower |
( |
|
) |
const [inline] |
const dvector& MipProblem::getColUpper |
( |
|
) |
const [inline] |
const VarType& MipProblem::getColType |
( |
int |
i |
) |
const [inline] |
const UserVector<double>& MipProblem::getObj |
( |
|
) |
const [inline] |
double MipProblem::getObjConst |
( |
|
) |
const [inline] |
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] |
ostream& operator<< |
( |
ostream & |
out, |
|
|
const MipProblem & |
mip | |
|
) |
| | [friend] |
Member Data Documentation
The documentation for this class was generated from the following file: