# ClpDynamicExampleMatrix Class Reference

This implements a dynamic matrix when we have a limit on the number of "interesting rows". More...

`#include <ClpDynamicExampleMatrix.hpp>`

Inheritance diagram for ClpDynamicExampleMatrix:
[legend]
Collaboration diagram for ClpDynamicExampleMatrix:
[legend]

List of all members.

## 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.
virtual | ~ClpDynamicExampleMatrix ()
| Destructor.
Copy method
| ClpDynamicExampleMatrix (const ClpDynamicExampleMatrix &)
| The copy constructor.
ClpDynamicExampleMatrix & | operator= (const ClpDynamicExampleMatrix &)
| The copy constructor.
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)
| Starts of each column.
DynamicStatus | getDynamicStatusGen (int sequence) const
| Starts of each column.
bool | flaggedGen (int i) const
| Whether flagged.
void | setFlaggedGen (int i)
| Starts of each column.
void | unsetFlagged (int i)
| Starts of each column.
## 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.

## Detailed Description

This implements a dynamic matrix when we have a limit on the number of "interesting rows".

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.

## Constructor & Destructor Documentation

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)

virtual ClpDynamicExampleMatrix::~ClpDynamicExampleMatrix | ( |  | ) | `[virtual]`

Destructor.

ClpDynamicExampleMatrix::ClpDynamicExampleMatrix | ( | const ClpDynamicExampleMatrix & |  | ) |

The copy constructor.

## Member Function Documentation

virtual void ClpDynamicExampleMatrix::partialPricing | ( | ClpSimplex * | model,
|  | double | start,
|  | double | end,
|  | int & | bestSequence,
|  | int & | numberWanted |
| ) |  |  | `[virtual]`

Partial pricing.

Reimplemented from ClpDynamicMatrix.

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 & |  | ) |

The copy constructor.

Reimplemented from ClpDynamicMatrix.

virtual ClpMatrixBase* ClpDynamicExampleMatrix::clone | ( |  | ) | const`[virtual]`

Clone.

Reimplemented from ClpDynamicMatrix.

CoinBigIndex* ClpDynamicExampleMatrix::startColumnGen | ( |  | ) | const`[inline]`

Starts of each column.

Definition at line 101 of file ClpDynamicExampleMatrix.hpp.

int* ClpDynamicExampleMatrix::rowGen | ( |  | ) | const`[inline]`

rows

Definition at line 105 of file ClpDynamicExampleMatrix.hpp.

double* ClpDynamicExampleMatrix::elementGen | ( |  | ) | const`[inline]`

elements

Definition at line 109 of file ClpDynamicExampleMatrix.hpp.

double* ClpDynamicExampleMatrix::costGen | ( |  | ) | const`[inline]`

costs

Definition at line 113 of file ClpDynamicExampleMatrix.hpp.

int* ClpDynamicExampleMatrix::fullStartGen | ( |  | ) | const`[inline]`

full starts

Definition at line 117 of file ClpDynamicExampleMatrix.hpp.

int* ClpDynamicExampleMatrix::idGen | ( |  | ) | const`[inline]`

ids in next level matrix

Definition at line 121 of file ClpDynamicExampleMatrix.hpp.

double* ClpDynamicExampleMatrix::columnLowerGen | ( |  | ) | const`[inline]`

Optional lower bounds on columns.

Definition at line 125 of file ClpDynamicExampleMatrix.hpp.

double* ClpDynamicExampleMatrix::columnUpperGen | ( |  | ) | const`[inline]`

Optional upper bounds on columns.

Definition at line 129 of file ClpDynamicExampleMatrix.hpp.

int ClpDynamicExampleMatrix::numberColumns | ( |  | ) | const`[inline]`

size

Definition at line 133 of file ClpDynamicExampleMatrix.hpp.

void ClpDynamicExampleMatrix::setDynamicStatusGen | ( | int | sequence,
|  | DynamicStatus | status |
| ) |  |  | `[inline]`

Starts of each column.

Definition at line 136 of file ClpDynamicExampleMatrix.hpp.

DynamicStatus ClpDynamicExampleMatrix::getDynamicStatusGen | ( | int | sequence | ) | const`[inline]`

Starts of each column.

Definition at line 141 of file ClpDynamicExampleMatrix.hpp.

bool ClpDynamicExampleMatrix::flaggedGen | ( | int | i | ) | const`[inline]`

Whether flagged.

Definition at line 145 of file ClpDynamicExampleMatrix.hpp.

void ClpDynamicExampleMatrix::setFlaggedGen | ( | int | i | ) | `[inline]`

Starts of each column.

Definition at line 148 of file ClpDynamicExampleMatrix.hpp.

void ClpDynamicExampleMatrix::unsetFlagged | ( | int | i | ) | `[inline]`

Starts of each column.

Reimplemented from ClpDynamicMatrix.

Definition at line 151 of file ClpDynamicExampleMatrix.hpp.

## Member Data Documentation

int ClpDynamicExampleMatrix::numberColumns_`[protected]`

size

Definition at line 162 of file ClpDynamicExampleMatrix.hpp.

CoinBigIndex* ClpDynamicExampleMatrix::startColumnGen_`[protected]`

Starts of each column.

Definition at line 164 of file ClpDynamicExampleMatrix.hpp.

int* ClpDynamicExampleMatrix::rowGen_`[protected]`

rows

Definition at line 166 of file ClpDynamicExampleMatrix.hpp.

double* ClpDynamicExampleMatrix::elementGen_`[protected]`

elements

Definition at line 168 of file ClpDynamicExampleMatrix.hpp.

double* ClpDynamicExampleMatrix::costGen_`[protected]`

costs

Definition at line 170 of file ClpDynamicExampleMatrix.hpp.

int* ClpDynamicExampleMatrix::fullStartGen_`[protected]`

start of each set

Definition at line 172 of file ClpDynamicExampleMatrix.hpp.

unsigned char* ClpDynamicExampleMatrix::dynamicStatusGen_`[protected]`

for status and which bound

Definition at line 174 of file ClpDynamicExampleMatrix.hpp.

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 178 of file ClpDynamicExampleMatrix.hpp.

double* ClpDynamicExampleMatrix::columnLowerGen_`[protected]`

Optional lower bounds on columns.

Definition at line 180 of file ClpDynamicExampleMatrix.hpp.

double* ClpDynamicExampleMatrix::columnUpperGen_`[protected]`

Optional upper bounds on columns.

Definition at line 182 of file ClpDynamicExampleMatrix.hpp.

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

- /home/coin/svn-release/Alps-1.4.6/Clp/src/ClpDynamicExampleMatrix.hpp