11 #include "CoinPackedVector.hpp"
12 #include "CoinPackedMatrix.hpp"
63 CoinPackedVector::operator=(x);
73 assign(
const int size,
int*& ElementIndices,
double*& ElementValues,
74 const double Obj,
const double LB,
const double UB) {
75 CoinPackedVector::assignVector(size, ElementIndices, ElementValues,
83 copy(
const int size,
const int* ElementIndices,
const double* ElementValues,
84 const double Obj,
const double LB,
const double UB) {
85 CoinPackedVector::setVector(size, ElementIndices, ElementValues,
99 const double Obj,
const double LB,
const double UB) {
100 CoinPackedVector::setVector(lastind - firstind, firstind, firstval,
125 const double Obj,
const double LB,
const double UB) :
126 CoinPackedVector(lastind - firstind, firstind, firstval,
131 BCP_col(
const int size,
int*& ElementIndices,
double*& ElementValues,
132 const double Obj,
const double LB,
const double UB) :
134 CoinPackedVector::assignVector(size, ElementIndices, ElementValues,
138 const double Obj,
const double LB,
const double UB) :
139 CoinPackedVector(vec.getNumElements(),
140 vec.getIndices(), vec.getElements()),
182 CoinPackedVector::operator=(x);
191 assign(
const int size,
int*& ElementIndices,
double*& ElementValues,
192 const double LB,
const double UB) {
193 CoinPackedVector::assignVector(size, ElementIndices, ElementValues,
200 copy(
const int size,
const int* ElementIndices,
const double* ElementValues,
201 const double LB,
const double UB) {
202 CoinPackedVector::setVector(size, ElementIndices, ElementValues,
215 const double LB,
const double UB) {
216 CoinPackedVector::setVector(lastind - firstind, firstind, firstval,
240 const double LB,
const double UB) :
241 CoinPackedVector(lastind - firstind, firstind, firstval,
246 BCP_row(
const int size,
int*& ElementIndices,
double*& ElementValues,
247 const double LB,
const double UB) :
249 CoinPackedVector::assignVector(size, ElementIndices, ElementValues,
252 BCP_row(
const CoinPackedVectorBase& vec,
const double LB,
const double UB) :
253 CoinPackedVector(vec.getNumElements(),
254 vec.getIndices(), vec.getElements()),
313 void reserve(
const int MaxColNum,
const int MaxRowNum,
314 const int MaxNonzeros);
318 void copyOf(
const CoinPackedMatrix&
m,
319 const double* OBJ,
const double* CLB,
const double* CUB,
320 const double* RLB,
const double* RUB);
322 void assign(CoinPackedMatrix&
m,
323 double*& OBJ,
double*& CLB,
double*& CUB,
324 double*& RLB,
double*& RUB);
333 void add_col_set(
const BCP_col_set& Cols);
336 void add_row_set(
const BCP_row_set& Rows);
351 double dot_product_col(
const int index,
const BCP_vec<double>& col)
const;
354 double dot_product_row(
const int index,
const BCP_vec<double>& row)
const;
357 double dot_product_col(
const int index,
const double* col)
const;
360 double dot_product_row(
const int index,
const double* row)
const;
378 CoinPackedMatrix(colordered, 0, 0, 0, NULL, NULL, NULL, NULL),
400 double extra_gap,
double extra_major);
415 double extra_gap,
double extra_major);
430 int*& VB,
int*& EI,
double*& EV,
431 double*& OBJ,
double*& CLB,
double*& CUB,
432 double*& RLB,
double*& RUB);
double LowerBound() const
Return the lower bound.
const BCP_vec< double > & RowLowerBound() const
A const reference to the vector of lower bounds on the cuts.
BCP_row(const int size, int *&ElementIndices, double *&ElementValues, const double LB, const double UB)
This constructor acts exactly like the assign method with the same argument list. ...
BCP_vec< double > _ColUpperBound
The upper bounds on the variables.
This class holds a column in a compressed form.
void erase_row_set(const BCP_vec< int > &pos)
Remove the rows whose indices are listed in pos from the LP relaxation.
BCP_vec< double > _RowUpperBound
The upper bounds on the cuts.
double LowerBound() const
Return the lower bound.
size_t rownum() const
The number of rows.
void LowerBound(double lb)
Set the lower bound to the given value.
double UpperBound() const
Return the upper bound.
BCP_col(const int size, int *&ElementIndices, double *&ElementValues, const double Obj, const double LB, const double UB)
This constructor acts exactly like the assign method with the same argument list. ...
pos
position where the operator should be printed when printing the expression
void clear()
Clear the LP relaxation.
BCP_col(const BCP_col &x)
The copy constructor makes a copy of x.
~BCP_col()
The destructor deletes all data members.
void assign(const int size, int *&ElementIndices, double *&ElementValues, const double Obj, const double LB, const double UB)
Set the objective coefficient, lower and upper bounds to the given values.
BCP_row(BCP_vec< int >::const_iterator firstind, BCP_vec< int >::const_iterator lastind, BCP_vec< double >::const_iterator firstval, BCP_vec< double >::const_iterator lastval, const double LB, const double UB)
This constructor acts exactly like the copy method with the same argument list.
size_t colnum() const
The number of columns.
BCP_lp_relax(const bool colordered=true)
Create an empty LP relaxation with given ordering.
void BCP_createRowOrderedMatrix(BCP_vec< BCP_col * > &cols, BCP_vec< double > &RLB, BCP_vec< double > &RUB)
void copy(BCP_vec< int >::const_iterator firstind, BCP_vec< int >::const_iterator lastind, BCP_vec< double >::const_iterator firstval, BCP_vec< double >::const_iterator lastval, const double LB, const double UB)
Same as the other copy() method, except that instead of using vectors the indices (values) are given ...
const BCP_vec< double > & ColUpperBound() const
A const reference to the vector of upper bounds on the variables.
void erase_col_set(const BCP_vec< int > &pos)
Remove the columns whose indices are listed in pos from the LP relaxation.
BCP_col(BCP_vec< int >::const_iterator firstind, BCP_vec< int >::const_iterator lastind, BCP_vec< double >::const_iterator firstval, BCP_vec< double >::const_iterator lastval, const double Obj, const double LB, const double UB)
This constructor acts exactly like the copy method with the same argument list.
void assign(const int size, int *&ElementIndices, double *&ElementValues, const double LB, const double UB)
Set the lower and upper bounds to the given values.
double _UpperBound
The upper bound corresponding to the column.
void copyOf(const CoinPackedMatrix &m, const double *OBJ, const double *CLB, const double *CUB, const double *RLB, const double *RUB)
Set up the LP relaxation by making a copy of the arguments.
void unpack(BCP_buffer &buf)
Unpack the LP relaxation from the buffer.
The in-memory representation of the <obj> element.
BCP_vec< double > _ColLowerBound
The lower bounds on the variables.
double _Objective
The objective function coefficient corresponding to the column.
void UpperBound(const double ub)
Set the upper bound to the given value.
double Objective() const
Return the objective coefficient.
const BCP_vec< double > & Objective() const
A const reference to the vector of objective coefficients.
double _LowerBound
The lower bound corresponding to the column.
const BCP_vec< double > & ColLowerBound() const
A const reference to the vector of lower bounds on the variables.
void assign(CoinPackedMatrix &m, double *&OBJ, double *&CLB, double *&CUB, double *&RLB, double *&RUB)
Set up the LP relaxation by taking over the pointers in the arguments.
void pack(BCP_buffer &buf) const
Pack the LP relaxation into the buffer.
BCP_vec< double > _Objective
The objective coefficients of the variables.
~BCP_lp_relax()
The destructor deletes the data members.
double UpperBound() const
Return the upper bound.
BCP_col()
The default constructor creates an empty column with 0 as objective coefficient, 0.0 as lower and +infinity as upper bound.
size_t size() const
Return the current number of entries.
void Objective(const double obj)
Set the objective coefficient to the given value.
The class BCP_vec serves the same purpose as the vector class in the standard template library...
This class describes the message buffer used for all processes of BCP.
void copy(BCP_vec< int >::const_iterator firstind, BCP_vec< int >::const_iterator lastind, BCP_vec< double >::const_iterator firstval, BCP_vec< double >::const_iterator lastval, const double Obj, const double LB, const double UB)
Same as the other copy() method, except that instead of using vectors the indices (values) are given ...
~BCP_row()
The destructor deletes all data members.
double _UpperBound
The upper bound corresponding to the row.
BCP_lp_relax & operator=(const BCP_lp_relax &mat)
Copy the content of x into the LP relaxation.
void copy(const int size, const int *ElementIndices, const double *ElementValues, const double LB, const double UB)
Copy the arguments into the appropriate data members.
BCP_row(const BCP_row &x)
The copy constructor makes a copy of x.
void UpperBound(double ub)
Set the upper bound to the given value.
BCP_row()
The default constructor creates an empty row with -infinity as lower and +infinity as upper bound...
BCP_col & operator=(const BCP_col &x)
Assignment operator: copy over the contents of x.
void copy(const int size, const int *ElementIndices, const double *ElementValues, const double Obj, const double LB, const double UB)
Copy the arguments into the appropriate data members.
BCP_vec< double > _RowLowerBound
The lower bounds on the cuts.
const BCP_vec< double > & RowUpperBound() const
A const reference to the vector of upper bounds on the cuts.
void reserve(const int MaxColNum, const int MaxRowNum, const int MaxNonzeros)
Reserve space in the LP relaxation for at least MaxColNum columns, MaxRowNum rows and MaxNonzeros non...
BCP_row & operator=(const BCP_row &x)
Assignment operator: copy over the contents of x.
An object of type BCP_lp_relax holds the description of an lp relaxation.
BCP_row(const CoinPackedVectorBase &vec, const double LB, const double UB)
The default constructor creates an empty row with -infinity as lower and +infinity as upper bound...
void BCP_createColumnOrderedMatrix(BCP_vec< BCP_row * > &rows, BCP_vec< double > &CLB, BCP_vec< double > &CUB, BCP_vec< double > &OBJ)
BCP_col(const CoinPackedVectorBase &vec, const double Obj, const double LB, const double UB)
The default constructor creates an empty column with 0 as objective coefficient, 0.0 as lower and +infinity as upper bound.
void LowerBound(const double lb)
Set the lower bound to the given value.
void fint fint fint real fint real * x
This class holds a row in a compressed form.
double _LowerBound
The lower bound corresponding to the row.