00001 // (C) Copyright Carnegie Mellon University 2005 00002 // All Rights Reserved. 00003 // This code is published under the Common Public License. 00004 // 00005 // Authors : 00006 // P. Bonami, Carnegie Mellon University 00007 // 00008 // Date : 05/26/2005 00009 00010 #include "BonDummyHeuristic.hpp" 00011 #include "CoinHelperFunctions.hpp" 00012 #include "CbcModel.hpp" 00013 00014 #include "OsiAuxInfo.hpp" 00015 namespace Bonmin 00016 { 00018 DummyHeuristic::DummyHeuristic(CbcModel &model, 00019 OsiTMINLPInterface * si) 00020 : 00021 CbcHeuristic(model), 00022 nlp_(si) 00023 {} 00024 00025 DummyHeuristic::DummyHeuristic(OsiTMINLPInterface * si) 00026 : 00027 CbcHeuristic(), 00028 nlp_(si) 00029 {} 00031 void 00032 DummyHeuristic::setNlp(OsiTMINLPInterface * si) 00033 { 00034 nlp_ = si; 00035 } 00037 int 00038 DummyHeuristic::solution(double &solutionValue, double *betterSolution) 00039 { 00040 OsiBabSolver * babSolver = dynamic_cast<OsiBabSolver *> 00041 (model_->solver()->getAuxiliaryInfo()); 00042 // double bestKnown = getObjValue(); 00043 if (babSolver) { 00044 return babSolver->solution(solutionValue, betterSolution, 00045 model_->getNumCols()); 00046 } 00047 return 0; 00048 } 00049 00050 }