Changeset 225 for trunk/ClpDualRowDantzig.cpp
 Timestamp:
 Oct 15, 2003 5:34:57 PM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/ClpDualRowDantzig.cpp
r63 r225 76 76 return chosenRow; 77 77 } 78 // Returns pivot alpha 79 double 80 ClpDualRowDantzig::updateWeights(CoinIndexedVector * input, 81 CoinIndexedVector * spare, 82 CoinIndexedVector * updatedColumn) 83 { 84 // pivot element 85 double alpha=0.0; 86 // look at updated column 87 double * work = updatedColumn>denseVector(); 88 int number = updatedColumn>getNumElements(); 89 int * which = updatedColumn>getIndices(); 90 int i; 91 int pivotRow = model_>pivotRow(); 92 93 if (updatedColumn>packedMode()) { 94 for (i =0; i < number; i++) { 95 int iRow = which[i]; 96 if (iRow==pivotRow) { 97 alpha = work[i]; 98 break; 99 } 100 } 101 } else { 102 alpha = work[pivotRow]; 103 } 104 return alpha; 105 } 78 106 79 107 /* Updates primal solution (and maybe list of candidates) … … 92 120 double changeObj=0.0; 93 121 const int * pivotVariable = model_>pivotVariable(); 94 for (i=0;i<number;i++) { 95 int iRow=which[i]; 96 int iPivot=pivotVariable[iRow]; 97 double & value = model_>solutionAddress(iPivot); 98 double cost = model_>cost(iPivot); 99 double change = primalRatio*work[iRow]; 100 value = change; 101 changeObj = change*cost; 102 work[iRow]=0.0; 122 if (primalUpdate>packedMode()) { 123 for (i=0;i<number;i++) { 124 int iRow=which[i]; 125 int iPivot=pivotVariable[iRow]; 126 double & value = model_>solutionAddress(iPivot); 127 double cost = model_>cost(iPivot); 128 double change = primalRatio*work[i]; 129 value = change; 130 changeObj = change*cost; 131 work[i]=0.0; 132 } 133 } else { 134 for (i=0;i<number;i++) { 135 int iRow=which[i]; 136 int iPivot=pivotVariable[iRow]; 137 double & value = model_>solutionAddress(iPivot); 138 double cost = model_>cost(iPivot); 139 double change = primalRatio*work[iRow]; 140 value = change; 141 changeObj = change*cost; 142 work[iRow]=0.0; 143 } 103 144 } 104 145 primalUpdate>setNumElements(0);
Note: See TracChangeset
for help on using the changeset viewer.