List of all members
BCP_lp_relax Class Reference

An object of type BCP_lp_relax holds the description of an lp relaxation. More...

#include <BCP_matrix.hpp>

Inheritance diagram for BCP_lp_relax:
Inheritance graph
[legend]
Collaboration diagram for BCP_lp_relax:
Collaboration graph
[legend]

Public Member Functions

Query methods
size_t colnum () const
 The number of columns. More...
 
size_t rownum () const
 The number of rows. More...
 
const BCP_vec< double > & Objective () const
 A const reference to the vector of objective coefficients. More...
 
const BCP_vec< double > & ColLowerBound () const
 A const reference to the vector of lower bounds on the variables. More...
 
const BCP_vec< double > & ColUpperBound () const
 A const reference to the vector of upper bounds on the variables. More...
 
const BCP_vec< double > & RowLowerBound () const
 A const reference to the vector of lower bounds on the cuts. More...
 
const BCP_vec< double > & RowUpperBound () const
 A const reference to the vector of upper bounds on the cuts. More...
 
Methods modifying the whole LP relaxation.
BCP_lp_relaxoperator= (const BCP_lp_relax &mat)
 Copy the content of x into the LP relaxation. More...
 
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 nonzero entries. More...
 
void clear ()
 Clear the LP relaxation. More...
 
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. More...
 
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. More...
 
Methods for expanding/shrinking the LP relaxation.
void erase_col_set (const BCP_vec< int > &pos)
 Remove the columns whose indices are listed in pos from the LP relaxation. More...
 
void erase_row_set (const BCP_vec< int > &pos)
 Remove the rows whose indices are listed in pos from the LP relaxation. More...
 
Packing/unpacking
void pack (BCP_buffer &buf) const
 Pack the LP relaxation into the buffer. More...
 
void unpack (BCP_buffer &buf)
 Unpack the LP relaxation from the buffer. More...
 
Constructors and destructor
 BCP_lp_relax (const bool colordered=true)
 Create an empty LP relaxation with given ordering. More...
 
 BCP_lp_relax (const BCP_lp_relax &mat)
 The copy constructor makes a copy of the argument LP relaxation. More...
 
 BCP_lp_relax (BCP_vec< BCP_row * > &rows, BCP_vec< double > &CLB, BCP_vec< double > &CUB, BCP_vec< double > &OBJ)
 Create a row major ordered LP relaxation by assigning the content of the arguments to the LP relaxation. More...
 
 BCP_lp_relax (BCP_vec< BCP_row * > &rows, BCP_vec< double > &CLB, BCP_vec< double > &CUB, BCP_vec< double > &OBJ, double extra_gap, double extra_major)
 Same as the previous method except that this method allows extra_gap and extra_major to be specified. More...
 
 BCP_lp_relax (BCP_vec< BCP_col * > &cols, BCP_vec< double > &RLB, BCP_vec< double > &RUB)
 Create a column major ordered LP relaxation by assigning the content of the arguments to the LP relaxation. More...
 
 BCP_lp_relax (BCP_vec< BCP_col * > &cols, BCP_vec< double > &RLB, BCP_vec< double > &RUB, double extra_gap, double extra_major)
 Same as the previous method except that this method allows extra_gap and extra_major to be specified. More...
 
 BCP_lp_relax (const bool colordered, const BCP_vec< int > &VB, const BCP_vec< int > &EI, const BCP_vec< double > &EV, const BCP_vec< double > &OBJ, const BCP_vec< double > &CLB, const BCP_vec< double > &CUB, const BCP_vec< double > &RLB, const BCP_vec< double > &RUB)
 Create an LP relaxation of the given ordering by copying the content of the arguments to the LP relaxation. More...
 
 BCP_lp_relax (const bool colordered, const int rownum, const int colnum, const int nznum, int *&VB, int *&EI, double *&EV, double *&OBJ, double *&CLB, double *&CUB, double *&RLB, double *&RUB)
 Create an LP relaxation of the given ordering by assigning the content of the arguments to the LP relaxation. More...
 
 ~BCP_lp_relax ()
 The destructor deletes the data members. More...
 

Private Member Functions

helper functions for the constructors
void BCP_createColumnOrderedMatrix (BCP_vec< BCP_row * > &rows, BCP_vec< double > &CLB, BCP_vec< double > &CUB, BCP_vec< double > &OBJ)
 
