Loading...
Searching...
No Matches
ClpDynamicExampleMatrix.hpp
Go to the documentation of this file.
/* $Id$ */
// Copyright (C) 2004, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
#ifndef ClpDynamicExampleMatrix_H
#define ClpDynamicExampleMatrix_H
#include "CoinPragma.hpp"
#include "ClpDynamicMatrix.hpp"
class ClpSimplex;
class ClpDynamicExampleMatrix : public ClpDynamicMatrix {
public:
virtual void partialPricing(ClpSimplex *model, double start, double end,
int &bestSequence, int &numberWanted);
virtual void createVariable(ClpSimplex *model, int &bestSequence);
virtual void packDown(const int *in, int numberToPack);
ClpDynamicExampleMatrix();
ClpDynamicExampleMatrix(ClpSimplex *model, int numberSets,
int numberColumns, const CoinBigIndex *starts,
const double *lower, const double *upper,
const CoinBigIndex *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);
#if 0
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);
#endif
virtual ~ClpDynamicExampleMatrix();
ClpDynamicExampleMatrix(const ClpDynamicExampleMatrix &);
ClpDynamicExampleMatrix &operator=(const ClpDynamicExampleMatrix &);
virtual ClpMatrixBase *clone() const;
inline CoinBigIndex *startColumnGen() const
{
return startColumnGen_;
}
inline int *rowGen() const
{
return rowGen_;
}
inline double *elementGen() const
{
return elementGen_;
}
inline double *costGen() const
{
return costGen_;
}
inline CoinBigIndex *fullStartGen() const
{
return fullStartGen_;
}
inline int *idGen() const
{
return idGen_;
}
inline double *columnLowerGen() const
{
return columnLowerGen_;
}
inline double *columnUpperGen() const
{
return columnUpperGen_;
}
inline int numberColumns() const
{
return numberColumns_;
}
inline void setDynamicStatusGen(int sequence, DynamicStatus status)
{
unsigned char &st_byte = dynamicStatusGen_[sequence];
st_byte = static_cast< unsigned char >(st_byte & ~7);
st_byte = static_cast< unsigned char >(st_byte | status);
}
inline DynamicStatus getDynamicStatusGen(int sequence) const
{
return static_cast< DynamicStatus >(dynamicStatusGen_[sequence] & 7);
}
inline bool flaggedGen(int i) const
{
return (dynamicStatusGen_[i] & 8) != 0;
}
inline void setFlaggedGen(int i)
{
dynamicStatusGen_[i] = static_cast< unsigned char >(dynamicStatusGen_[i] | 8);
}
inline void unsetFlagged(int i)
{
dynamicStatusGen_[i] = static_cast< unsigned char >(dynamicStatusGen_[i] & ~8);
}
protected:
int numberColumns_;
CoinBigIndex *startColumnGen_;
int *rowGen_;
double *elementGen_;
double *costGen_;
CoinBigIndex *fullStartGen_;
unsigned char *dynamicStatusGen_;
int *idGen_;
double *columnLowerGen_;
double *columnUpperGen_;
};
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
ClpDynamicMatrix.hpp
ClpDynamicExampleMatrix::rowGen_
int * rowGen_
rows
Definition ClpDynamicExampleMatrix.hpp:176
ClpDynamicExampleMatrix::costGen_
double * costGen_
costs
Definition ClpDynamicExampleMatrix.hpp:180
ClpDynamicExampleMatrix::getDynamicStatusGen
DynamicStatus getDynamicStatusGen(int sequence) const
Definition ClpDynamicExampleMatrix.hpp:148
ClpDynamicExampleMatrix::~ClpDynamicExampleMatrix
virtual ~ClpDynamicExampleMatrix()
Destructor.
ClpDynamicExampleMatrix::numberColumns_
int numberColumns_
size
Definition ClpDynamicExampleMatrix.hpp:172
ClpDynamicExampleMatrix::setDynamicStatusGen
void setDynamicStatusGen(int sequence, DynamicStatus status)
Definition ClpDynamicExampleMatrix.hpp:142
ClpDynamicExampleMatrix::fullStartGen
CoinBigIndex * fullStartGen() const
full starts
Definition ClpDynamicExampleMatrix.hpp:118
ClpDynamicExampleMatrix::numberColumns
int numberColumns() const
size
Definition ClpDynamicExampleMatrix.hpp:138
ClpDynamicExampleMatrix::packDown
virtual void packDown(const int *in, int numberToPack)
If addColumn forces compression then this allows descendant to know what to do.
ClpDynamicExampleMatrix::elementGen_
double * elementGen_
elements
Definition ClpDynamicExampleMatrix.hpp:178
ClpDynamicExampleMatrix::unsetFlagged
void unsetFlagged(int i)
Definition ClpDynamicExampleMatrix.hpp:161
ClpDynamicExampleMatrix::idGen
int * idGen() const
ids in next level matrix
Definition ClpDynamicExampleMatrix.hpp:123
ClpDynamicExampleMatrix::clone
virtual ClpMatrixBase * clone() const
Clone.
ClpDynamicExampleMatrix::columnUpperGen
double * columnUpperGen() const
Optional upper bounds on columns.
Definition ClpDynamicExampleMatrix.hpp:133
ClpDynamicExampleMatrix::dynamicStatusGen_
unsigned char * dynamicStatusGen_
for status and which bound
Definition ClpDynamicExampleMatrix.hpp:184
ClpDynamicExampleMatrix::fullStartGen_
CoinBigIndex * fullStartGen_
start of each set
Definition ClpDynamicExampleMatrix.hpp:182
ClpDynamicExampleMatrix::rowGen
int * rowGen() const
rows
Definition ClpDynamicExampleMatrix.hpp:103
ClpDynamicExampleMatrix::ClpDynamicExampleMatrix
ClpDynamicExampleMatrix()
Default constructor.
ClpDynamicExampleMatrix::idGen_
int * idGen_
identifier for each variable up one level (startColumn_, etc).
Definition ClpDynamicExampleMatrix.hpp:188
ClpDynamicExampleMatrix::operator=
ClpDynamicExampleMatrix & operator=(const ClpDynamicExampleMatrix &)
ClpDynamicExampleMatrix::costGen
double * costGen() const
costs
Definition ClpDynamicExampleMatrix.hpp:113
ClpDynamicExampleMatrix::columnUpperGen_
double * columnUpperGen_
Optional upper bounds on columns.
Definition ClpDynamicExampleMatrix.hpp:192
ClpDynamicExampleMatrix::columnLowerGen_
double * columnLowerGen_
Optional lower bounds on columns.
Definition ClpDynamicExampleMatrix.hpp:190
ClpDynamicExampleMatrix::ClpDynamicExampleMatrix
ClpDynamicExampleMatrix(const ClpDynamicExampleMatrix &)
The copy constructor.
ClpDynamicExampleMatrix::flaggedGen
bool flaggedGen(int i) const
Whether flagged.
Definition ClpDynamicExampleMatrix.hpp:153
ClpDynamicExampleMatrix::startColumnGen_
CoinBigIndex * startColumnGen_
Starts of each column.
Definition ClpDynamicExampleMatrix.hpp:174
ClpDynamicExampleMatrix::setFlaggedGen
void setFlaggedGen(int i)
Definition ClpDynamicExampleMatrix.hpp:157
ClpDynamicExampleMatrix::columnLowerGen
double * columnLowerGen() const
Optional lower bounds on columns.
Definition ClpDynamicExampleMatrix.hpp:128
ClpDynamicExampleMatrix::partialPricing
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
ClpDynamicExampleMatrix::ClpDynamicExampleMatrix
ClpDynamicExampleMatrix(ClpSimplex *model, int numberSets, int numberColumns, const CoinBigIndex *starts, const double *lower, const double *upper, const CoinBigIndex *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::elementGen
double * elementGen() const
elements
Definition ClpDynamicExampleMatrix.hpp:108
ClpDynamicExampleMatrix::startColumnGen
CoinBigIndex * startColumnGen() const
Starts of each column.
Definition ClpDynamicExampleMatrix.hpp:98
ClpDynamicExampleMatrix::createVariable
virtual void createVariable(ClpSimplex *model, int &bestSequence)
Creates a variable.
ClpDynamicMatrix::DynamicStatus
DynamicStatus
enums for status of various sorts
Definition ClpDynamicMatrix.hpp:23
ClpDynamicMatrix::columnUpper
double columnUpper(int sequence) const
Gets upper bound (to simplify coding).
Definition ClpDynamicMatrix.hpp:118
ClpDynamicMatrix::row
int * row() const
rows
Definition ClpDynamicMatrix.hpp:237
ClpDynamicMatrix::columnLower
double columnLower(int sequence) const
Gets lower bound (to simplify coding).
Definition ClpDynamicMatrix.hpp:110
ClpDynamicMatrix::ClpDynamicMatrix
ClpDynamicMatrix()
Default constructor.
ClpDynamicMatrix::cost
double * cost() const
costs
Definition ClpDynamicMatrix.hpp:247
ClpDynamicMatrix::numberSets
int numberSets() const
Number of sets (dynamic rows).
Definition ClpDynamicMatrix.hpp:189
ClpDynamicMatrix::dynamicStatus
unsigned char * dynamicStatus() const
Status region for gub variables.
Definition ClpDynamicMatrix.hpp:318
ClpDynamicMatrix::element
double * element() const
elements
Definition ClpDynamicMatrix.hpp:242
ClpDynamicMatrix::startColumn
CoinBigIndex * startColumn() const
Starts of each column.
Definition ClpDynamicMatrix.hpp:232
ClpMatrixBase::ClpMatrixBase
ClpMatrixBase()
Default constructor.
ClpSimplex
This solves LPs using the simplex method.
Definition ClpSimplex.hpp:106