Changeset 2153


Ignore:
Timestamp:
Jul 14, 2015 9:16:48 AM (3 years ago)
Author:
forrest
Message:

duals and djs in solve from hot start

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/OsiClp/OsiClpSolverInterface.cpp

    r2088 r2153  
    24292429    double rhsScale = smallModel_->rhsScale();
    24302430    const double * columnScale = NULL;
     2431    const double * rowScale = NULL;
    24312432    if (smallModel_->scalingFlag()>0) {
    24322433      columnScale = smallModel_->columnScale();
     2434      rowScale = smallModel_->rowScale();
    24332435    }
    24342436    // and do bounds in case dual needs them
     
    26122614    double * solution = modelPtr_->primalColumnSolution();
    26132615    const double * solution2 = smallModel_->solutionRegion();
     2616    double * djs = modelPtr_->dualColumnSolution();
    26142617    if (!columnScale) {
    26152618      for (i=0;i<numberColumns2;i++) {
     
    26272630      }
    26282631    }
     2632    // compute duals and djs
     2633    double * dual = modelPtr_->dualRowSolution();
     2634    const double * dual2 = smallModel_->dualRowSolution();
     2635    if (!rowScale) {
     2636      for (i=0;i<numberRows2;i++) {
     2637        int iRow = whichRow[i];
     2638        dual[iRow]= dual2[i];
     2639      }
     2640    } else {
     2641      for (i=0;i<numberRows2;i++) {
     2642        int iRow = whichRow[i];
     2643        dual[iRow]= dual2[i]*rowScale[i];
     2644      }
     2645    }
     2646    memcpy(djs,modelPtr_->objective(),numberColumns*sizeof(double));
     2647    modelPtr_->clpMatrix()->transposeTimes(-1.0,dual,djs);
    26292648    // could combine with loop above
    26302649    if (modelPtr_==smallModel_)
Note: See TracChangeset for help on using the changeset viewer.