6#ifndef CbcFathomDynamicProgramming_H
7#define CbcFathomDynamicProgramming_H
57 virtual int fathom(
double *&newSolution);
79 const double *coefficients,
double cost,
80 int upper = COIN_INT_MAX);
82 inline const double *
cost()
const
87 inline const int *
back()
const
116 const int *coefficients,
double cost);
123 const int *coefficients,
double cost);
126 const int *coefficients);
129 const double *coefficients);
int * lookup_
Some rows may be satisified so we need a lookup.
CbcFathomDynamicProgramming & operator=(const CbcFathomDynamicProgramming &rhs)
Illegal Assignment operator.
virtual int fathom(double *&newSolution)
returns 0 if no fathoming attempted, 1 fully fathomed , 2 incomplete search, 3 incomplete search but ...
CbcFathomDynamicProgramming(const CbcFathomDynamicProgramming &rhs)
void gutsOfDelete()
Does deleteions.
virtual void setModel(CbcModel *model)
update model (This is needed if cliques update matrix etc)
const double * cost() const
Returns cost array.
int size_
Size of states (power of 2 unless just one constraint)
int maximumSizeAllowed_
Maximum size allowed.
double * cost_
Space for states.
bool addOneColumn1A(int numberElements, const int *rows, const int *coefficients, double cost)
Adds one attempt of one column of type 1, returns true if was used in making any changes.
int type_
Type - 0 coefficients and rhs all 1, 1 - coefficients > 1 or rhs > 1.
virtual CbcFathom * clone() const
Clone.
int * startBit_
Start bit for each active row.
CbcFathomDynamicProgramming(CbcModel &model)
int * numberBits_
Number bits for each active row.
int * indices_
Space for sorted indices.
const int * back() const
Returns back array.
bool addOneColumn1(int numberElements, const int *rows, const int *coefficients, double cost)
Adds one attempt of one column of type 1, returns true if was used in making any changes.
int decodeBitPattern(int bitPattern, int *values, int numberRows)
Fills in original column (dense) from bit pattern - returning number nonzero.
int bitPattern(int numberElements, const int *rows, const int *coefficients)
Gets bit pattern from original column.
virtual ~CbcFathomDynamicProgramming()
int checkPossible(int allowableSize=0)
Returns type of algorithm and sets up arrays.
int * coefficients_
Space for sorted coefficients.
int maximumSize() const
Maximum size allowed.
int numberActive_
Number of active rows.
bool tryColumn(int numberElements, const int *rows, const double *coefficients, double cost, int upper=COIN_INT_MAX)
Tries a column returns true if was used in making any changes.
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
int bitPattern(int numberElements, const int *rows, const double *coefficients)
Gets bit pattern from original column.
int target_
Target pattern.
void setMaximumSize(int value)
int numberNonOne_
Number of Non 1 rhs.
CbcFathomDynamicProgramming()
int target() const
Gets bit pattern for target result.
int * back_
Which state produced this cheapest one.
int algorithm_
Current algorithm.
void setAlgorithm(int value)
int bitPattern_
Current bit pattern.
bool addOneColumn0(int numberElements, const int *rows, double cost)
Adds one attempt of one column of type 0, returns true if was used in making any changes.
void setTarget(int value)
Sets bit pattern for target result.
Simple Branch and bound class.