Couenne 0.5.8
Loading...
Searching...
No Matches
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
19namespace Couenne {
20
23 {
24 public:
27 {
28 public:
29 // meaningful constructor
30 NlpSolution(int n, const double* sol, double objval);
31
32 // destructor
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:
55 void operator=(const NlpSolution&);
57
58 int n_;
60 double* sol_;
62 double objVal_;
63 };
64
66 CouenneInfo(int type);
67
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
Class for storing an Nlp Solution.
const double * solution() const
NlpSolution(int n, const double *sol, double objval)
Bonmin class for passing info between components of branch-and-cuts.
void addSolution(Ipopt::SmartPtr< const NlpSolution > newSol)
Add a new NLP solution.
virtual OsiAuxInfo * clone() const
Virtual copy constructor.
std::list< Ipopt::SmartPtr< const NlpSolution > > nlpSols_
CouenneInfo(const CouenneInfo &other)
Copy constructor.
virtual ~CouenneInfo()
Destructor.
CouenneInfo(int type)
Default constructor.
CouenneInfo(const OsiBabSolver &other)
Constructor from OsiBabSolver.
const std::list< Ipopt::SmartPtr< const NlpSolution > > & NlpSolutions() const
List of all stored NLP solutions.
general include file for different compilers