#include <problem.h>
Collaboration diagram for MipProblem:
Public Types | |
CONTINUOUS | |
BINARY | |
INTEGER | |
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) |
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.
enum MipProblem::VarType |
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.
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.
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 | ) |
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 | ( | ) |
ostream& operator<< | ( | ostream & | out, | |
const VarType & | type | |||
) | [friend] |
ostream& operator<< | ( | ostream & | out, | |
const MipProblem & | mip | |||
) | [friend] |
int MipProblem::nr_col [private] |
int MipProblem::nr_row [private] |
dvector MipProblem::col_lower [private] |
dvector MipProblem::col_upper [private] |
vector<Pointer<char> > MipProblem::col_names [private] |
vector<VarType> MipProblem::col_types [private] |
Pointer<UserVector<double> > MipProblem::obj [private] |
double MipProblem::obj_const [private] |
SparseMatrix MipProblem::A [private] |
dvector MipProblem::row_lower [private] |
dvector MipProblem::row_upper [private] |
vector<Pointer<char> > MipProblem::row_names [private] |