source: branches/devel/Bonmin/src/OaInterface/BonDummyHeuristic.cpp @ 62

Last change on this file since 62 was 62, checked in by pbonami, 13 years ago

astyled the devel branch

  • Property svn:eol-style set to native
  • Property svn:keywords set to "Author Date Id Revision"
File size: 1.1 KB
Line 
1// (C) Copyright Carnegie Mellon University 2005
2// All Rights Reserved.
3// This code is published under the Common 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"
15namespace Bonmin
16{
17/// Default constructor
18  DummyHeuristic::DummyHeuristic(CbcModel &model,
19      OsiTMINLPInterface * si)
20      :
21      CbcHeuristic(model),
22      nlp_(si)
23  {}
24
25  DummyHeuristic::DummyHeuristic(OsiTMINLPInterface * si)
26      :
27      CbcHeuristic(),
28      nlp_(si)
29  {}
30/// Assign an OsiTMINLPInterface
31  void
32  DummyHeuristic::assignInterface(OsiTMINLPInterface * si)
33  {
34    nlp_ = si;
35  }
36/// heuristic method
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}
Note: See TracBrowser for help on using the repository browser.