#include <ClpDynamicExampleMatrix.hpp>
Inheritance diagram for ClpDynamicExampleMatrix:
Public Member Functions | |
Main functions provided | |
virtual void | partialPricing (ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted) |
Partial pricing. | |
virtual void | createVariable (ClpSimplex *model, int &bestSequence) |
Creates a variable. | |
virtual void | packDown (const int *in, int numberToPack) |
If addColumn forces compression then this allows descendant to know what to do. | |
Constructors, destructor | |
ClpDynamicExampleMatrix () | |
Default constructor. | |
ClpDynamicExampleMatrix (ClpSimplex *model, int numberSets, int numberColumns, const int *starts, const double *lower, const double *upper, const int *startColumn, const int *row, const double *element, const double *cost, const double *columnLower=NULL, const double *columnUpper=NULL, const unsigned char *status=NULL, const unsigned char *dynamicStatus=NULL, int numberIds=0, const int *ids=NULL) | |
This is the real constructor. | |
ClpDynamicExampleMatrix (ClpSimplex *model, int numberSets, int numberColumns, int *starts, const double *lower, const double *upper, int *startColumn, int *row, double *element, double *cost, double *columnLower=NULL, double *columnUpper=NULL, const unsigned char *status=NULL, const unsigned char *dynamicStatus=NULL, int numberIds=0, const int *ids=NULL) | |
This constructor just takes over ownership (except for lower, upper). | |
virtual | ~ClpDynamicExampleMatrix () |
Destructor. | |
Copy method | |
ClpDynamicExampleMatrix (const ClpDynamicExampleMatrix &) | |
The copy constructor. | |
ClpDynamicExampleMatrix & | operator= (const ClpDynamicExampleMatrix &) |
virtual ClpMatrixBase * | clone () const |
Clone. | |
gets and sets | |
CoinBigIndex * | startColumnGen () const |
Starts of each column. | |
int * | rowGen () const |
rows | |
double * | elementGen () const |
elements | |
double * | costGen () const |
costs | |
int * | fullStartGen () const |
full starts | |
int * | idGen () const |
ids in next level matrix | |
double * | columnLowerGen () const |
Optional lower bounds on columns. | |
double * | columnUpperGen () const |
Optional upper bounds on columns. | |
int | numberColumns () const |
size | |
void | setDynamicStatusGen (int sequence, DynamicStatus status) |
DynamicStatus | getDynamicStatusGen (int sequence) const |
bool | flaggedGen (int i) const |
Whether flagged. | |
void | setFlaggedGen (int i) |
void | unsetFlagged (int i) |
Protected Attributes | |
Data members | |
The data members are protected to allow access for derived classes. | |
int | numberColumns_ |
size | |
CoinBigIndex * | startColumnGen_ |
Starts of each column. | |
int * | rowGen_ |
rows | |
double * | elementGen_ |
elements | |
double * | costGen_ |
costs | |
int * | fullStartGen_ |
start of each set | |
unsigned char * | dynamicStatusGen_ |
for status and which bound | |
int * | idGen_ |
identifier for each variable up one level (startColumn_, etc). | |
double * | columnLowerGen_ |
Optional lower bounds on columns. | |
double * | columnUpperGen_ |
Optional upper bounds on columns. |
This version inherits from ClpDynamicMatrix and knows that the real matrix is gub. This acts just like ClpDynamicMatrix but generates columns. This "generates" columns by choosing from stored set. It is maent as a starting point as to how you could use shortest path to generate columns.
So it has its own copy of all data needed. It populates ClpDynamicWatrix with enough to allow for gub keys and active variables. In turn ClpDynamicMatrix populates a CoinPackedMatrix with active columns and rows.
As there is one copy here and one in ClpDynamicmatrix these names end in Gen_
It is obviously more efficient to just use ClpDynamicMatrix but the ideas is to show how much code a user would have to write.
This does not work very well with bounds
Definition at line 33 of file ClpDynamicExampleMatrix.hpp.
ClpDynamicExampleMatrix::ClpDynamicExampleMatrix | ( | ) |
Default constructor.
ClpDynamicExampleMatrix::ClpDynamicExampleMatrix | ( | ClpSimplex * | model, | |
int | numberSets, | |||
int | numberColumns, | |||
const int * | starts, | |||
const double * | lower, | |||
const double * | upper, | |||
const int * | startColumn, | |||
const int * | row, | |||
const double * | element, | |||
const double * | cost, | |||
const double * | columnLower = NULL , |
|||
const double * | columnUpper = NULL , |
|||
const unsigned char * | status = NULL , |
|||
const unsigned char * | dynamicStatus = NULL , |
|||
int | numberIds = 0 , |
|||
const int * | ids = NULL | |||
) |
This is the real constructor.
It assumes factorization frequency will not be changed. This resizes model !!!! The contents of original matrix in model will be taken over and original matrix will be sanitized so can be deleted (to avoid a very small memory leak)
ClpDynamicExampleMatrix::ClpDynamicExampleMatrix | ( | ClpSimplex * | model, | |
int | numberSets, | |||
int | numberColumns, | |||
int * | starts, | |||
const double * | lower, | |||
const double * | upper, | |||
int * | startColumn, | |||
int * | row, | |||
double * | element, | |||
double * | cost, | |||
double * | columnLower = NULL , |
|||
double * | columnUpper = NULL , |
|||
const unsigned char * | status = NULL , |
|||
const unsigned char * | dynamicStatus = NULL , |
|||
int | numberIds = 0 , |
|||
const int * | ids = NULL | |||
) |
This constructor just takes over ownership (except for lower, upper).
virtual ClpDynamicExampleMatrix::~ClpDynamicExampleMatrix | ( | ) | [virtual] |
Destructor.
ClpDynamicExampleMatrix::ClpDynamicExampleMatrix | ( | const ClpDynamicExampleMatrix & | ) |
The copy constructor.
virtual void ClpDynamicExampleMatrix::partialPricing | ( | ClpSimplex * | model, | |
double | start, | |||
double | end, | |||
int & | bestSequence, | |||
int & | numberWanted | |||
) | [virtual] |
virtual void ClpDynamicExampleMatrix::createVariable | ( | ClpSimplex * | model, | |
int & | bestSequence | |||
) | [virtual] |
Creates a variable.
This is called after partial pricing and will modify matrix. Will update bestSequence.
Reimplemented from ClpDynamicMatrix.
virtual void ClpDynamicExampleMatrix::packDown | ( | const int * | in, | |
int | numberToPack | |||
) | [virtual] |
If addColumn forces compression then this allows descendant to know what to do.
If >= then entry stayed in, if -1 then entry went out to lower bound.of zero. Entries at upper bound (really nonzero) never go out (at present).
Reimplemented from ClpDynamicMatrix.
ClpDynamicExampleMatrix& ClpDynamicExampleMatrix::operator= | ( | const ClpDynamicExampleMatrix & | ) |
virtual ClpMatrixBase* ClpDynamicExampleMatrix::clone | ( | ) | const [virtual] |
CoinBigIndex* ClpDynamicExampleMatrix::startColumnGen | ( | ) | const [inline] |
int* ClpDynamicExampleMatrix::rowGen | ( | ) | const [inline] |
double* ClpDynamicExampleMatrix::elementGen | ( | ) | const [inline] |
double* ClpDynamicExampleMatrix::costGen | ( | ) | const [inline] |
int* ClpDynamicExampleMatrix::fullStartGen | ( | ) | const [inline] |
int* ClpDynamicExampleMatrix::idGen | ( | ) | const [inline] |
double* ClpDynamicExampleMatrix::columnLowerGen | ( | ) | const [inline] |
double* ClpDynamicExampleMatrix::columnUpperGen | ( | ) | const [inline] |
int ClpDynamicExampleMatrix::numberColumns | ( | ) | const [inline] |
void ClpDynamicExampleMatrix::setDynamicStatusGen | ( | int | sequence, | |
DynamicStatus | status | |||
) | [inline] |
Definition at line 135 of file ClpDynamicExampleMatrix.hpp.
DynamicStatus ClpDynamicExampleMatrix::getDynamicStatusGen | ( | int | sequence | ) | const [inline] |
Definition at line 140 of file ClpDynamicExampleMatrix.hpp.
bool ClpDynamicExampleMatrix::flaggedGen | ( | int | i | ) | const [inline] |
void ClpDynamicExampleMatrix::setFlaggedGen | ( | int | i | ) | [inline] |
Definition at line 147 of file ClpDynamicExampleMatrix.hpp.
void ClpDynamicExampleMatrix::unsetFlagged | ( | int | i | ) | [inline] |
int ClpDynamicExampleMatrix::numberColumns_ [protected] |
CoinBigIndex* ClpDynamicExampleMatrix::startColumnGen_ [protected] |
int* ClpDynamicExampleMatrix::rowGen_ [protected] |
double* ClpDynamicExampleMatrix::elementGen_ [protected] |
double* ClpDynamicExampleMatrix::costGen_ [protected] |
int* ClpDynamicExampleMatrix::fullStartGen_ [protected] |
unsigned char* ClpDynamicExampleMatrix::dynamicStatusGen_ [protected] |
int* ClpDynamicExampleMatrix::idGen_ [protected] |
identifier for each variable up one level (startColumn_, etc).
This is of length maximumGubColumns_. For this version it is just sequence number at this level
Definition at line 177 of file ClpDynamicExampleMatrix.hpp.
double* ClpDynamicExampleMatrix::columnLowerGen_ [protected] |
double* ClpDynamicExampleMatrix::columnUpperGen_ [protected] |