source: trunk/Bonmin/src/OaInterface/IpCbcDummyHeuristic.cpp @ 1

Last change on this file since 1 was 1, checked in by andreasw, 13 years ago

imported initial code

  • 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 "IpCbcDummyHeuristic.hpp"
11#include "CoinHelperFunctions.hpp"
12#include "CbcModel.hpp"
13
14#include "OsiAuxInfo.hpp"
15/// Default constructor
16IpCbcDummyHeuristic::IpCbcDummyHeuristic(CbcModel &model,
17    IpoptInterface * si)
18    :
19    CbcHeuristic(model),
20    nlp_(si)
21{}
22
23IpCbcDummyHeuristic::IpCbcDummyHeuristic(IpoptInterface * si)
24    :
25    CbcHeuristic(),
26    nlp_(si)
27{}
28/// Assign an IpoptInterface
29void
30IpCbcDummyHeuristic::assignInterface(IpoptInterface * si)
31{
32  nlp_ = si;
33}
34/// heuristic method
35int
36IpCbcDummyHeuristic::solution(double &solutionValue, double *betterSolution)
37{
38  OsiBabSolver * babSolver = dynamic_cast<OsiBabSolver *>
39      (model_->solver()->getAuxiliaryInfo());
40  //  double bestKnown = getObjValue();
41  if(babSolver) {
42    return babSolver->solution(solutionValue, betterSolution,
43        model_->getNumCols());
44  }
45  return 0;
46}
47
Note: See TracBrowser for help on using the repository browser.