Changeset 919
 Timestamp:
 Feb 16, 2007 2:53:48 PM (14 years ago)
 Location:
 trunk/Clp/src
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Clp/src/ClpFactorization.cpp
r754 r919 247 247 } 248 248 if (numberBasic>model>maximumBasic()) { 249 #if ndef NDEBUG249 #if 0 // ndef NDEBUG 250 250 printf("%d basic  should only be %d\n", 251 251 numberBasic,numberRows); … … 317 317 //fill 318 318 // Fill in counts so we can skip part of preProcess 319 CoinZeroN ( numberInRow_, numberRows_ + 1 ); 320 CoinZeroN ( numberInColumn_, maximumColumnsExtra_ + 1 ); 319 int * numberInRow = numberInRow_.array(); 320 int * numberInColumn = numberInColumn_.array(); 321 CoinZeroN ( numberInRow, numberRows_ + 1 ); 322 CoinZeroN ( numberInColumn, maximumColumnsExtra_ + 1 ); 323 double * elementU = elementU_.array(); 324 int * indexRowU = indexRowU_.array(); 325 CoinBigIndex * startColumnU = startColumnU_.array(); 321 326 for (i=0;i<numberRowBasic;i++) { 322 327 int iRow = pivotTemp[i]; 323 indexRowU _[i]=iRow;324 startColumnU _[i]=i;325 elementU _[i]=slackValue_;326 numberInRow _[iRow]=1;327 numberInColumn _[i]=1;328 } 329 startColumnU _[numberRowBasic]=numberRowBasic;328 indexRowU[i]=iRow; 329 startColumnU[i]=i; 330 elementU[i]=slackValue_; 331 numberInRow[iRow]=1; 332 numberInColumn[i]=1; 333 } 334 startColumnU[numberRowBasic]=numberRowBasic; 330 335 // can change for gub so redo 331 336 numberColumnBasic = numberBasicnumberRowBasic; … … 333 338 pivotTemp+numberRowBasic, 334 339 numberColumnBasic, 335 indexRowU_ ,336 startColumnU _+numberRowBasic,337 numberInRow _,338 numberInColumn _+numberRowBasic,339 elementU_ );340 indexRowU_.array(), 341 startColumnU+numberRowBasic, 342 numberInRow, 343 numberInColumn+numberRowBasic, 344 elementU_.array()); 340 345 #if 0 341 346 { 342 347 printf("%d row basic, %d column basic\n",numberRowBasic,numberColumnBasic); 343 348 for (int i=0;i<numberElements;i++) 344 printf("row %d col %d value %g\n",indexRowU_ [i],indexColumnU_[i],345 elementU_ [i]);349 printf("row %d col %d value %g\n",indexRowU_.array()[i],indexColumnU_[i], 350 elementU_.array()[i]); 346 351 } 347 352 #endif … … 349 354 numberBasic = numberRowBasic+numberColumnBasic; 350 355 if (numberBasic) 351 numberElements = startColumnU _[numberBasic1]352 +numberInColumn _[numberBasic1];356 numberElements = startColumnU[numberBasic1] 357 +numberInColumn[numberBasic1]; 353 358 else 354 359 numberElements=0; … … 377 382 // as we do for network 378 383 matrix>generalExpanded(model,12,useNumberRows); 379 int * permuteBack = permuteBack_;380 int * back = pivotColumnBack_;381 //int * pivotTemp = pivotColumn_ ;384 const int * permuteBack = permuteBack_.array(); 385 const int * back = pivotColumnBack_.array(); 386 //int * pivotTemp = pivotColumn_.array(); 382 387 //ClpDisjointCopyN ( pivotVariable, numberRows , pivotTemp ); 383 388 // Redo pivot order … … 397 402 memset(saveList,0,((numberRows_+31)>>5)*sizeof(int)); 398 403 for (i=numberRows_numberSave;i<numberRows_;i++) { 399 int k=pivotTemp[pivotColumn_ [i]];404 int k=pivotTemp[pivotColumn_.array()[i]]; 400 405 setDense(k); 401 406 } … … 405 410 // these arrays start off as copies of permute 406 411 // (and we could use permute_ instead of pivotColumn (not back though)) 407 ClpDisjointCopyN ( permute_ , useNumberRows , pivotColumn_);408 ClpDisjointCopyN ( permuteBack_ , useNumberRows , pivotColumnBack_);412 ClpDisjointCopyN ( permute_.array(), useNumberRows , pivotColumn_.array() ); 413 ClpDisjointCopyN ( permuteBack_.array(), useNumberRows , pivotColumnBack_.array() ); 409 414 #ifndef SLIM_CLP 410 415 if (networkMatrix) { … … 414 419 delete networkBasis_; // temp 415 420 networkBasis_ = new ClpNetworkBasis(model,numberRows_, 416 pivotRegion_ ,417 permuteBack_ ,418 startColumnU_ ,419 numberInColumn_ ,420 indexRowU_ ,421 elementU_ );421 pivotRegion_.array(), 422 permuteBack_.array(), 423 startColumnU_.array(), 424 numberInColumn_.array(), 425 indexRowU_.array(), 426 elementU_.array()); 422 427 // kill off arrays in ordinary factorization 423 428 if (!doCheck) { … … 490 495 pivotVariable[i]=1; 491 496 // mark as basic or non basic 497 const int * pivotColumn = pivotColumn_.array(); 492 498 for (i=0;i<numberRows;i++) { 493 499 if (rowIsBasic[i]>=0) { 494 if (pivotColumn _[numberBasic]>=0) {495 rowIsBasic[i]=pivotColumn _[numberBasic];500 if (pivotColumn[numberBasic]>=0) { 501 rowIsBasic[i]=pivotColumn[numberBasic]; 496 502 } else { 497 503 rowIsBasic[i]=1; … … 503 509 for (i=0;i<numberColumns;i++) { 504 510 if (columnIsBasic[i]>=0) { 505 if (pivotColumn _[numberBasic]>=0)506 columnIsBasic[i]=pivotColumn _[numberBasic];511 if (pivotColumn[numberBasic]>=0) 512 columnIsBasic[i]=pivotColumn[numberBasic]; 507 513 else 508 514 columnIsBasic[i]=1; … … 938 944 } 939 945 #endif 940 int * permuteBack = pivotColumnBack_; 941 if (!startRowL_!numberInRow_) { 946 int * numberInRow = numberInRow_.array(); 947 int * numberInColumn = numberInColumn_.array(); 948 int * permuteBack = pivotColumnBack_.array(); 949 int * indexRowU = indexRowU_.array(); 950 const CoinBigIndex * startColumnU = startColumnU_.array(); 951 const CoinBigIndex * startRowL = startRowL_.array(); 952 if (!startRowL!numberInRow_.array()) { 942 953 int * temp = new int[numberRows_]; 943 954 memset(temp,0,numberRows_*sizeof(int)); … … 947 958 temp[i]++; 948 959 CoinBigIndex j; 949 for (j=startColumnU _[i];j<startColumnU_[i]+numberInColumn_[i];j++) {950 int iRow=indexRowU _[j];960 for (j=startColumnU[i];j<startColumnU[i]+numberInColumn[i];j++) { 961 int iRow=indexRowU[j]; 951 962 temp[iRow]++; 952 963 } 953 964 } 965 CoinBigIndex * startColumnL = startColumnL_.array(); 966 int * indexRowL = indexRowL_.array(); 954 967 for (i=baseL_;i<baseL_+numberL_;i++) { 955 968 CoinBigIndex j; 956 for (j=startColumnL _[i];j<startColumnL_[i+1];j++) {957 int iRow = indexRowL _[j];969 for (j=startColumnL[i];j<startColumnL[i+1];j++) { 970 int iRow = indexRowL[j]; 958 971 temp[iRow]++; 959 972 } … … 968 981 int i; 969 982 for (i=0;i<numberRows_;i++) { 970 int number = startRowL _[i+1]startRowL_[i]+numberInRow_[i]+1;971 //number = startRowL _[i+1]startRowL_[i]+1;972 //number = numberInRow _[i]+1;983 int number = startRowL[i+1]startRowL[i]+numberInRow[i]+1; 984 //number = startRowL[i+1]startRowL[i]+1; 985 //number = numberInRow[i]+1; 973 986 int iPermute = permuteBack[i]; 974 987 weights[iPermute]=number; 
trunk/Clp/src/ClpSimplexDual.cpp
r914 r919 3906 3906 //assert(numberDualInfeasibilitiesWithoutFree_==0); 3907 3907 3908 if (numberDualInfeasibilities_situationChanged==2) 3908 if (numberDualInfeasibilities_) { 3909 if (numberPrimalInfeasibilities_numberPivots) 3910 problemStatus_=1; // carry on as normal 3911 else 3912 problemStatus_=10; // try primal 3913 } else if (situationChanged==2) { 3909 3914 problemStatus_=1; // carry on as normal 3915 } 3910 3916 situationChanged=0; 3911 3917 } else { … … 4113 4119 lower_[iSequence]=auxiliaryModel_>lowerRegion()[iSequence+numberRows_+numberColumns_]; 4114 4120 upper_[iSequence]=auxiliaryModel_>upperRegion()[iSequence+numberRows_+numberColumns_]; 4121 setFakeBound(iSequence,noFake); 4115 4122 return; 4116 4123 } … … 5030 5037 case superBasic: 5031 5038 case ClpSimplex::isFixed: 5032 assert (bound==noFake);5039 //setFakeBound (iSequence, noFake); 5033 5040 break; 5034 5041 case atUpperBound: … … 5138 5145 thetaUp = 0.0; 5139 5146 bestAlphaDown = fabs(alpha); 5140 bestAlphaUp = bestAlpha Up;5147 bestAlphaUp = bestAlphaDown; 5141 5148 sequenceDown =iSequence2; 5142 5149 sequenceUp = sequenceDown; … … 5358 5365 thetaUp = 0.0; 5359 5366 bestAlphaDown = fabs(alpha); 5360 bestAlphaUp = bestAlpha Up;5367 bestAlphaUp = bestAlphaDown; 5361 5368 sequenceDown =iSequence2; 5362 5369 sequenceUp = sequenceDown;
Note: See TracChangeset
for help on using the changeset viewer.