Changeset 197 for branches


Ignore:
Timestamp:
Aug 14, 2003 12:58:52 PM (16 years ago)
Author:
forrest
Message:

Stuff

Location:
branches/pre
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/pre/ClpPrimalColumnSteepest.cpp

    r196 r197  
    565565      referenceIn=1.0;
    566566    // save outgoing weight round update
    567     double outgoingWeight=weights_[sequenceOut];
     567    double outgoingWeight=0.0;
     568    if (sequenceOut>=0)
     569      outgoingWeight=weights_[sequenceOut];
    568570    // update weights
    569571    if (anyUpdates!=1) {
     
    654656    }
    655657    // restore outgoing weight
    656     weights_[sequenceOut]=outgoingWeight;
     658    if (sequenceOut>=0)
     659      weights_[sequenceOut]=outgoingWeight;
    657660    alternateWeights_->clear();
    658661    spareColumn2->setNumElements(0);
  • branches/pre/ClpSimplexDual.cpp

    r196 r197  
    31293129    /* Possibilities are:
    31303130       Both sides feasible - store
    3131        Neither side feasible - set objective high and exit
     3131       Neither side feasible - set objective high and exit if desired
    31323132       One side feasible - change bounds and resolve
    31333133    */
  • branches/pre/ClpSimplexPrimalQuadratic.cpp

    r196 r197  
    536536    bool deleteCosts=false;
    537537    if (scalingFlag_) {
    538       // get own copy of original objective and scale
    539       ClpQuadraticObjective * quadraticObj = new ClpQuadraticObjective(*info->originalObjective());
    540       info->setOriginalObjective(quadraticObj);
     538      // scale
    541539      CoinPackedMatrix * quadratic = info->quadraticObjective();
    542540      double * objective = info->linearObjective();
     
    571569      deleteCosts=true;
    572570    } else if (optimizationDirection_!=1.0) {
    573       // get own copy of original objective and scale
    574       ClpQuadraticObjective * quadraticObj = new ClpQuadraticObjective(*info->originalObjective());
    575       info->setOriginalObjective(quadraticObj);
    576571      CoinPackedMatrix * quadratic = info->quadraticObjective();
    577572      double * objective = info->linearObjective();
     
    13661361  // sj for incoming
    13671362  int iSjRow2=-1,crucialSj2=-1;
    1368   if (sequenceIn_<numberColumns_) {
     1363  if (sequenceIn_<numberXColumns) {
    13691364    const int * which = info->quadraticSequence();
    13701365    crucialSj2 = which[sequenceIn_];
    13711366    if (crucialSj2>=0)
    13721367      crucialSj2 += numberRows_; // sj2 which should go to 0.0
    1373   } else {
     1368  } else if (sequenceIn_>=numberColumns_) {
    13741369    crucialSj2 = sequenceIn_-numberColumns_+numberXColumns; // pi which should go to 0.0
    13751370  }
     
    14461441      coeff1=0.0;
    14471442    }
    1448     //assert (fabs(way*coeff1-dualIn_)<1.0e-1*(1.0+fabs(dualIn_)));
    1449     //assert (way*coeff1*dualIn_>=0.0);
     1443    assert (fabs(way*coeff1-dualIn_)<1.0e-1*(1.0+fabs(dualIn_)));
     1444    assert (way*coeff1*dualIn_>=0.0);
    14501445    if (way*coeff1*dualIn_<0.0) {
    14511446      // bad
     
    15171512  double upperTheta = maximumMovement;
    15181513  bool throwAway=false;
    1519   if (numberIterations_==126) {
     1514  if (numberIterations_==106) {
    15201515    printf("Bad iteration coming up after iteration %d\n",numberIterations_);
    15211516  }
     
    26942689  ClpQuadraticObjective * quadraticObj = (dynamic_cast< ClpQuadraticObjective*>(objective_));
    26952690  assert (quadraticObj);
    2696   info.setOriginalObjective(quadraticObj);
    2697   CoinPackedMatrix * quadratic = info.quadraticObjective();
     2691  CoinPackedMatrix * quadratic = quadraticObj->quadraticObjective();
    26982692  if (!quadratic||!quadratic->getNumElements()) {
    26992693    // no quadratic part
     
    27042698  double * columnLower = this->columnLower();
    27052699  double * columnUpper = this->columnUpper();
    2706   double * objective = info.linearObjective();
     2700  double * objective = this->objective();
    27072701  double * solution = this->primalColumnSolution();
    27082702  double * dj = this->dualColumnSolution();
     
    28802874                     objective2,
    28812875                     rowLower2,rowUpper2);
    2882   delete [] objective2;
    28832876  delete [] rowLower2;
    28842877  delete [] rowUpper2;
     
    29192912    start2[iColumn+1]=numberElements;
    29202913  // Load up objective
    2921   model2->loadQuadraticObjective(newNumberColumns,start2,row2,elements2);
     2914  ClpQuadraticObjective * obj =
     2915    new ClpQuadraticObjective(objective2,newNumberColumns,
     2916                              start2,row2,elements2);
     2917  delete [] objective2;
     2918  info.setOriginalObjective(obj);
     2919  //model2->loadQuadraticObjective(newNumberColumns,start2,row2,elements2);
    29222920  delete [] start2;
    29232921  delete [] row2;
Note: See TracChangeset for help on using the changeset viewer.