00001 // (C) Copyright International Business Machines Corporation 2008 00002 // All Rights Reserved. 00003 // This code is published under the Common Public License. 00004 // 00005 // Authors : 00006 // Andreas Waechter, International Business Machines Corporation 00007 // 00008 // Date : 02/10/2008 00009 00010 #ifndef BonCouenneInfos_H 00011 #define BonCouenneInfos_H 00012 00013 #include "BonBabInfos.hpp" 00014 #include <list> 00015 00016 namespace Bonmin 00017 { 00019 class CouenneInfo : public Bonmin::BabInfo 00020 { 00021 public: 00023 class NlpSolution: public Ipopt::ReferencedObject 00024 { 00025 public: 00026 // meaningful constructor 00027 NlpSolution(int n, const double* sol, double objval); 00028 00029 // destructor 00030 ~NlpSolution(); 00031 00034 const double* solution() const 00035 { 00036 return sol_; 00037 } 00038 double objVal() const 00039 { 00040 return objVal_; 00041 } 00042 int nVars() const 00043 { 00044 return n_; 00045 } 00047 00048 private: 00050 NlpSolution(); 00051 NlpSolution(const NlpSolution&); 00052 void operator=(const NlpSolution&); 00054 00055 int n_; 00057 double* sol_; 00059 double objVal_; 00060 }; 00061 00063 CouenneInfo(int type); 00064 00066 CouenneInfo(const OsiBabSolver &other); 00067 00069 CouenneInfo(const CouenneInfo &other); 00070 00072 virtual ~CouenneInfo(); 00073 00075 virtual OsiAuxInfo * clone() const; 00076 00078 const std::list<SmartPtr<const NlpSolution> >& NlpSolutions() const { 00079 return nlpSols_; 00080 } 00081 00083 void addSolution(SmartPtr<const NlpSolution> newSol) 00084 { 00085 nlpSols_.push_back(newSol); 00086 } 00087 00088 protected: 00089 std::list<SmartPtr<const NlpSolution> > nlpSols_; 00090 }; 00091 }/* End namespace.*/ 00092 00093 #endif