Changeset 788 for stable/1.2


Ignore:
Timestamp:
Sep 21, 2007 2:28:44 PM (12 years ago)
Author:
forrest
Message:

fix solution bug for Stefano Gliozzi

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

Legend:

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

    r633 r788  
    56845684*/
    56855685double
    5686 CbcModel::checkSolution (double cutoff, const double *solution,
     5686CbcModel::checkSolution (double cutoff, double *solution,
    56875687                         bool fixVariables, double objectiveValue)
    56885688
     
    57855785    */
    57865786    if ((solver_->isProvenOptimal()||(specialOptions_&4)!=0) && objectiveValue <= cutoff) {
    5787       double * solution = new double[numberColumns];
    57885787      memcpy(solution ,solver_->getColSolution(),numberColumns*sizeof(double)) ;
    57895788     
     
    58235822        delete [] rowActivity ;
    58245823      }
    5825       delete [] solution;
    58265824    } else {
    58275825      objectiveValue=1.0e50 ;
     
    59785976void
    59795977CbcModel::setBestSolution (CBC_Message how,
    5980                            double & objectiveValue, const double *solution,
     5978                           double & objectiveValue, const double *solutionIn,
    59815979                           bool fixVariables)
    59825980
    59835981{
     5982  double * solution=CoinCopyOfArray(solutionIn,solver_->getNumCols());
    59845983  if (!solverCharacteristics_->solutionAddsCuts()) {
    59855984    // Can trust solution
     
    61816180    delete [] candidate;
    61826181  }
     6182  delete [] solution;
    61836183  return ;
    61846184}
  • stable/1.2/Cbc/src/CbcModel.hpp

    r480 r788  
    913913      Previously computed objective value is now passed in (in case user does not do solve)
    914914 */
    915   double checkSolution(double cutoff, const double * solution,
     915  double checkSolution(double cutoff, double * solution,
    916916                       bool fixVariables, double originalObjValue);
    917917  /** Test the current solution for feasiblility.
Note: See TracChangeset for help on using the changeset viewer.