Loading...
Searching...
No Matches
ClpGubDynamicMatrix.hpp
Go to the documentation of this file.
/* $Id$ */
// Copyright (C) 2003, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
#ifndef ClpGubDynamicMatrix_H
#define ClpGubDynamicMatrix_H
#include "CoinPragma.hpp"
#include "ClpGubMatrix.hpp"
class ClpGubDynamicMatrix : public ClpGubMatrix {
public:
virtual void partialPricing(ClpSimplex *model, double start, double end,
int &bestSequence, int &numberWanted);
virtual int synchronize(ClpSimplex *model, int mode);
virtual void useEffectiveRhs(ClpSimplex *model, bool cheapest = true);
virtual int updatePivot(ClpSimplex *model, double oldInValue, double oldOutValue);
void insertNonBasic(int sequence, int iSet);
virtual double *rhsOffset(ClpSimplex *model, bool forceRefresh = false,
bool check = false);
using ClpPackedMatrix::times;
virtual void times(double scalar,
const double *x, double *y) const;
virtual int checkFeasible(ClpSimplex *model, double &sum) const;
void cleanData(ClpSimplex *model);
ClpGubDynamicMatrix();
virtual ~ClpGubDynamicMatrix();
ClpGubDynamicMatrix(const ClpGubDynamicMatrix &);
ClpGubDynamicMatrix(ClpSimplex *model, int numberSets,
int numberColumns, const int *starts,
const double *lower, const double *upper,
const CoinBigIndex *startColumn, const int *row,
const double *element, const double *cost,
const double *lowerColumn = NULL, const double *upperColumn = NULL,
const unsigned char *status = NULL);
ClpGubDynamicMatrix &operator=(const ClpGubDynamicMatrix &);
virtual ClpMatrixBase *clone() const;
enum DynamicStatus {
inSmall = 0x01,
atUpperBound = 0x02,
atLowerBound = 0x03
};
inline bool flagged(int i) const
{
return (dynamicStatus_[i] & 8) != 0;
}
inline void setFlagged(int i)
{
dynamicStatus_[i] = static_cast< unsigned char >(dynamicStatus_[i] | 8);
}
inline void unsetFlagged(int i)
{
dynamicStatus_[i] = static_cast< unsigned char >(dynamicStatus_[i] & ~8);
}
inline void setDynamicStatus(int sequence, DynamicStatus status)
{
unsigned char &st_byte = dynamicStatus_[sequence];
st_byte = static_cast< unsigned char >(st_byte & ~7);
st_byte = static_cast< unsigned char >(st_byte | status);
}
inline DynamicStatus getDynamicStatus(int sequence) const
{
return static_cast< DynamicStatus >(dynamicStatus_[sequence] & 7);
}
inline double objectiveOffset() const
{
return objectiveOffset_;
}
inline CoinBigIndex *startColumn() const
{
return startColumn_;
}
inline int *row() const
{
return row_;
}
inline double *element() const
{
return element_;
}
inline double *cost() const
{
return cost_;
}
inline int *fullStart() const
{
return fullStart_;
}
inline int *id() const
{
return id_;
}
inline double *lowerColumn() const
{
return lowerColumn_;
}
inline double *upperColumn() const
{
return upperColumn_;
}
inline double *lowerSet() const
{
return lowerSet_;
}
inline double *upperSet() const
{
return upperSet_;
}
inline int numberGubColumns() const
{
return numberGubColumns_;
}
inline int firstAvailable() const
{
return firstAvailable_;
}
inline void setFirstAvailable(int value)
{
firstAvailable_ = value;
}
inline int firstDynamic() const
{
return firstDynamic_;
}
inline int lastDynamic() const
{
return lastDynamic_;
}
inline CoinBigIndex numberElements() const
{
return numberElements_;
}
inline unsigned char *gubRowStatus() const
{
return status_;
}
inline unsigned char *dynamicStatus() const
{
return dynamicStatus_;
}
int whichSet(int sequence) const;
protected:
double objectiveOffset_;
CoinBigIndex *startColumn_;
int *row_;
double *element_;
double *cost_;
int *fullStart_;
int *id_;
unsigned char *dynamicStatus_;
double *lowerColumn_;
double *upperColumn_;
double *lowerSet_;
double *upperSet_;
int numberGubColumns_;
int firstAvailable_;
int savedFirstAvailable_;
int firstDynamic_;
int lastDynamic_;
CoinBigIndex numberElements_;
};
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
ClpGubMatrix.hpp
ClpGubDynamicMatrix::checkFeasible
virtual int checkFeasible(ClpSimplex *model, double &sum) const
Just for debug Returns sum and number of primal infeasibilities.
ClpGubDynamicMatrix::objectiveOffset
double objectiveOffset() const
Saved value of objective offset.
Definition ClpGubDynamicMatrix.hpp:126
ClpGubDynamicMatrix::dynamicStatus
unsigned char * dynamicStatus() const
Status region for gub variables.
Definition ClpGubDynamicMatrix.hpp:216
ClpGubDynamicMatrix::useEffectiveRhs
virtual void useEffectiveRhs(ClpSimplex *model, bool cheapest=true)
Sets up an effective RHS and does gub crash if needed.
ClpGubDynamicMatrix::fullStart_
int * fullStart_
full starts
Definition ClpGubDynamicMatrix.hpp:239
ClpGubDynamicMatrix::lowerSet
double * lowerSet() const
Optional true lower bounds on sets.
Definition ClpGubDynamicMatrix.hpp:171
ClpGubDynamicMatrix::objectiveOffset_
double objectiveOffset_
Saved value of objective offset.
Definition ClpGubDynamicMatrix.hpp:229
ClpGubDynamicMatrix::gubRowStatus
unsigned char * gubRowStatus() const
Status region for gub slacks.
Definition ClpGubDynamicMatrix.hpp:211
ClpGubDynamicMatrix::ClpGubDynamicMatrix
ClpGubDynamicMatrix()
Default constructor.
ClpGubDynamicMatrix::flagged
bool flagged(int i) const
Whether flagged.
Definition ClpGubDynamicMatrix.hpp:103
ClpGubDynamicMatrix::element_
double * element_
elements
Definition ClpGubDynamicMatrix.hpp:235
ClpGubDynamicMatrix::firstAvailable_
int firstAvailable_
first free
Definition ClpGubDynamicMatrix.hpp:255
ClpGubDynamicMatrix::cost_
double * cost_
costs
Definition ClpGubDynamicMatrix.hpp:237
ClpGubDynamicMatrix::dynamicStatus_
unsigned char * dynamicStatus_
for status and which bound
Definition ClpGubDynamicMatrix.hpp:243
ClpGubDynamicMatrix::numberElements_
CoinBigIndex numberElements_
size of working matrix (max)
Definition ClpGubDynamicMatrix.hpp:263
ClpGubDynamicMatrix::partialPricing
virtual void partialPricing(ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
Partial pricing.
ClpGubDynamicMatrix::firstDynamic_
int firstDynamic_
first dynamic
Definition ClpGubDynamicMatrix.hpp:259
ClpGubDynamicMatrix::lowerColumn_
double * lowerColumn_
Optional lower bounds on columns.
Definition ClpGubDynamicMatrix.hpp:245
ClpGubDynamicMatrix::startColumn_
CoinBigIndex * startColumn_
Starts of each column.
Definition ClpGubDynamicMatrix.hpp:231
ClpGubDynamicMatrix::upperSet
double * upperSet() const
Optional true upper bounds on sets.
Definition ClpGubDynamicMatrix.hpp:176
ClpGubDynamicMatrix::startColumn
CoinBigIndex * startColumn() const
Starts of each column.
Definition ClpGubDynamicMatrix.hpp:131
ClpGubDynamicMatrix::upperSet_
double * upperSet_
Optional true upper bounds on sets.
Definition ClpGubDynamicMatrix.hpp:251
ClpGubDynamicMatrix::cost
double * cost() const
costs
Definition ClpGubDynamicMatrix.hpp:146
ClpGubDynamicMatrix::lastDynamic_
int lastDynamic_
number of columns in dynamic model
Definition ClpGubDynamicMatrix.hpp:261
ClpGubDynamicMatrix::rhsOffset
virtual double * rhsOffset(ClpSimplex *model, bool forceRefresh=false, bool check=false)
Returns effective RHS offset if it is being used.
ClpGubDynamicMatrix::clone
virtual ClpMatrixBase * clone() const
Clone.
ClpGubDynamicMatrix::ClpGubDynamicMatrix
ClpGubDynamicMatrix(const ClpGubDynamicMatrix &)
The copy constructor.
ClpGubDynamicMatrix::setFlagged
void setFlagged(int i)
Definition ClpGubDynamicMatrix.hpp:107
ClpGubDynamicMatrix::insertNonBasic
void insertNonBasic(int sequence, int iSet)
Add a new variable to a set.
ClpGubDynamicMatrix::operator=
ClpGubDynamicMatrix & operator=(const ClpGubDynamicMatrix &)
ClpGubDynamicMatrix::cleanData
void cleanData(ClpSimplex *model)
Cleans data after setWarmStart.
ClpGubDynamicMatrix::setDynamicStatus
void setDynamicStatus(int sequence, DynamicStatus status)
Definition ClpGubDynamicMatrix.hpp:115
ClpGubDynamicMatrix::setFirstAvailable
void setFirstAvailable(int value)
set first free
Definition ClpGubDynamicMatrix.hpp:191
ClpGubDynamicMatrix::lastDynamic
int lastDynamic() const
number of columns in dynamic model
Definition ClpGubDynamicMatrix.hpp:201
ClpGubDynamicMatrix::whichSet
int whichSet(int sequence) const
Returns which set a variable is in.
ClpGubDynamicMatrix::DynamicStatus
DynamicStatus
enums for status of various sorts
Definition ClpGubDynamicMatrix.hpp:97
ClpGubDynamicMatrix::atLowerBound
@ atLowerBound
Definition ClpGubDynamicMatrix.hpp:100
ClpGubDynamicMatrix::atUpperBound
@ atUpperBound
Definition ClpGubDynamicMatrix.hpp:99
ClpGubDynamicMatrix::inSmall
@ inSmall
Definition ClpGubDynamicMatrix.hpp:98
ClpGubDynamicMatrix::id
int * id() const
ids of active columns (just index here)
Definition ClpGubDynamicMatrix.hpp:156
ClpGubDynamicMatrix::synchronize
virtual int synchronize(ClpSimplex *model, int mode)
This is local to Gub to allow synchronization: mode=0 when status of basis is good mode=1 when variab...
ClpGubDynamicMatrix::times
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
ClpGubDynamicMatrix::row
int * row() const
rows
Definition ClpGubDynamicMatrix.hpp:136
ClpGubDynamicMatrix::firstDynamic
int firstDynamic() const
first dynamic
Definition ClpGubDynamicMatrix.hpp:196
ClpGubDynamicMatrix::firstAvailable
int firstAvailable() const
first free
Definition ClpGubDynamicMatrix.hpp:186
ClpGubDynamicMatrix::id_
int * id_
ids of active columns (just index here)
Definition ClpGubDynamicMatrix.hpp:241
ClpGubDynamicMatrix::getDynamicStatus
DynamicStatus getDynamicStatus(int sequence) const
Definition ClpGubDynamicMatrix.hpp:121
ClpGubDynamicMatrix::numberGubColumns_
int numberGubColumns_
size
Definition ClpGubDynamicMatrix.hpp:253
ClpGubDynamicMatrix::row_
int * row_
rows
Definition ClpGubDynamicMatrix.hpp:233
ClpGubDynamicMatrix::ClpGubDynamicMatrix
ClpGubDynamicMatrix(ClpSimplex *model, int numberSets, int numberColumns, const int *starts, const double *lower, const double *upper, const CoinBigIndex *startColumn, const int *row, const double *element, const double *cost, const double *lowerColumn=NULL, const double *upperColumn=NULL, const unsigned char *status=NULL)
This is the real constructor.
ClpGubDynamicMatrix::updatePivot
virtual int updatePivot(ClpSimplex *model, double oldInValue, double oldOutValue)
update information for a pivot (and effective rhs)
ClpGubDynamicMatrix::savedFirstAvailable_
int savedFirstAvailable_
saved first free
Definition ClpGubDynamicMatrix.hpp:257
ClpGubDynamicMatrix::upperColumn_
double * upperColumn_
Optional upper bounds on columns.
Definition ClpGubDynamicMatrix.hpp:247
ClpGubDynamicMatrix::numberElements
CoinBigIndex numberElements() const
size of working matrix (max)
Definition ClpGubDynamicMatrix.hpp:206
ClpGubDynamicMatrix::~ClpGubDynamicMatrix
virtual ~ClpGubDynamicMatrix()
Destructor.
ClpGubDynamicMatrix::element
double * element() const
elements
Definition ClpGubDynamicMatrix.hpp:141
ClpGubDynamicMatrix::numberGubColumns
int numberGubColumns() const
size
Definition ClpGubDynamicMatrix.hpp:181
ClpGubDynamicMatrix::lowerColumn
double * lowerColumn() const
Optional lower bounds on columns.
Definition ClpGubDynamicMatrix.hpp:161
ClpGubDynamicMatrix::fullStart
int * fullStart() const
full starts
Definition ClpGubDynamicMatrix.hpp:151
ClpGubDynamicMatrix::upperColumn
double * upperColumn() const
Optional upper bounds on columns.
Definition ClpGubDynamicMatrix.hpp:166
ClpGubDynamicMatrix::unsetFlagged
void unsetFlagged(int i)
Definition ClpGubDynamicMatrix.hpp:111
ClpGubDynamicMatrix::lowerSet_
double * lowerSet_
Optional true lower bounds on sets.
Definition ClpGubDynamicMatrix.hpp:249
ClpGubMatrix::start
int * start() const
Starts.
Definition ClpGubMatrix.hpp:258
ClpGubMatrix::upper
double * upper() const
Upper bounds on sets.
Definition ClpGubMatrix.hpp:273
ClpGubMatrix::status_
unsigned char * status_
Status of slacks.
Definition ClpGubMatrix.hpp:319
ClpGubMatrix::end
int * end() const
End.
Definition ClpGubMatrix.hpp:263
ClpGubMatrix::lower
double * lower() const
Lower bounds on sets.
Definition ClpGubMatrix.hpp:268
ClpGubMatrix::numberSets
int numberSets() const
Number of sets (gub rows).
Definition ClpGubMatrix.hpp:288
ClpGubMatrix::ClpGubMatrix
ClpGubMatrix()
Default constructor.
ClpMatrixBase::ClpMatrixBase
ClpMatrixBase()
Default constructor.
ClpPackedMatrix::times
virtual void times(double scalar, const double *x, double *y) const
Return y + A * scalar *x in y.
ClpSimplex
This solves LPs using the simplex method.
Definition ClpSimplex.hpp:106