void BCP_createRowOrderedMatrix (BCP_vec< BCP_col * > &cols, BCP_vec< double > &RLB, BCP_vec< double > &RUB)
 

Private Attributes

Data members
BCP_vec< double > _Objective
 The objective coefficients of the variables. More...
 
BCP_vec< double > _ColLowerBound
 The lower bounds on the variables. More...
 
BCP_vec< double > _ColUpperBound
 The upper bounds on the variables. More...
 
BCP_vec< double > _RowLowerBound
 The lower bounds on the cuts. More...
 
BCP_vec< double > _RowUpperBound
 The upper bounds on the cuts. More...
 

Detailed Description

An object of type BCP_lp_relax holds the description of an lp relaxation.

The matrix, lower/upper bounds on the variables and cuts and objective coefficients for the variables.

Definition at line 267 of file BCP_matrix.hpp.

Constructor & Destructor Documentation

BCP_lp_relax::BCP_lp_relax ( const bool  colordered = true)
inline

Create an empty LP relaxation with given ordering.

Definition at line 377 of file BCP_matrix.hpp.

BCP_lp_relax::BCP_lp_relax ( const BCP_lp_relax mat)

The copy constructor makes a copy of the argument LP relaxation.

Definition at line 20 of file BCP_matrix.cpp.

BCP_lp_relax::BCP_lp_relax ( BCP_vec< BCP_row * > &  rows,
BCP_vec< double > &  CLB,
BCP_vec< double > &  CUB,
BCP_vec< double > &  OBJ 
)

Create a row major ordered LP relaxation by assigning the content of the arguments to the LP relaxation.

When the constructor returns the content of 'rows' doesn't change while that of CLB, CUB and OBJ will be whatever the default constructor for those arguments create.

Definition at line 233 of file BCP_matrix.cpp.

BCP_lp_relax::BCP_lp_relax ( BCP_vec< BCP_row * > &  rows,
BCP_vec< double > &  CLB,
BCP_vec< double > &  CUB,
BCP_vec< double > &  OBJ,
double  extra_gap,
double  extra_major 
)

Same as the previous method except that this method allows extra_gap and extra_major to be specified.

For the description of those see the documentation of CoinPackedMatrix. (extra_gap will be used for adding columns, while extra major for adding rows)

Definition at line 243 of file BCP_matrix.cpp.

BCP_lp_relax::BCP_lp_relax ( BCP_vec< BCP_col * > &  cols,
BCP_vec< double > &  RLB,
BCP_vec< double > &  RUB 
)

Create a column major ordered LP relaxation by assigning the content of the arguments to the LP relaxation.

When the constructor returns the content of 'cols' doesn't change while that of RLB and RUB will be whatever the default constructor for those arguments create.

Definition at line 285 of file BCP_matrix.cpp.

BCP_lp_relax::BCP_lp_relax ( BCP_vec< BCP_col * > &  cols,
BCP_vec< double > &  RLB,
BCP_vec< double > &  RUB,
double  extra_gap,
double  extra_major 
)

Same as the previous method except that this method allows extra_gap and extra_major to be specified.

For the description of those see the documentation of CoinPackedMatrix. (extra_gap will be used for adding rows, while extra major for adding columns)

Definition at line 294 of file BCP_matrix.cpp.

BCP_lp_relax::BCP_lp_relax ( const bool  colordered,
const BCP_vec< int > &  VB,
const BCP_vec< int > &  EI,
const BCP_vec< double > &  EV,
const BCP_vec< double > &  OBJ,
const BCP_vec< double > &  CLB,
const BCP_vec< double > &  CUB,
const BCP_vec< double > &  RLB,
const BCP_vec< double > &  RUB 
)

Create an LP relaxation of the given ordering by copying the content of the arguments to the LP relaxation.

Definition at line 306 of file BCP_matrix.cpp.

BCP_lp_relax::BCP_lp_relax ( const bool  colordered,
const int  rownum,
const int  colnum,
const int  nznum,
int *&  VB,
int *&  EI,
double *&  EV,
double *&  OBJ,
double *&  CLB,
double *&  CUB,
double *&  RLB,
double *&  RUB 
)

Create an LP relaxation of the given ordering by assigning the content of the arguments to the LP relaxation.

When the constructor returns the content of the arguments will be NULL pointers.

Definition at line 326 of file BCP_matrix.cpp.

