BonDummyHeuristic.cpp
Go to the documentation of this file.
1 // (C) Copyright Carnegie Mellon University 2005
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors :
6 // P. Bonami, Carnegie Mellon University
7 //
8 // Date : 05/26/2005
9 
10 #include "BonDummyHeuristic.hpp"
11 #include "CoinHelperFunctions.hpp"
12 #include "CbcModel.hpp"
13 
14 #include "OsiAuxInfo.hpp"
15 namespace Bonmin
16 {
19  OsiTMINLPInterface * si)
20  :
21  CbcHeuristic(model),
22  nlp_(si)
23  {}
24 
26  :
27  CbcHeuristic(),
28  nlp_(si)
29  {}
31  void
33  {
34  nlp_ = si;
35  }
37  int
38  DummyHeuristic::solution(double &solutionValue, double *betterSolution)
39  {
40  OsiBabSolver * babSolver = dynamic_cast<OsiBabSolver *>
41  (model_->solver()->getAuxiliaryInfo());
42  // double bestKnown = getObjValue();
43  if (babSolver) {
44  return babSolver->solution(solutionValue, betterSolution,
45  model_->getNumCols());
46  }
47  return 0;
48  }
49 
50 }
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
virtual int solution(double &solutionValue, double *betterSolution)
heuristic method
void setNlp(OsiTMINLPInterface *si)
Set nlp_.
DummyHeuristic(OsiTMINLPInterface *si=NULL)
Default constructor.
OsiTMINLPInterface * nlp_
Pointer to the Ipopt interface.