Changeset 787


Ignore:
Timestamp:
Sep 21, 2007 1:57:32 PM (11 years ago)
Author:
forrest
Message:

fix bug for Stefano Gliozzi

Location:
stable/1.1/Cbc/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable/1.1/Cbc/src/CbcModel.cpp

    r584 r787  
    56155615*/
    56165616double
    5617 CbcModel::checkSolution (double cutoff, const double *solution,
     5617CbcModel::checkSolution (double cutoff, double *solution,
    56185618                         bool fixVariables, double objectiveValue)
    56195619
     
    57165716    */
    57175717    if ((solver_->isProvenOptimal()||(specialOptions_&4)!=0) && objectiveValue <= cutoff) {
    5718       double * solution = new double[numberColumns];
    57195718      memcpy(solution ,solver_->getColSolution(),numberColumns*sizeof(double)) ;
    57205719     
     
    57545753        delete [] rowActivity ;
    57555754      }
    5756       delete [] solution;
    57575755    } else {
    57585756      objectiveValue=1.0e50 ;
     
    59095907void
    59105908CbcModel::setBestSolution (CBC_Message how,
    5911                            double & objectiveValue, const double *solution,
     5909                           double & objectiveValue, const double *solutionIn,
    59125910                           bool fixVariables)
    59135911
    59145912{
     5913  double * solution=CoinCopyOfArray(solutionIn,solver_->getNumCols());
    59155914  if (!solverCharacteristics_->solutionAddsCuts()) {
    59165915    // Can trust solution
     
    61126111    delete [] candidate;
    61136112  }
     6113  delete [] solution;
    61146114  return ;
    61156115}
  • stable/1.1/Cbc/src/CbcModel.hpp

    r395 r787  
    904904      Previously computed objective value is now passed in (in case user does not do solve)
    905905 */
    906   double checkSolution(double cutoff, const double * solution,
     906  double checkSolution(double cutoff, double * solution,
    907907                       bool fixVariables, double originalObjValue);
    908908  /** Test the current solution for feasiblility.
Note: See TracChangeset for help on using the changeset viewer.