Couenne  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BonCouenneInfo.hpp
Go to the documentation of this file.
1 /* $Id: BonCouenneInfo.hpp 488 2011-01-10 17:06:41Z pbelotti $ */
2 // (C) Copyright International Business Machines Corporation 2008
3 // All Rights Reserved.
4 // This code is published under the Eclipse Public License (EPL).
5 //
6 // Authors :
7 // Andreas Waechter, International Business Machines Corporation
8 //
9 // Date : 02/10/2008
10 
11 #ifndef BonCouenneInfos_H
12 #define BonCouenneInfos_H
13 
14 #include "BonBabInfos.hpp"
15 #include "BonCbc.hpp"
16 #include "IpSmartPtr.hpp"
17 #include <list>
18 
19 namespace Couenne {
20 
22  class CouenneInfo : public Bonmin::BabInfo
23  {
24  public:
26  class NlpSolution: public Ipopt::ReferencedObject
27  {
28  public:
29  // meaningful constructor
30  NlpSolution(int n, const double* sol, double objval);
31 
32  // destructor
33  ~NlpSolution();
34 
37  const double* solution() const
38  {
39  return sol_;
40  }
41  double objVal() const
42  {
43  return objVal_;
44  }
45  int nVars() const
46  {
47  return n_;
48  }
50 
51  private:
53  NlpSolution();
54  NlpSolution(const NlpSolution&);
55  void operator=(const NlpSolution&);
57 
58  int n_;
60  double* sol_;
62  double objVal_;
63  };
64 
66  CouenneInfo(int type);
67 
69  CouenneInfo(const OsiBabSolver &other);
70 
72  CouenneInfo(const CouenneInfo &other);
73 
75  virtual ~CouenneInfo();
76 
78  virtual OsiAuxInfo * clone() const;
79 
81  const std::list<Ipopt::SmartPtr<const NlpSolution> >& NlpSolutions() const {
82  return nlpSols_;
83  }
84 
87  {
88  nlpSols_.push_back(newSol);
89  }
90 
91  protected:
92  std::list<Ipopt::SmartPtr<const NlpSolution> > nlpSols_;
93  };
94 }
95 
96 #endif
virtual OsiAuxInfo * clone() const
Virtual copy constructor.
double objVal_
objective function of stored solution
CouenneInfo(int type)
Default constructor.
void operator=(const NlpSolution &)
Class for storing an Nlp Solution.
const double * solution() const
std::list< Ipopt::SmartPtr< const NlpSolution > > nlpSols_
Bonmin class for passing info between components of branch-and-cuts.
const std::list< Ipopt::SmartPtr< const NlpSolution > > & NlpSolutions() const
List of all stored NLP solutions.
void addSolution(Ipopt::SmartPtr< const NlpSolution > newSol)
Add a new NLP solution.
double * sol_
values of the stored solution
virtual ~CouenneInfo()
Destructor.