Changeset 44 for branches/devel/Bonmin/src/IpoptInterface/TMINLP.hpp
 Timestamp:
 Sep 21, 2006 11:29:23 AM (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/devel/Bonmin/src/IpoptInterface/TMINLP.hpp
r26 r44 55 55 { 56 56 public: 57 /**@name Constructors/Destructors */ 58 //@{ 59 TMINLP() 60 {} 61 ; 62 63 /** Default destructor */ 64 virtual ~TMINLP() 65 {} 66 ; 67 //@} 57 friend class TMINLP2TNLP; 68 58 69 59 /** Class to store sos constraints for model */ … … 89 79 /** @} */ 90 80 /** default constructor. */ 91 SosInfo():num(0), types(NULL), priorities(NULL), numNz(0), starts(NULL), 92 indices(NULL), weights(NULL) 93 {} 81 SosInfo(); 94 82 /** Copy constructor.*/ 95 SosInfo(const SosInfo & source):num(source.num), types(NULL), priorities(NULL), 96 numNz(source.numNz), starts(NULL),indices(NULL), 97 weights(NULL) 98 { 99 100 if(num > 0) { 101 assert(source.types!=NULL); 102 assert(source.priorities!=NULL); 103 assert(source.starts!=NULL); 104 assert(source.indices!=NULL); 105 assert(source.weights!=NULL); 106 types = new char[num]; 107 priorities = new int[num]; 108 starts = new int[num + 1]; 109 indices = new int[numNz]; 110 weights = new double[numNz]; 111 for(int i = 0 ; i < num ; i++) { 112 source.types[i] = types[i]; 113 source.priorities[i] = priorities[i]; 114 source.starts[i] = starts[i]; 115 } 116 for(int i = 0 ; i < numNz ; i++) { 117 source.indices[i] = indices[i]; 118 source.weights[i] = weights[i]; 119 } 120 } 121 else { 122 assert(source.types==NULL); 123 assert(source.priorities==NULL); 124 assert(source.starts==NULL); 125 assert(source.indices==NULL); 126 assert(source.weights==NULL); 127 } 128 129 } 83 SosInfo(const SosInfo & source); 84 130 85 131 86 /** destructor*/ … … 137 92 138 93 /** Reset information */ 139 void gutsOfDestructor() 140 { 141 num = 0; 142 numNz = 0; 143 if(types) delete [] types; 144 types = NULL; 145 if(starts) delete [] starts; 146 starts = NULL; 147 if(indices) delete [] indices; 148 indices = NULL; 149 if(priorities) delete [] priorities; 150 priorities = NULL; 151 if(weights) delete [] weights; 152 weights = NULL; 153 } 94 void gutsOfDestructor(); 95 154 96 }; 155 97 … … 210 152 }; 211 153 154 /**@name Constructors/Destructors */ 155 //@{ 156 TMINLP(); 157 158 /** Default destructor */ 159 virtual ~TMINLP() 160 {} 161 //@} 162 ; 163 212 164 /**@name methods to gather information about the MINLP */ 213 165 //@{ … … 294 246 virtual const BranchingInfo * branchingInfo() const = 0; 295 247 296 virtual const SosInfo * sosConstraints() const = 0; 248 /** Add some linear cuts to the problem formulation */ 249 void addCuts(int numberCuts, const OsiRowCut ** cuts); 250 251 /** Remove some cuts to the formulation */ 252 void removeCuts(int number ,const int * toRemove); 253 254 /** remove the last number cuts.*/ 255 void removeLastCuts(int number); 256 257 virtual const SosInfo * sosConstraints() const = 0; 297 258 private: 298 259 /**@name Default Compiler Generated Methods … … 314 275 //@} 315 276 316 277 private: 278 /** resize arrays for linear cuts */ 279 void resizeLinearCuts(int newNumberCuts, int newNnz); 280 /** columnindices of linear cuts. */ 281 int * jCol_; 282 /** rows indices of linear cuts. */ 283 int * iRow_; 284 /** elements of linear cuts.*/ 285 double * elems_; 286 /** lower bounds for linear cuts. */ 287 double * lower_; 288 /** upper bounds for linear cuts. */ 289 double * upper_; 290 /** number of linear cuts.*/ 291 int nLinearCuts_; 292 /** number of nonzeroes in linear cuts*/ 293 int linearCutsNnz_; 294 /** storage size for linear cuts number of cuts.*/ 295 int linearCutsCapacity_; 296 /** storage size for linear cuts number of nnz.*/ 297 int linearCutsNnzCapacity_; 317 298 }; 318 299
Note: See TracChangeset
for help on using the changeset viewer.