Bonmin  1.8.7
BonHeuristicFPump.hpp
Go to the documentation of this file.
1 // Copyright (C) 2007, International Business Machines Corporation and others.
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors :
6 // Joao P. Goncalves, International Business Machines Corporation
7 //
8 // Date : November 12, 2007
9 
10 #ifndef BonHeuristicFPump_HPP
11 #define BonHeuristicFPump_HPP
13 #include "BonBonminSetup.hpp"
14 #include "CbcHeuristic.hpp"
15 
16 namespace Bonmin
17 {
18  class HeuristicFPump : public CbcHeuristic
19  {
20  public:
23 
25  HeuristicFPump(BonminSetup * setup);
26 
28  HeuristicFPump(const HeuristicFPump &copy);
29 
32 
35 
37  virtual CbcHeuristic * clone() const{
38  return new HeuristicFPump(*this);
39  }
40 
42  virtual void resetModel(CbcModel * model){
43  setModel(model);
44  }
45 
47  void setSetup(BonminSetup * setup){
48  setup_ = setup;
49  Initialize(setup_->options());
50  }
51 
53  virtual int solution(double &solutionValue, double *betterSolution);
54 
56  virtual int solution(double &solutionValue, double *betterSolution, OsiCuts & cs)
57  {
58  return solution(solutionValue, betterSolution);
59  }
60 
63 
66 
67  private:
69  BonminSetup * setup_;
70 
72  int objective_norm_;
73 
75  int enableAdvanced_;
76  };
77 
79  {
80  public:
82  RoundingFPump(TMINLP2TNLP* minlp);
83 
86 
88  void round(const double integerTolerance,
89  const double primalTolerance,
90  double* solution);
91 
92  private:
94  void gutsOfConstructor();
95 
97  TMINLP2TNLP* minlp_;
98 
100  int numberRows_;
101 
103  int numberColumns_;
104 
106  std::vector<std::pair<int, int> >* col_and_jac_g_;
107 
108  };
109 
110 }
111 #endif
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
RoundingFPump(TMINLP2TNLP *minlp)
Default constructor.
HeuristicFPump()
Default constructor.
(C) Copyright International Business Machines Corporation 2007
Ipopt::SmartPtr< Ipopt::OptionsList > options()
Acces list of Options.
void Initialize(Ipopt::SmartPtr< Ipopt::OptionsList > options)
Initiaize using passed options.
virtual CbcHeuristic * clone() const
Virtual constructor.
void round(const double integerTolerance, const double primalTolerance, double *solution)
Rounds the solution.
void setSetup(BonminSetup *setup)
Change setup used for heuristic.
This is an adapter class that converts a TMINLP to a TNLP to be solved by Ipopt.
virtual int solution(double &solutionValue, double *betterSolution)
Performs heuristic.
HeuristicFPump & operator=(const HeuristicFPump &rhs)
Assignment operator.
virtual int solution(double &solutionValue, double *betterSolution, OsiCuts &cs)
Performs heuristic with add cust.
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register the options for this heuristic.
~RoundingFPump()
Destructor.