Changeset 494
 Timestamp:
 Nov 1, 2004 9:18:04 AM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/ClpDualRowSteepest.cpp
r482 r494 136 136 return *this; 137 137 } 138 139 138 // Returns pivot row, 1 if none 140 139 int … … 144 143 int i,iRow; 145 144 double * infeas = infeasible_>denseVector(); 146 double largest= 1.0e50;145 double largest=0.0; 147 146 int * index = infeasible_>getIndices(); 148 147 int number = infeasible_>getNumElements(); … … 257 256 #endif 258 257 double weight = weights_[iRow]; 258 assert (weight<1.0e50); 259 259 //largestWeight = CoinMax(largestWeight,weight); 260 260 //smallestWeight = CoinMin(smallestWeight,weight); … … 744 744 } else { 745 745 int * which = alternateWeights_>getIndices(); 746 CoinIndexedVector * rowArray3 = model_>rowArray(3); 747 assert (!rowArray3>getNumElements()); 748 int * back = rowArray3>getIndices(); 749 // In case something went wrong 750 for (i=0;i<numberRows+numberColumns;i++) 751 back[i]=1; 746 752 if (mode!=4) { 747 753 // save … … 752 758 } else { 753 759 // restore 754 memcpy(which,savedWeights_>getIndices(), 755 numberRows*sizeof(int)); 756 memcpy(weights_,savedWeights_>denseVector(), 757 numberRows*sizeof(double)); 760 //memcpy(which,savedWeights_>getIndices(), 761 // numberRows*sizeof(int)); 762 //memcpy(weights_,savedWeights_>denseVector(), 763 // numberRows*sizeof(double)); 764 which = savedWeights_>getIndices(); 758 765 } 759 766 // restore (a bit slow  but only every refactorization) 760 double * array = new double[numberRows+numberColumns];767 double * array = savedWeights_>denseVector(); 761 768 for (i=0;i<numberRows;i++) { 762 769 int iSeq=which[i]; 763 array[iSeq]=weights_[i];770 back[iSeq]=i; 764 771 } 765 772 for (i=0;i<numberRows;i++) { 766 773 int iPivot=pivotVariable[i]; 767 weights_[i]=array[iPivot]; 768 if (weights_[i]<TRY_NORM) 769 weights_[i] = TRY_NORM; // may need to check more 770 } 771 delete [] array; 774 iPivot = back[iPivot]; 775 if (iPivot>=0) { 776 weights_[i]=array[iPivot]; 777 if (weights_[i]<TRY_NORM) 778 weights_[i] = TRY_NORM; // may need to check more 779 } else { 780 // odd 781 weights_[i]=1.0; 782 } 783 } 772 784 } 773 785 state_=0;
Note: See TracChangeset
for help on using the changeset viewer.