Changeset 2385 for trunk/Clp/src/CoinAbcDenseFactorization.hpp
 Timestamp:
 Jan 6, 2019 2:43:06 PM (4 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Clp/src/CoinAbcDenseFactorization.hpp
r1910 r2385 3 3 // Corporation and others, Copyright (C) 2012, FasterCoin. All Rights Reserved. 4 4 // This code is licensed under the terms of the Eclipse Public License (EPL). 5 6 5 7 6 /* … … 25 24 26 25 public: 27 28 26 /**@name Constructors and destructor and copy */ 29 27 //@{ 30 28 /// Default constructor 31 CoinAbcAnyFactorization ();32 /// Copy constructor 33 CoinAbcAnyFactorization (const CoinAbcAnyFactorization &other);34 29 CoinAbcAnyFactorization(); 30 /// Copy constructor 31 CoinAbcAnyFactorization(const CoinAbcAnyFactorization &other); 32 35 33 /// Destructor 36 virtual ~CoinAbcAnyFactorization ();34 virtual ~CoinAbcAnyFactorization(); 37 35 /// = copy 38 CoinAbcAnyFactorization & operator = ( const CoinAbcAnyFactorization & other);39 36 CoinAbcAnyFactorization &operator=(const CoinAbcAnyFactorization &other); 37 40 38 /// Clone 41 virtual CoinAbcAnyFactorization * 39 virtual CoinAbcAnyFactorization *clone() const = 0; 42 40 //@} 43 41 44 42 /**@name general stuff such as status */ 45 //@{ 43 //@{ 46 44 /// Returns status 47 inline int status ( ) const { 45 inline int status() const 46 { 48 47 return status_; 49 48 } 50 49 /// Sets status 51 inline void setStatus ( int value) 52 { status_=value; } 50 inline void setStatus(int value) 51 { 52 status_ = value; 53 } 53 54 /// Returns number of pivots since factorization 54 inline int pivots ( ) const { 55 inline int pivots() const 56 { 55 57 return numberPivots_; 56 58 } 57 #if ABC_PARALLEL ==259 #if ABC_PARALLEL == 2 58 60 /// Says parallel 59 61 inline void setParallelMode(int value) 60 {parallelMode_=value;}; 62 { 63 parallelMode_ = value; 64 }; 61 65 #endif 62 66 /// Sets number of pivots since factorization 63 inline void setPivots ( int value ) 64 { numberPivots_=value; } 67 inline void setPivots(int value) 68 { 69 numberPivots_ = value; 70 } 65 71 /// Returns number of slacks 66 inline int numberSlacks ( ) const { 72 inline int numberSlacks() const 73 { 67 74 return numberSlacks_; 68 75 } 69 76 /// Sets number of slacks 70 inline void setNumberSlacks ( int value ) 71 { numberSlacks_=value; } 77 inline void setNumberSlacks(int value) 78 { 79 numberSlacks_ = value; 80 } 72 81 /// Set number of Rows after factorization 73 82 inline void setNumberRows(int value) 74 { numberRows_ = value; } 83 { 84 numberRows_ = value; 85 } 75 86 /// Number of Rows after factorization 76 inline int numberRows ( ) const { 87 inline int numberRows() const 88 { 77 89 return numberRows_; 78 90 } 79 91 /// Number of dense rows after factorization 80 inline CoinSimplexInt numberDense ( ) const { 92 inline CoinSimplexInt numberDense() const 93 { 81 94 return numberDense_; 82 95 } 83 96 /// Number of good columns in factorization 84 inline int numberGoodColumns ( ) const { 97 inline int numberGoodColumns() const 98 { 85 99 return numberGoodU_; 86 100 } 87 101 /// Allows change of pivot accuracy check 1.0 == none >1.0 relaxed 88 102 inline void relaxAccuracyCheck(double value) 89 { relaxCheck_ = value;} 103 { 104 relaxCheck_ = value; 105 } 90 106 inline double getAccuracyCheck() const 91 { return relaxCheck_;} 107 { 108 return relaxCheck_; 109 } 92 110 /// Maximum number of pivots between factorizations 93 inline int maximumPivots ( ) const { 94 return maximumPivots_ ; 111 inline int maximumPivots() const 112 { 113 return maximumPivots_; 95 114 } 96 115 /// Set maximum pivots 97 virtual void maximumPivots ( int value);116 virtual void maximumPivots(int value); 98 117 99 118 /// Pivot tolerance 100 inline double pivotTolerance ( ) const { 101 return pivotTolerance_ ; 102 } 103 void pivotTolerance ( double value ); 119 inline double pivotTolerance() const 120 { 121 return pivotTolerance_; 122 } 123 void pivotTolerance(double value); 104 124 /// Minimum pivot tolerance 105 inline double minimumPivotTolerance ( ) const { 106 return minimumPivotTolerance_ ; 107 } 108 void minimumPivotTolerance ( double value ); 109 virtual CoinFactorizationDouble * pivotRegion() const 110 { return NULL;} 125 inline double minimumPivotTolerance() const 126 { 127 return minimumPivotTolerance_; 128 } 129 void minimumPivotTolerance(double value); 130 virtual CoinFactorizationDouble *pivotRegion() const 131 { 132 return NULL; 133 } 111 134 /// Area factor 112 inline double areaFactor ( ) const { 113 return areaFactor_ ; 114 } 115 inline void areaFactor ( CoinSimplexDouble value ) { 116 areaFactor_=value; 135 inline double areaFactor() const 136 { 137 return areaFactor_; 138 } 139 inline void areaFactor(CoinSimplexDouble value) 140 { 141 areaFactor_ = value; 117 142 } 118 143 /// Zero tolerance 119 inline double zeroTolerance ( ) const { 120 return zeroTolerance_ ; 121 } 122 void zeroTolerance ( double value ); 144 inline double zeroTolerance() const 145 { 146 return zeroTolerance_; 147 } 148 void zeroTolerance(double value); 123 149 /// Returns array to put basis elements in 124 virtual CoinFactorizationDouble * 125 /// Returns pivot row 126 virtual int * 150 virtual CoinFactorizationDouble *elements() const; 151 /// Returns pivot row 152 virtual int *pivotRow() const; 127 153 /// Returns work area 128 virtual CoinFactorizationDouble * 154 virtual CoinFactorizationDouble *workArea() const; 129 155 /// Returns int work area 130 virtual int * 156 virtual int *intWorkArea() const; 131 157 /// Number of entries in each row 132 virtual int * 158 virtual int *numberInRow() const; 133 159 /// Number of entries in each column 134 virtual int * 160 virtual int *numberInColumn() const; 135 161 /// Returns array to put basis starts in 136 virtual CoinBigIndex * 162 virtual CoinBigIndex *starts() const; 137 163 /// Returns permute back 138 virtual int * 164 virtual int *permuteBack() const; 139 165 /// Sees whether to go sparse 140 166 virtual void goSparse() {} 141 167 #ifndef NDEBUG 142 virtual inline void checkMarkArrays() const {} 168 virtual inline void checkMarkArrays() const 169 { 170 } 143 171 #endif 144 172 /** Get solve mode e.g. 0 C++ code, 1 Lapack, 2 choose … … 147 175 */ 148 176 inline int solveMode() const 149 { return solveMode_ ;} 177 { 178 return solveMode_; 179 } 150 180 /** Set solve mode e.g. 0 C++ code, 1 Lapack, 2 choose 151 181 If 4 set then values pass … … 153 183 */ 154 184 inline void setSolveMode(int value) 155 { solveMode_ = value;} 185 { 186 solveMode_ = value; 187 } 156 188 /// Returns true if wants tableauColumn in replaceColumn 157 189 virtual bool wantsTableauColumn() const; … … 160 192 whereFrom is 0 for factorize and 1 for replaceColumn 161 193 */ 162 virtual void setUsefulInformation(const int * info,int whereFrom);194 virtual void setUsefulInformation(const int *info, int whereFrom); 163 195 /// Get rid of all memory 164 196 virtual void clearArrays() {} 165 197 //@} 166 198 /**@name virtual general stuff such as permutation */ 167 //@{ 199 //@{ 168 200 /// Returns array to put basis indices in 169 virtual int * indices() const= 0;201 virtual int *indices() const = 0; 170 202 /// Returns permute in 171 virtual int * 203 virtual int *permute() const = 0; 172 204 /// Returns pivotColumn or permute 173 virtual int * 205 virtual int *pivotColumn() const; 174 206 /// Total number of elements in factorization 175 virtual int numberElements () const = 0;207 virtual int numberElements() const = 0; 176 208 //@} 177 209 /**@name Do factorization  public */ 178 210 //@{ 179 211 /// Gets space for a factorization 180 virtual void getAreas ( int numberRows, 181 int numberColumns, 182 CoinBigIndex maximumL, 183 CoinBigIndex maximumU ) = 0; 184 212 virtual void getAreas(int numberRows, 213 int numberColumns, 214 CoinBigIndex maximumL, 215 CoinBigIndex maximumU) 216 = 0; 217 185 218 /// PreProcesses column ordered copy of basis 186 virtual void preProcess () = 0;219 virtual void preProcess() = 0; 187 220 /** Does most of factorization returning status 188 221 0  OK … … 190 223 1  singular  use numberGoodColumns and redo 191 224 */ 192 virtual int factor (AbcSimplex *model) = 0;225 virtual int factor(AbcSimplex *model) = 0; 193 226 #ifdef EARLY_FACTORIZE 194 227 /// Returns 2 if can't, 1 if singular, 99 memory, 0 OK 195 virtual int factorize (AbcSimplex * /*model*/, CoinIndexedVector & /*stuff*/) 196 { return 2;} 228 virtual int factorize(AbcSimplex * /*model*/, CoinIndexedVector & /*stuff*/) 229 { 230 return 2; 231 } 197 232 #endif 198 233 /// Does post processing on valid factorization  putting variables on correct rows 199 virtual void postProcess(const int * sequence, int *pivotVariable) = 0;234 virtual void postProcess(const int *sequence, int *pivotVariable) = 0; 200 235 /// Makes a nonsingular basis by replacing variables 201 virtual void makeNonSingular(int * 236 virtual void makeNonSingular(int *sequence) = 0; 202 237 //@} 203 238 … … 226 261 #ifdef EARLY_FACTORIZE 227 262 /// 0 success, 1 can't +1 accuracy problems 228 virtual int replaceColumns ( const AbcSimplex * /*model*/, 229 CoinIndexedVector & /*stuff*/, 230 int /*firstPivot*/,int /*lastPivot*/,bool /*cleanUp*/) 231 { return 1;} 232 #endif 233 #ifdef ABC_LONG_FACTORIZATION 263 virtual int replaceColumns(const AbcSimplex * /*model*/, 264 CoinIndexedVector & /*stuff*/, 265 int /*firstPivot*/, int /*lastPivot*/, bool /*cleanUp*/) 266 { 267 return 1; 268 } 269 #endif 270 #ifdef ABC_LONG_FACTORIZATION 234 271 /// Clear all hidden arrays 235 272 virtual void clearHiddenArrays() {} … … 239 276 Fills in region for use later 240 277 partial update already in U */ 241 virtual 242 #ifdef ABC_LONG_FACTORIZATION 243 long 244 #endif 245 double checkReplacePart1 ( CoinIndexedVector * /*regionSparse*/, 246 int /*pivotRow*/) 247 {return 0.0;} 248 virtual 249 #ifdef ABC_LONG_FACTORIZATION 250 long 251 #endif 252 double checkReplacePart1 ( CoinIndexedVector * /*regionSparse*/, 253 CoinIndexedVector * /*partialUpdate*/, 254 int /*pivotRow*/) 255 {return 0.0;} 256 virtual void checkReplacePart1a ( CoinIndexedVector * /* regionSparse */, 257 int /*pivotRow*/) 258 {} 259 virtual double checkReplacePart1b (CoinIndexedVector * /*regionSparse*/, 260 int /*pivotRow*/) 261 {return 0.0;} 278 virtual 279 #ifdef ABC_LONG_FACTORIZATION 280 long 281 #endif 282 double 283 checkReplacePart1(CoinIndexedVector * /*regionSparse*/, 284 int /*pivotRow*/) 285 { 286 return 0.0; 287 } 288 virtual 289 #ifdef ABC_LONG_FACTORIZATION 290 long 291 #endif 292 double 293 checkReplacePart1(CoinIndexedVector * /*regionSparse*/, 294 CoinIndexedVector * /*partialUpdate*/, 295 int /*pivotRow*/) 296 { 297 return 0.0; 298 } 299 virtual void checkReplacePart1a(CoinIndexedVector * /* regionSparse */, 300 int /*pivotRow*/) 301 { 302 } 303 virtual double checkReplacePart1b(CoinIndexedVector * /*regionSparse*/, 304 int /*pivotRow*/) 305 { 306 return 0.0; 307 } 262 308 /** Checks if can replace one Column to basis, 263 309 returns 0=OK, 1=Probably OK, 2=singular, 3=no room, 5 max pivots */ 264 virtual int checkReplacePart2 ( int pivotRow, 265 double btranAlpha, 266 double ftranAlpha, 267 #ifdef ABC_LONG_FACTORIZATION 268 long 269 #endif 270 double ftAlpha, 271 double acceptablePivot = 1.0e8) = 0; 310 virtual int checkReplacePart2(int pivotRow, 311 double btranAlpha, 312 double ftranAlpha, 313 #ifdef ABC_LONG_FACTORIZATION 314 long 315 #endif 316 double ftAlpha, 317 double acceptablePivot = 1.0e8) 318 = 0; 272 319 /** Replaces one Column to basis, 273 320 partial update already in U */ 274 virtual void replaceColumnPart3 ( const AbcSimplex * model, 275 CoinIndexedVector * regionSparse, 276 CoinIndexedVector * tableauColumn, 277 int pivotRow, 278 #ifdef ABC_LONG_FACTORIZATION 279 long 280 #endif 281 double alpha ) = 0; 321 virtual void replaceColumnPart3(const AbcSimplex *model, 322 CoinIndexedVector *regionSparse, 323 CoinIndexedVector *tableauColumn, 324 int pivotRow, 325 #ifdef ABC_LONG_FACTORIZATION 326 long 327 #endif 328 double alpha) 329 = 0; 282 330 /** Replaces one Column to basis, 283 331 partial update in vector */ 284 virtual void replaceColumnPart3 ( const AbcSimplex * model, 285 CoinIndexedVector * regionSparse, 286 CoinIndexedVector * tableauColumn, 287 CoinIndexedVector * partialUpdate, 288 int pivotRow, 289 #ifdef ABC_LONG_FACTORIZATION 290 long 291 #endif 292 double alpha )=0; 332 virtual void replaceColumnPart3(const AbcSimplex *model, 333 CoinIndexedVector *regionSparse, 334 CoinIndexedVector *tableauColumn, 335 CoinIndexedVector *partialUpdate, 336 int pivotRow, 337 #ifdef ABC_LONG_FACTORIZATION 338 long 339 #endif 340 double alpha) 341 = 0; 293 342 //@} 294 343 … … 300 349 number returned is negative if no room 301 350 */ 302 virtual int updateColumnFT ( CoinIndexedVector & regionSparse) = 0; 303 virtual int updateColumnFTPart1 ( CoinIndexedVector & regionSparse) = 0; 304 virtual void updateColumnFTPart2 ( CoinIndexedVector & regionSparse) = 0; 305 virtual void updateColumnFT ( CoinIndexedVector & regionSparseFT, 306 CoinIndexedVector & partialUpdate, 307 int which)=0; 351 virtual int updateColumnFT(CoinIndexedVector ®ionSparse) = 0; 352 virtual int updateColumnFTPart1(CoinIndexedVector ®ionSparse) = 0; 353 virtual void updateColumnFTPart2(CoinIndexedVector ®ionSparse) = 0; 354 virtual void updateColumnFT(CoinIndexedVector ®ionSparseFT, 355 CoinIndexedVector &partialUpdate, 356 int which) 357 = 0; 308 358 /** This version has same effect as above with FTUpdate==false 309 359 so number returned is always >=0 */ 310 virtual int updateColumn ( CoinIndexedVector ®ionSparse) const = 0;360 virtual int updateColumn(CoinIndexedVector ®ionSparse) const = 0; 311 361 /// does FTRAN on two unpacked columns 312 virtual int updateTwoColumnsFT(CoinIndexedVector & regionFT, 313 CoinIndexedVector & regionOther) = 0; 362 virtual int updateTwoColumnsFT(CoinIndexedVector ®ionFT, 363 CoinIndexedVector ®ionOther) 364 = 0; 314 365 /** Updates one column (BTRAN) from unpacked regionSparse 315 366 */ 316 virtual int updateColumnTranspose ( CoinIndexedVector ®ionSparse) const = 0;367 virtual int updateColumnTranspose(CoinIndexedVector ®ionSparse) const = 0; 317 368 /** This version does FTRAN on array when indices not set up */ 318 virtual void updateFullColumn ( CoinIndexedVector ®ionSparse) const = 0;369 virtual void updateFullColumn(CoinIndexedVector ®ionSparse) const = 0; 319 370 /** Updates one column (BTRAN) from unpacked regionSparse 320 371 */ 321 virtual void updateFullColumnTranspose ( CoinIndexedVector ®ionSparse) const = 0;372 virtual void updateFullColumnTranspose(CoinIndexedVector ®ionSparse) const = 0; 322 373 /** Updates one column for dual steepest edge weights (FTRAN) */ 323 virtual void updateWeights ( CoinIndexedVector & regionSparse) const=0;374 virtual void updateWeights(CoinIndexedVector ®ionSparse) const = 0; 324 375 /** Updates one column (FTRAN) */ 325 virtual void updateColumnCpu ( CoinIndexedVector & regionSparse,int whichCpu) const;376 virtual void updateColumnCpu(CoinIndexedVector ®ionSparse, int whichCpu) const; 326 377 /** Updates one column (BTRAN) */ 327 virtual void updateColumnTransposeCpu ( CoinIndexedVector & regionSparse,int whichCpu) const;328 //@} 329 330 ////////////////// data //////////////////378 virtual void updateColumnTransposeCpu(CoinIndexedVector ®ionSparse, int whichCpu) const; 379 //@} 380 381 ////////////////// data ////////////////// 331 382 protected: 332 333 383 /**@name data */ 334 384 //@{ … … 341 391 /// Zero tolerance 342 392 double zeroTolerance_; 343 //#ifndef slackValue_ 393 //#ifndef slackValue_ 344 394 #define slackValue2_ 1.0 345 395 //#endif … … 364 414 /// Maximum rows ever (i.e. use to copy arrays etc) 365 415 int maximumRows_; 366 #if ABC_PARALLEL ==2416 #if ABC_PARALLEL == 2 367 417 int parallelMode_; 368 418 #endif 369 /// Pivot row 370 int * 419 /// Pivot row 420 int *pivotRow_; 371 421 /** Elements of factorization and updates 372 422 length is maxR*maxR+maxSpace 373 423 will always be long enough so can have nR*nR ints in maxSpace 374 424 */ 375 CoinFactorizationDouble * 376 /// Work area of numberRows_ 377 CoinFactorizationDouble * 425 CoinFactorizationDouble *elements_; 426 /// Work area of numberRows_ 427 CoinFactorizationDouble *workArea_; 378 428 /** Solve mode e.g. 0 C++ code, 1 Lapack, 2 choose 379 429 If 4 set then values pass … … 390 440 */ 391 441 392 393 394 442 class CoinAbcDenseFactorization : public CoinAbcAnyFactorization { 395 friend void CoinAbcDenseFactorizationUnitTest( const std::string & mpsDir);443 friend void CoinAbcDenseFactorizationUnitTest(const std::string &mpsDir); 396 444 397 445 public: 398 399 446 /**@name Constructors and destructor and copy */ 400 447 //@{ 401 448 /// Default constructor 402 CoinAbcDenseFactorization ();403 /// Copy constructor 404 CoinAbcDenseFactorization (const CoinAbcDenseFactorization &other);405 449 CoinAbcDenseFactorization(); 450 /// Copy constructor 451 CoinAbcDenseFactorization(const CoinAbcDenseFactorization &other); 452 406 453 /// Destructor 407 virtual ~CoinAbcDenseFactorization ();454 virtual ~CoinAbcDenseFactorization(); 408 455 /// = copy 409 CoinAbcDenseFactorization & operator = ( const CoinAbcDenseFactorization & other);456 CoinAbcDenseFactorization &operator=(const CoinAbcDenseFactorization &other); 410 457 /// Clone 411 virtual CoinAbcAnyFactorization * clone() const;458 virtual CoinAbcAnyFactorization *clone() const; 412 459 //@} 413 460 … … 415 462 //@{ 416 463 /// Gets space for a factorization 417 virtual void getAreas (int numberRows,418 419 420 CoinBigIndex maximumU);421 464 virtual void getAreas(int numberRows, 465 int numberColumns, 466 CoinBigIndex maximumL, 467 CoinBigIndex maximumU); 468 422 469 /// PreProcesses column ordered copy of basis 423 virtual void preProcess ();470 virtual void preProcess(); 424 471 /** Does most of factorization returning status 425 472 0  OK … … 427 474 1  singular  use numberGoodColumns and redo 428 475 */ 429 virtual int factor (AbcSimplex *model);476 virtual int factor(AbcSimplex *model); 430 477 /// Does post processing on valid factorization  putting variables on correct rows 431 virtual void postProcess(const int * sequence, int *pivotVariable);478 virtual void postProcess(const int *sequence, int *pivotVariable); 432 479 /// Makes a nonsingular basis by replacing variables 433 virtual void makeNonSingular(int * 480 virtual void makeNonSingular(int *sequence); 434 481 //@} 435 482 436 483 /**@name general stuff such as number of elements */ 437 //@{ 484 //@{ 438 485 /// Total number of elements in factorization 439 virtual inline int numberElements ( ) const { 440 return numberRows_*(numberRows_+numberPivots_); 486 virtual inline int numberElements() const 487 { 488 return numberRows_ * (numberRows_ + numberPivots_); 441 489 } 442 490 /// Returns maximum absolute value in factorization … … 451 499 If skipBtranU is false will do btran part 452 500 partial update already in U */ 453 virtual int replaceColumn ( CoinIndexedVector *regionSparse,454 455 double pivotCheck,456 bool skipBtranU=false,457 double acceptablePivot=1.0e8);501 virtual int replaceColumn(CoinIndexedVector *regionSparse, 502 int pivotRow, 503 double pivotCheck, 504 bool skipBtranU = false, 505 double acceptablePivot = 1.0e8); 458 506 /** Checks if can replace one Column to basis, 459 507 returns 0=OK, 1=Probably OK, 2=singular, 3=no room, 5 max pivots */ 460 virtual int checkReplacePart2 (int pivotRow,461 double btranAlpha, 462 double ftranAlpha, 463 #ifdef ABC_LONG_FACTORIZATION 464 465 #endif 466 467 double acceptablePivot = 1.0e8);508 virtual int checkReplacePart2(int pivotRow, 509 double btranAlpha, 510 double ftranAlpha, 511 #ifdef ABC_LONG_FACTORIZATION 512 long 513 #endif 514 double ftAlpha, 515 double acceptablePivot = 1.0e8); 468 516 /** Replaces one Column to basis, 469 517 partial update already in U */ 470 virtual void replaceColumnPart3 ( const AbcSimplex *model,471 CoinIndexedVector *regionSparse,472 CoinIndexedVector *tableauColumn,473 474 #ifdef ABC_LONG_FACTORIZATION 475 476 #endif 477 double alpha);518 virtual void replaceColumnPart3(const AbcSimplex *model, 519 CoinIndexedVector *regionSparse, 520 CoinIndexedVector *tableauColumn, 521 int pivotRow, 522 #ifdef ABC_LONG_FACTORIZATION 523 long 524 #endif 525 double alpha); 478 526 /** Replaces one Column to basis, 479 527 partial update in vector */ 480 virtual void replaceColumnPart3 ( const AbcSimplex * model, 481 CoinIndexedVector * regionSparse, 482 CoinIndexedVector * tableauColumn, 483 CoinIndexedVector * /*partialUpdate*/, 484 int pivotRow, 485 #ifdef ABC_LONG_FACTORIZATION 486 long 487 #endif 488 double alpha ) 489 { replaceColumnPart3(model,regionSparse,tableauColumn,pivotRow,alpha);} 528 virtual void replaceColumnPart3(const AbcSimplex *model, 529 CoinIndexedVector *regionSparse, 530 CoinIndexedVector *tableauColumn, 531 CoinIndexedVector * /*partialUpdate*/, 532 int pivotRow, 533 #ifdef ABC_LONG_FACTORIZATION 534 long 535 #endif 536 double alpha) 537 { 538 replaceColumnPart3(model, regionSparse, tableauColumn, pivotRow, alpha); 539 } 490 540 //@} 491 541 … … 497 547 number returned is negative if no room 498 548 */ 499 virtual int updateColumnFT ( CoinIndexedVector & regionSparse) 500 {return updateColumn(regionSparse);} 501 virtual int updateColumnFTPart1 ( CoinIndexedVector & regionSparse) 502 {return updateColumn(regionSparse);} 503 virtual void updateColumnFTPart2 ( CoinIndexedVector & /*regionSparse*/) 504 {} 505 virtual void updateColumnFT ( CoinIndexedVector & regionSparseFT,CoinIndexedVector & /*partialUpdate*/,int /*which*/) 506 { updateColumnFT(regionSparseFT);} 549 virtual int updateColumnFT(CoinIndexedVector ®ionSparse) 550 { 551 return updateColumn(regionSparse); 552 } 553 virtual int updateColumnFTPart1(CoinIndexedVector ®ionSparse) 554 { 555 return updateColumn(regionSparse); 556 } 557 virtual void updateColumnFTPart2(CoinIndexedVector & /*regionSparse*/) 558 { 559 } 560 virtual void updateColumnFT(CoinIndexedVector ®ionSparseFT, CoinIndexedVector & /*partialUpdate*/, int /*which*/) 561 { 562 updateColumnFT(regionSparseFT); 563 } 507 564 /** This version has same effect as above with FTUpdate==false 508 565 so number returned is always >=0 */ 509 virtual int updateColumn ( CoinIndexedVector ®ionSparse) const;566 virtual int updateColumn(CoinIndexedVector ®ionSparse) const; 510 567 /// does FTRAN on two unpacked columns 511 virtual int updateTwoColumnsFT(CoinIndexedVector & 512 CoinIndexedVector ®ionOther);568 virtual int updateTwoColumnsFT(CoinIndexedVector ®ionFT, 569 CoinIndexedVector ®ionOther); 513 570 /** Updates one column (BTRAN) from unpacked regionSparse 514 571 */ 515 virtual int updateColumnTranspose ( CoinIndexedVector ®ionSparse) const;572 virtual int updateColumnTranspose(CoinIndexedVector ®ionSparse) const; 516 573 /** This version does FTRAN on array when indices not set up */ 517 virtual void updateFullColumn ( CoinIndexedVector & regionSparse) const 518 {updateColumn(regionSparse);} 574 virtual void updateFullColumn(CoinIndexedVector ®ionSparse) const 575 { 576 updateColumn(regionSparse); 577 } 519 578 /** Updates one column (BTRAN) from unpacked regionSparse 520 579 */ 521 virtual void updateFullColumnTranspose ( CoinIndexedVector & regionSparse) const 522 {updateColumnTranspose(regionSparse);} 580 virtual void updateFullColumnTranspose(CoinIndexedVector ®ionSparse) const 581 { 582 updateColumnTranspose(regionSparse); 583 } 523 584 /** Updates one column for dual steepest edge weights (FTRAN) */ 524 virtual void updateWeights ( CoinIndexedVector ®ionSparse) const;585 virtual void updateWeights(CoinIndexedVector ®ionSparse) const; 525 586 //@} 526 587 /// *** Below this user may not want to know about … … 531 592 /// Get rid of all memory 532 593 inline void clearArrays() 533 { gutsOfDestructor();} 594 { 595 gutsOfDestructor(); 596 } 534 597 /// Returns array to put basis indices in 535 virtual inline int * indices() const 536 { return reinterpret_cast<int *> (elements_+numberRows_*numberRows_);} 598 virtual inline int *indices() const 599 { 600 return reinterpret_cast< int * >(elements_ + numberRows_ * numberRows_); 601 } 537 602 /// Returns permute in 538 virtual inline int * permute() const 539 { return NULL;/*pivotRow_*/;} 540 //@} 541 542 /// The real work of desstructor 603 virtual inline int *permute() const 604 { 605 return NULL; /*pivotRow_*/ 606 ; 607 } 608 //@} 609 610 /// The real work of desstructor 543 611 void gutsOfDestructor(); 544 612 /// The real work of constructor … … 552 620 returns 0=OK, 1=Probably OK, 2=singular */ 553 621 int checkPivot(double saveFromU, double oldPivot) const; 554 ////////////////// data //////////////////622 ////////////////// data ////////////////// 555 623 protected: 556 624 /// Maximum length of iterating area … … 564 632 }; 565 633 #endif 634 635 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2 636 */
Note: See TracChangeset
for help on using the changeset viewer.