Bonmin  1.8.8
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;
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 
62  static void registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions);
63 
65  void Initialize(Ipopt::SmartPtr<Ipopt::OptionsList> options);
66 
67  private:
70 
73 
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 
98 
101 
104 
106  std::vector<std::pair<int, int> >* col_and_jac_g_;
107 
108  };
109 
110 }
111 #endif
int numberRows_
Number of rows.
virtual CbcHeuristic * clone() const
Virtual constructor.
std::vector< std::pair< int, int > > * col_and_jac_g_
Jacobian of g.
~RoundingFPump()
Destructor.
int enableAdvanced_
To enable advanced unstable stuff.
HeuristicFPump()
Default constructor.
int objective_norm_
Norm of the objective function - either 1 or 2.
void setSetup(BonminSetup *setup)
Change setup used for heuristic.
int numberColumns_
Number of columns.
void round(const double integerTolerance, const double primalTolerance, double *solution)
Rounds the solution.
TMINLP2TNLP * minlp_
Pointer to problem.
static void registerOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register the options for this heuristic.
virtual int solution(double &solutionValue, double *betterSolution)
Performs heuristic.
void Initialize(Ipopt::SmartPtr< Ipopt::OptionsList > options)
Initiaize using passed options.
virtual int solution(double &solutionValue, double *betterSolution, OsiCuts &cs)
Performs heuristic with add cust.
void gutsOfConstructor()
gutsOfConstructor
HeuristicFPump & operator=(const HeuristicFPump &rhs)
Assignment operator.
Ipopt::SmartPtr< Ipopt::OptionsList > options()
Acces list of Options.
This is an adapter class that converts a TMINLP to a TNLP to be solved by Ipopt.
BonminSetup * setup_
Setup to use for local searches (will make copies).
virtual void resetModel(CbcModel *model)
Resets stuff if model changes.
RoundingFPump(TMINLP2TNLP *minlp)
Default constructor.