Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

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:

ClpDynamicMatrix ClpPackedMatrix ClpMatrixBase List of all members.

Public Methods

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, float *element, float *cost, float *columnLower=NULL, float *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 &)
 The copy constructor.

virtual ClpMatrixBaseclone () const
 Clone.

gets and sets
CoinBigIndex * startColumnGen () const
 Starts of each column.

int * rowGen () const
 rows

float * elementGen () const
 elements

float * costGen () const
 costs

int * fullStartGen () const
 full starts

int * idGen () const
 ids in next level matrix

float * columnLowerGen () const
 Optional lower bounds on columns.

float * 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

float * elementGen_
 elements

float * 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).

float * columnLowerGen_
 Optional lower bounds on columns.

float * 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 30 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)

ClpDynamicExampleMatrix::ClpDynamicExampleMatrix ClpSimplex   model,
int    numberSets,
int    numberColumns,
int *    starts,
const double *    lower,
const double *    upper,
int *    startColumn,
int *    row,
float *    element,
float *    cost,
float *    columnLower = NULL,
float *    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.


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.

virtual ClpMatrixBase* ClpDynamicExampleMatrix::clone   const [virtual]
 

Clone.

Reimplemented from ClpDynamicMatrix.

CoinBigIndex* ClpDynamicExampleMatrix::startColumnGen   const [inline]
 

Starts of each column.

Definition at line 95 of file ClpDynamicExampleMatrix.hpp.

References startColumnGen_.

int* ClpDynamicExampleMatrix::rowGen   const [inline]
 

rows

Definition at line 98 of file ClpDynamicExampleMatrix.hpp.

References rowGen_.

float* ClpDynamicExampleMatrix::elementGen   const [inline]
 

elements

Definition at line 101 of file ClpDynamicExampleMatrix.hpp.

References elementGen_.

float* ClpDynamicExampleMatrix::costGen   const [inline]
 

costs

Definition at line 104 of file ClpDynamicExampleMatrix.hpp.

References costGen_.

int* ClpDynamicExampleMatrix::fullStartGen   const [inline]
 

full starts

Definition at line 107 of file ClpDynamicExampleMatrix.hpp.

References fullStartGen_.

int* ClpDynamicExampleMatrix::idGen   const [inline]
 

ids in next level matrix

Definition at line 110 of file ClpDynamicExampleMatrix.hpp.

References idGen_.

float* ClpDynamicExampleMatrix::columnLowerGen   const [inline]
 

Optional lower bounds on columns.

Definition at line 113 of file ClpDynamicExampleMatrix.hpp.

References columnLowerGen_.

float* ClpDynamicExampleMatrix::columnUpperGen   const [inline]
 

Optional upper bounds on columns.

Definition at line 116 of file ClpDynamicExampleMatrix.hpp.

References columnUpperGen_.

int ClpDynamicExampleMatrix::numberColumns   const [inline]
 

size

Definition at line 119 of file ClpDynamicExampleMatrix.hpp.

References numberColumns_.

void ClpDynamicExampleMatrix::setDynamicStatusGen int    sequence,
DynamicStatus    status
[inline]
 

Starts of each column.

Definition at line 121 of file ClpDynamicExampleMatrix.hpp.

References dynamicStatusGen_.

DynamicStatus ClpDynamicExampleMatrix::getDynamicStatusGen int    sequence const [inline]
 

Starts of each column.

Definition at line 127 of file ClpDynamicExampleMatrix.hpp.

References ClpDynamicMatrix::DynamicStatus, and dynamicStatusGen_.

bool ClpDynamicExampleMatrix::flaggedGen int    i const [inline]
 

Whether flagged.

Definition at line 130 of file ClpDynamicExampleMatrix.hpp.

References dynamicStatusGen_.

void ClpDynamicExampleMatrix::setFlaggedGen int    i [inline]
 

Starts of each column.

Definition at line 133 of file ClpDynamicExampleMatrix.hpp.

References dynamicStatusGen_.

void ClpDynamicExampleMatrix::unsetFlagged int    i [inline]
 

Starts of each column.

Reimplemented from ClpDynamicMatrix.

Definition at line 136 of file ClpDynamicExampleMatrix.hpp.

References dynamicStatusGen_.


Member Data Documentation

int ClpDynamicExampleMatrix::numberColumns_ [protected]
 

size

Definition at line 147 of file ClpDynamicExampleMatrix.hpp.

Referenced by numberColumns().

CoinBigIndex* ClpDynamicExampleMatrix::startColumnGen_ [protected]
 

Starts of each column.

Definition at line 149 of file ClpDynamicExampleMatrix.hpp.

Referenced by startColumnGen().

int* ClpDynamicExampleMatrix::rowGen_ [protected]
 

rows

Definition at line 151 of file ClpDynamicExampleMatrix.hpp.

Referenced by rowGen().

float* ClpDynamicExampleMatrix::elementGen_ [protected]
 

elements

Definition at line 153 of file ClpDynamicExampleMatrix.hpp.

Referenced by elementGen().

float* ClpDynamicExampleMatrix::costGen_ [protected]
 

costs

Definition at line 155 of file ClpDynamicExampleMatrix.hpp.

Referenced by costGen().

int* ClpDynamicExampleMatrix::fullStartGen_ [protected]
 

start of each set

Definition at line 157 of file ClpDynamicExampleMatrix.hpp.

Referenced by fullStartGen().

unsigned char* ClpDynamicExampleMatrix::dynamicStatusGen_ [protected]
 

for status and which bound

Definition at line 159 of file ClpDynamicExampleMatrix.hpp.

Referenced by flaggedGen(), getDynamicStatusGen(), setDynamicStatusGen(), setFlaggedGen(), and unsetFlagged().

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

Referenced by idGen().

float* ClpDynamicExampleMatrix::columnLowerGen_ [protected]
 

Optional lower bounds on columns.

Definition at line 165 of file ClpDynamicExampleMatrix.hpp.

Referenced by columnLowerGen().

float* ClpDynamicExampleMatrix::columnUpperGen_ [protected]
 

Optional upper bounds on columns.

Definition at line 167 of file ClpDynamicExampleMatrix.hpp.

Referenced by columnUpperGen().


The documentation for this class was generated from the following file:
Generated on Fri Aug 6 02:01:33 2004 by doxygen1.3-rc2