Changeset 1836
 Timestamp:
 Dec 15, 2011 3:22:39 PM (9 years ago)
 Location:
 trunk/Clp/src
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Clp/src/ClpPackedMatrix.cpp
r1780 r1836 70 70 { 71 71 #ifndef COIN_SPARSE_MATRIX 72 matrix_ = new CoinPackedMatrix(*(rhs.matrix_), 1, 1); 72 // Guaranteed no gaps or small elements 73 matrix_ = new CoinPackedMatrix(*(rhs.matrix_),1,0) ; 74 flags_ = rhs.flags_&(~0x02) ; 73 75 #else 74 matrix_ = new CoinPackedMatrix(*(rhs.matrix_), 0, 0); 76 // Gaps & small elements preserved 77 matrix_ = new CoinPackedMatrix(*(rhs.matrix_),0,0) ; 78 flags_ = rhs.flags_ ; 79 if (matrix_>hasGaps()) flags_ = 0x02 ; 75 80 #endif 76 81 numberActiveColumns_ = rhs.numberActiveColumns_; 77 flags_ = rhs.flags_ & (~2);78 82 int numberRows = matrix_>getNumRows(); 79 83 if (rhs.rhsOffset_ && numberRows) { … … 102 106 { 103 107 matrix_ = rhs; 104 flags_ = matrix_>hasGaps() ? 2 : 0;108 flags_ = ((matrix_>hasGaps())?0x02:0) ; 105 109 numberActiveColumns_ = matrix_>getNumCols(); 106 110 rowCopy_ = NULL; … … 114 118 { 115 119 #ifndef COIN_SPARSE_MATRIX 116 matrix_ = new CoinPackedMatrix(rhs, 1, 1); 120 matrix_ = new CoinPackedMatrix(rhs,1,0) ; 121 flags_ = 0 ; 117 122 #else 118 matrix_ = new CoinPackedMatrix(rhs, 0, 0); 123 matrix_ = new CoinPackedMatrix(rhs,0,0) ; 124 flags_ = ((matrix_>hasGaps())?0x02:0) ; 119 125 #endif 120 126 numberActiveColumns_ = matrix_>getNumCols(); 121 127 rowCopy_ = NULL; 122 flags_ = 0;123 128 columnCopy_ = NULL; 124 129 setType(1); … … 146 151 delete matrix_; 147 152 #ifndef COIN_SPARSE_MATRIX 148 matrix_ = new CoinPackedMatrix(*(rhs.matrix_)); 153 matrix_ = new CoinPackedMatrix(*(rhs.matrix_),1,0) ; 154 flags_ = rhs.flags_&(~0x02) ; 149 155 #else 150 matrix_ = new CoinPackedMatrix(*(rhs.matrix_), 0, 0); 156 matrix_ = new CoinPackedMatrix(*(rhs.matrix_),0,0) ; 157 flags_ = rhs.flags_ ; 158 if (matrix_>hasGaps()) flags_ = 0x02 ; 151 159 #endif 152 160 numberActiveColumns_ = rhs.numberActiveColumns_; 153 flags_ = rhs.flags_;154 161 delete rowCopy_; 155 162 delete columnCopy_; … … 207 214 numberActiveColumns_ = matrix_>getNumCols(); 208 215 rowCopy_ = NULL; 209 flags_ = rhs.flags_ & (~2); // no gaps216 flags_ = rhs.flags_&(~0x02) ; // no gaps 210 217 columnCopy_ = NULL; 211 218 } … … 220 227 numberActiveColumns_ = matrix_>getNumCols(); 221 228 rowCopy_ = NULL; 222 flags_ = 2;229 flags_ = 0 ; // no gaps 223 230 columnCopy_ = NULL; 224 231 setType(1); … … 236 243 //copy>matrix_>removeGaps(); 237 244 copy>numberActiveColumns_ = copy>matrix_>getNumCols(); 238 copy>flags_ = flags_ & (~2); // no gaps245 copy>flags_ = flags_&(~0x02) ; // no gaps 239 246 return copy; 240 247 } … … 250 257 const double * elementByColumn = matrix_>getElements(); 251 258 //memset(y,0,matrix_>getNumRows()*sizeof(double)); 252 assert (((flags_ &2) != 0) == matrix_>hasGaps());259 assert (((flags_&0x02) != 0) == matrix_>hasGaps()); 253 260 if (!(flags_ & 2)) { 254 261 for (iColumn = 0; iColumn < numberActiveColumns_; iColumn++) { … … 3332 3339 } 3333 3340 } 3334 if (deletedElements) 3341 if (deletedElements) { 3335 3342 matrix_>setNumElements(matrix_>getNumElements()deletedElements); 3343 flags_ = 0x02 ; 3344 } 3336 3345 model>messageHandler()>message(CLP_PACKEDSCALE_INITIAL, *model>messagesPointer()) 3337 3346 << smallest << largest 
trunk/Clp/src/ClpPackedMatrix.hpp
r1825 r1836 475 475 16  wants special column copy 476 476 */ 477 int flags_;477 mutable int flags_; 478 478 /// Special row copy 479 479 ClpPackedMatrix2 * rowCopy_;
Note: See TracChangeset
for help on using the changeset viewer.