Changeset 1197 for trunk/Clp/src/ClpNode.hpp
 Timestamp:
 Apr 28, 2008 11:38:45 AM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Clp/src/ClpNode.hpp
r1163 r1197 19 19 /**@name Useful methods */ 20 20 //@{ 21 /// Applies node to model 22 void applyNode(ClpSimplex * model, bool justBounds ); 21 /** Applies node to model 22 0  just tree bounds 23 1  tree bounds and basis etc 24 2  saved bounds and basis etc 25 */ 26 void applyNode(ClpSimplex * model, int doBoundsEtc ); 23 27 /// Fix on reduced costs 24 28 int fixOnReducedCosts(ClpSimplex * model); 29 /// Create odd arrays 30 void createArrays(ClpSimplex * model); 31 /// Clean up as crunch is different model 32 void cleanUpForCrunch(); 25 33 //@} 26 34 27 35 /**@name Gets and sets */ 28 36 //@{ 37 /// Objective value 38 inline double objectiveValue() const 39 { return objectiveValue_;} 40 /// Set objective value 41 inline void setObjectiveValue(double value) 42 { objectiveValue_=value;} 43 /// Primal solution 44 inline const double * primalSolution() const 45 { return primalSolution_;} 46 /// Dual solution 47 inline const double * dualSolution() const 48 { return dualSolution_;} 29 49 /// Initial value of integer variable 30 50 inline double branchingValue() const 31 51 { return branchingValue_;} 52 /// Sum infeasibilities 53 inline double sumInfeasibilities() const 54 { return sumInfeasibilities_;} 55 /// Number infeasibilities 56 inline int numberInfeasibilities() const 57 { return numberInfeasibilities_;} 58 /// Estimated solution value 59 inline double estimatedSolution() const 60 { return estimatedSolution_;} 32 61 /** Way for integer variable 1 down , +1 up */ 33 62 int way() const; … … 39 68 inline int sequence() const 40 69 { return sequence_;} 70 /// If odd arrays exist 71 inline bool oddArraysExist() const 72 { return lower_!=NULL;} 73 /// Status array 74 inline const unsigned char * statusArray() const 75 { return status_; } 41 76 //@} 42 77 … … 46 81 ClpNode(); 47 82 /// Constructor from model 48 ClpNode ( const ClpSimplex * model, const ClpNodeStuff * stuff);83 ClpNode (ClpSimplex * model, const ClpNodeStuff * stuff,int depth); 49 84 /// Does work of constructor (partly so gdb will work) 50 void gutsOfConstructor(const ClpSimplex * model, const ClpNodeStuff * stuff); 85 void gutsOfConstructor(ClpSimplex * model, const ClpNodeStuff * stuff, 86 int arraysExist,int depth); 51 87 /** Destructor */ 52 88 virtual ~ClpNode(); … … 72 108 /// Initial value of integer variable 73 109 double branchingValue_; 110 /// Value of objective 111 double objectiveValue_; 112 /// Sum of infeasibilities 113 double sumInfeasibilities_; 114 /// Estimated solution value 115 double estimatedSolution_; 74 116 /// Factorization 75 117 ClpFactorization * factorization_; … … 82 124 /// Dual solution 83 125 double * dualSolution_; 126 /// Integer lower bounds (only used in fathomMany) 127 int * lower_; 128 /// Integer upper bounds (only used in fathomMany) 129 int * upper_; 84 130 /// Pivot variables for factorization 85 131 int * pivotVariables_; … … 90 136 /// Sequence number of integer variable (1 if none) 91 137 int sequence_; 138 /// Number of infeasibilities 139 int numberInfeasibilities_; 92 140 /// Number fixed by reduced cost 93 141 int numberFixed_; 142 /// Flags  1 duals scaled 143 int flags_; 144 /// Maximum number fixed by reduced cost 145 int maximumFixed_; 146 /// Maximum rows so far 147 int maximumRows_; 148 /// Maximum columns so far 149 int maximumColumns_; 150 /// Maximum Integers so far 151 int maximumIntegers_; 94 152 //@} 95 153 }; … … 105 163 //@} 106 164 107 /**@name Copy methods ( at present illegal  will abort) */165 /**@name Copy methods (only copies ints etc, nulls arrays) */ 108 166 //@{ 109 167 /** The copy constructor. */ … … 111 169 /// Operator = 112 170 ClpNodeStuff& operator=(const ClpNodeStuff&); 171 /// Zaps stuff 1  arrays, 2 ints, 3 both 172 void zap(int type); 173 //@} 174 175 176 /**@name Fill methods */ 177 //@{ 178 /** Fill with pseudocosts */ 179 void fillPseudoCosts(const double * down, const double * up, 180 const int * numberDown, const int * numberUp, 181 const int * numberDownInfeasible, const int * numberUpInfeasible, 182 int number); 183 /// Update pseudo costs 184 void update(int way,int sequence,double change,bool feasible); 113 185 //@} 114 186 … … 120 192 /// Integer increment 121 193 double integerIncrement_; 194 /// Down pseudo costs 195 double * downPseudo_; 196 /// Up pseudo costs 197 double * upPseudo_; 198 /// Number of times down 199 int * numberDown_; 200 /// Number of times up 201 int * numberUp_; 202 /// Number of times down infeasible 203 int * numberDownInfeasible_; 204 /// Number of times up infeasible 205 int * numberUpInfeasible_; 206 /// Copy of costs (local) 207 double * saveCosts_; 208 /// Array of ClpNodes 209 ClpNode ** nodeInfo_; 210 /// Large model if crunched 211 ClpSimplex * large_; 212 /// Which rows in large model 213 int * whichRow_; 214 /// Which columns in large model 215 int * whichColumn_; 216 /// Number bounds in large model 217 int nBound_; 218 /// Save of specialOptions_ (local) 219 int saveOptions_; 220 /** Options to pass to solver 221 1  create external reduced costs for columns 222 2  create external reduced costs for rows 223 4  create external row activity (columns always done) 224 Above only done if feasible 225 65536  set if activated 226 */ 227 int solverOptions_; 228 /// Number deep 229 int nDepth_; 230 /// Number nodes returned (1 if fathom aborted) 231 int nNodes_; 232 /// Number of nodes explored 233 int numberNodesExplored_; 234 /// Number of iterations 235 int numberIterations_; 236 /// Type of presolve  0 none, 1 crunch 237 int presolveType_; 238 //@} 239 }; 240 class ClpHashValue { 241 242 public: 243 /**@name Useful methods */ 244 //@{ 245 /// Return index or 1 if not found 246 int index(double value) const; 247 /// Add value to list and return index 248 int addValue(double value) ; 249 //@} 250 251 /**@name Constructors, destructor */ 252 //@{ 253 /** Default constructor. */ 254 ClpHashValue(); 255 /** Useful constructor. */ 256 ClpHashValue(ClpSimplex * model); 257 /** Destructor */ 258 virtual ~ClpHashValue(); 259 //@} 260 261 /**@name Copy method */ 262 //@{ 263 /** The copy constructor. */ 264 ClpHashValue(const ClpHashValue&); 265 /// = 266 ClpHashValue& operator=(const ClpHashValue&); 267 //@} 268 private: 269 /**@name private stuff */ 270 //@{ 271 /** returns hash */ 272 int hash(double value) const; 273 /// Resizes 274 void resize(bool increaseMax); 275 //@} 276 277 protected: 278 /**@name Data members 279 The data members are protected to allow access for derived classes. */ 280 //@{ 281 /// Data 282 // for hashing 283 typedef struct { 284 double value; 285 int index, next; 286 } CoinHashLink; 287 /// Hash table 288 mutable CoinHashLink *hash_; 289 /// Number of entries in hash table 290 int numberHash_; 291 /// Maximum number of entries in hash table i.e. size 292 int maxHash_; 293 /// Last used space 294 int lastUsed_; 122 295 //@} 123 296 };
Note: See TracChangeset
for help on using the changeset viewer.