Go to the documentation of this file.00001
00002
00003
00004 #ifndef ClpNode_H
00005 #define ClpNode_H
00006
00007 #include "CoinPragma.hpp"
00008
00009
00014 class ClpFactorization;
00015 class ClpDualRowSteepest;
00016 class ClpNodeStuff;
00017 class ClpNode {
00018
00019 public:
00027 void applyNode(ClpSimplex * model, int doBoundsEtc );
00029 void chooseVariable(ClpSimplex * model, ClpNodeStuff * info);
00031 int fixOnReducedCosts(ClpSimplex * model);
00033 void createArrays(ClpSimplex * model);
00035 void cleanUpForCrunch();
00037
00040
00041 inline double objectiveValue() const {
00042 return objectiveValue_;
00043 }
00045 inline void setObjectiveValue(double value) {
00046 objectiveValue_ = value;
00047 }
00049 inline const double * primalSolution() const {
00050 return primalSolution_;
00051 }
00053 inline const double * dualSolution() const {
00054 return dualSolution_;
00055 }
00057 inline double branchingValue() const {
00058 return branchingValue_;
00059 }
00061 inline double sumInfeasibilities() const {
00062 return sumInfeasibilities_;
00063 }
00065 inline int numberInfeasibilities() const {
00066 return numberInfeasibilities_;
00067 }
00069 inline int depth() const {
00070 return depth_;
00071 }
00073 inline double estimatedSolution() const {
00074 return estimatedSolution_;
00075 }
00077 int way() const;
00079 bool fathomed() const;
00081 void changeState();
00083 inline int sequence() const {
00084 return sequence_;
00085 }
00087 inline bool oddArraysExist() const {
00088 return lower_ != NULL;
00089 }
00091 inline const unsigned char * statusArray() const {
00092 return status_;
00093 }
00095
00099 ClpNode();
00101 ClpNode (ClpSimplex * model, const ClpNodeStuff * stuff, int depth);
00103 void gutsOfConstructor(ClpSimplex * model, const ClpNodeStuff * stuff,
00104 int arraysExist, int depth);
00106 virtual ~ClpNode();
00108
00112 ClpNode(const ClpNode&);
00114 ClpNode& operator=(const ClpNode&);
00116
00117 protected:
00118
00119 typedef struct {
00120 unsigned int firstBranch: 1;
00121 unsigned int branch: 2;
00122 unsigned int spare: 29;
00123 } branchState;
00126
00127 double branchingValue_;
00129 double objectiveValue_;
00131 double sumInfeasibilities_;
00133 double estimatedSolution_;
00135 ClpFactorization * factorization_;
00137 ClpDualRowSteepest * weights_;
00139 unsigned char * status_;
00141 double * primalSolution_;
00143 double * dualSolution_;
00145 int * lower_;
00147 int * upper_;
00149 int * pivotVariables_;
00151 int * fixed_;
00153 branchState branchState_;
00155 int sequence_;
00157 int numberInfeasibilities_;
00159 int depth_;
00161 int numberFixed_;
00163 int flags_;
00165 int maximumFixed_;
00167 int maximumRows_;
00169 int maximumColumns_;
00171 int maximumIntegers_;
00173 };
00174 class ClpNodeStuff {
00175
00176 public:
00180 ClpNodeStuff();
00182 virtual ~ClpNodeStuff();
00184
00188 ClpNodeStuff(const ClpNodeStuff&);
00190 ClpNodeStuff& operator=(const ClpNodeStuff&);
00192 void zap(int type);
00194
00195
00199 void fillPseudoCosts(const double * down, const double * up,
00200 const int * priority,
00201 const int * numberDown, const int * numberUp,
00202 const int * numberDownInfeasible, const int * numberUpInfeasible,
00203 int number);
00205 void update(int way, int sequence, double change, bool feasible);
00207 int maximumNodes() const;
00209 int maximumSpace() const;
00211
00212 public:
00215
00216 double integerTolerance_;
00218 double integerIncrement_;
00220 double smallChange_;
00222 double * downPseudo_;
00224 double * upPseudo_;
00226 int * priority_;
00228 int * numberDown_;
00230 int * numberUp_;
00232 int * numberDownInfeasible_;
00234 int * numberUpInfeasible_;
00236 double * saveCosts_;
00238 ClpNode ** nodeInfo_;
00240 ClpSimplex * large_;
00242 int * whichRow_;
00244 int * whichColumn_;
00246 int nBound_;
00248 int saveOptions_;
00257 int solverOptions_;
00259 int maximumNodes_;
00261 int numberBeforeTrust_;
00263 int stateOfSearch_;
00265 int nDepth_;
00267 int nNodes_;
00269 int numberNodesExplored_;
00271 int numberIterations_;
00273 int presolveType_;
00275 };
00276 class ClpHashValue {
00277
00278 public:
00281
00282 int index(double value) const;
00284 int addValue(double value) ;
00286 inline int numberEntries() const {
00287 return numberHash_;
00288 }
00290
00294 ClpHashValue();
00296 ClpHashValue(ClpSimplex * model);
00298 virtual ~ClpHashValue();
00300
00304 ClpHashValue(const ClpHashValue&);
00306 ClpHashValue& operator=(const ClpHashValue&);
00308 private:
00312 int hash(double value) const;
00314 void resize(bool increaseMax);
00316
00317 protected:
00321
00322
00323 typedef struct {
00324 double value;
00325 int index, next;
00326 } CoinHashLink;
00328 mutable CoinHashLink *hash_;
00330 int numberHash_;
00332 int maxHash_;
00334 int lastUsed_;
00336 };
00337 #endif