Changeset 1597 for trunk/Clp


Ignore:
Timestamp:
Aug 31, 2010 7:16:24 AM (9 years ago)
Author:
forrest
Message:

fix stupidity in example

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/examples/sprint2.cpp

    r1559 r1597  
    3939     memcpy(saveUpper, columnUpper, numberColumns * sizeof(double));
    4040     // Fix in some magical way so remaining problem is easy
     41#if 0
    4142     // This is from a real-world problem
    4243     for (int iColumn = 0; iColumn < numberColumns; iColumn++) {
     
    4748          }
    4849     }
     50#else
     51     double * obj = model->objective();
     52     double * saveObj = new double [numberColumns];
     53     memcpy(saveObj, obj, numberColumns * sizeof(double));
     54     memset(obj, 0, numberColumns * sizeof(double));
     55     model->dual();
     56     memcpy(obj, saveObj, numberColumns * sizeof(double));
     57     delete [] saveObj;
     58     for (int iColumn = 0; iColumn < numberColumns; iColumn++) {
     59         if (solution[iColumn]<columnLower[iColumn]+1.0e-8) {
     60             columnUpper[iColumn] = columnLower[iColumn];
     61       }
     62     }
     63#endif
    4964     double * solution = model.primalColumnSolution();
    5065
     
    107122               lastObjective = model.objectiveValue();
    108123               // now massage weight so all basic in plus good djs
     124               const double * djs = model->primalDualSolution();
    109125               for (int iColumn = 0; iColumn < numberColumns; iColumn++) {
    110                     double dj = weight[iColumn];
     126                    double dj = djs[iColumn];
    111127                    double value = solution[iColumn];
    112128                    if (model.getStatus(iColumn) == ClpSimplex::basic)
Note: See TracChangeset for help on using the changeset viewer.