Ignore:
Timestamp:
Sep 3, 2002 1:43:51 PM (18 years ago)
Author:
forrest
Message:

Synchronizing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/devel-1/ClpDualRowSteepest.cpp

    r2 r17  
    3030    savedWeights_(NULL)
    3131{
    32   type_=2;
     32  type_=2+64*mode;
    3333}
    3434
     
    245245      }
    246246    }
     247#ifdef CLP_DEBUG
    247248    assert(work3[pivotRow]&&work[pivotRow]);
     249#endif
    248250    alternateWeights_->setNumElements(nSave);
    249251    if (norm < TRY_NORM)
     
    275277  const int * pivotVariable = model_->pivotVariable();
    276278  double * infeas = infeasible_->denseVector();
     279  int pivotRow = model_->pivotRow();
     280  double * solution = model_->solutionRegion();
    277281  for (i=0;i<number;i++) {
    278282    int iRow=which[i];
    279283    int iPivot=pivotVariable[iRow];
    280     double & value = model_->solutionAddress(iPivot);
     284    double value = solution[iPivot];
    281285    double cost = model_->cost(iPivot);
    282286    double change = primalRatio*work[iRow];
    283287    value -= change;
     288    changeObj -= change*cost;
     289    solution[iPivot] = value;
    284290    double lower = model_->lower(iPivot);
    285291    double upper = model_->upper(iPivot);
     292    // But if pivot row then use value of incoming
     293    if (iRow==pivotRow) {
     294      iPivot = model_->sequenceIn();
     295      // make last resort choice
     296      lower = 1.0e-6*model_->lower(iPivot);
     297      upper = 1.0e-6*model_->upper(iPivot);
     298      value = 1.0e-6*model_->valueIncomingDual();
     299    }
    286300    if (value>upper+tolerance) {
    287301      // store square in list
     
    301315        infeas[iRow] = 1.0e-100;
    302316    }
    303     changeObj -= change*cost;
    304317    work[iRow]=0.0;
    305318  }
     
    332345    }
    333346    state_=1;
    334   } else if (mode==2||mode==4) {
     347  } else if (mode==2||mode==4||mode==5) {
    335348    // restore
    336     if (!weights_||state_==-1) {
     349    if (!weights_||state_==-1||mode==5) {
    337350      // initialize weights
    338351      delete [] weights_;
     
    343356      alternateWeights_->reserve(numberRows+
    344357                                 model_->factorization()->maximumPivots());
    345       if (!mode_) {
     358      if (!mode_||mode==5) {
    346359        // initialize to 1.0 (can we do better?)
    347360        for (i=0;i<numberRows;i++) {
Note: See TracChangeset for help on using the changeset viewer.