BCP_lp_relax::~BCP_lp_relax ( )
inline

The destructor deletes the data members.

Definition at line 435 of file BCP_matrix.hpp.

Member Function Documentation

size_t BCP_lp_relax::colnum ( ) const
inline

The number of columns.

Definition at line 288 of file BCP_matrix.hpp.

size_t BCP_lp_relax::rownum ( ) const
inline

The number of rows.

Definition at line 290 of file BCP_matrix.hpp.

const BCP_vec<double>& BCP_lp_relax::Objective ( ) const
inline

A const reference to the vector of objective coefficients.

Definition at line 292 of file BCP_matrix.hpp.

const BCP_vec<double>& BCP_lp_relax::ColLowerBound ( ) const
inline

A const reference to the vector of lower bounds on the variables.

Definition at line 294 of file BCP_matrix.hpp.

const BCP_vec<double>& BCP_lp_relax::ColUpperBound ( ) const
inline

A const reference to the vector of upper bounds on the variables.

Definition at line 296 of file BCP_matrix.hpp.

const BCP_vec<double>& BCP_lp_relax::RowLowerBound ( ) const
inline

A const reference to the vector of lower bounds on the cuts.

Definition at line 298 of file BCP_matrix.hpp.

const BCP_vec<double>& BCP_lp_relax::RowUpperBound ( ) const
inline

A const reference to the vector of upper bounds on the cuts.

Definition at line 300 of file BCP_matrix.hpp.

BCP_lp_relax & BCP_lp_relax::operator= ( const BCP_lp_relax mat)

Copy the content of x into the LP relaxation.

Definition at line 31 of file BCP_matrix.cpp.

void BCP_lp_relax::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 nonzero entries.

This is useful when columns/rows are added to the LP relaxation in small chunks and to avoid a series of reallocation we reserve sufficient space up front.

Definition at line 45 of file BCP_matrix.cpp.

void BCP_lp_relax::clear ( )

Clear the LP relaxation.

Definition at line 60 of file BCP_matrix.cpp.

void BCP_lp_relax::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.

Definition at line 69 of file BCP_matrix.cpp.

void BCP_lp_relax::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.

Definition at line 88 of file BCP_matrix.cpp.

void BCP_lp_relax::erase_col_set ( const BCP_vec< int > &  pos)

Remove the columns whose indices are listed in pos from the LP relaxation.

Definition at line 139 of file BCP_matrix.cpp.

void BCP_lp_relax::erase_row_set ( const BCP_vec< int > &  pos)

Remove the rows whose indices are listed in pos from the LP relaxation.

Definition at line 150 of file BCP_matrix.cpp.

void BCP_lp_relax::pack ( BCP_buffer buf) const

Pack the LP relaxation into the buffer.

Definition at line 10 of file BCP_matrix_pack.cpp.

void BCP_lp_relax::unpack ( BCP_buffer buf)

Unpack the LP relaxation from the buffer.

Definition at line 40 of file BCP_matrix_pack.cpp.

void BCP_lp_relax::BCP_createColumnOrderedMatrix ( BCP_vec< BCP_row * > &  rows,
BCP_vec< double > &  CLB,
BCP_vec< double > &  CUB,
BCP_vec< double > &  OBJ 
)
private

Definition at line 205 of file BCP_matrix.cpp.

void BCP_lp_relax::BCP_createRowOrderedMatrix ( BCP_vec< BCP_col * > &  cols,
BCP_vec< double > &  RLB,
BCP_vec< double > &  RUB 
)
private

Definition at line 257 of file BCP_matrix.cpp.

Member Data Documentation

BCP_vec<double> BCP_lp_relax::_Objective
private

The objective coefficients of the variables.

Definition at line 272 of file BCP_matrix.hpp.

BCP_vec<double> BCP_lp_relax::_ColLowerBound
private

The lower bounds on the variables.

Definition at line 274 of file BCP_matrix.hpp.

BCP_vec<double> BCP_lp_relax::_ColUpperBound
private

The upper bounds on the variables.

Definition at line 276 of file BCP_matrix.hpp.

BCP_vec<double> BCP_lp_relax::_RowLowerBound
private

The lower bounds on the cuts.

Definition at line 278 of file BCP_matrix.hpp.

BCP_vec<double> BCP_lp_relax::_RowUpperBound
private

The upper bounds on the cuts.

Definition at line 280 of file BCP_matrix.hpp.


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