Bonmin  1.7
BonAuxInfos.hpp
Go to the documentation of this file.
00001 // (C) Copyright International Business Machines Corporation 2007
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // Authors :
00006 // Pierre Bonami, International Business Machines Corporation
00007 //
00008 // Date : 04/23/2007
00009 
00010 #ifndef BonAuxInfos_H
00011 #define BonAuxInfos_H
00012 #include <cstdlib>
00013 #include <vector>
00014 #include "OsiAuxInfo.hpp"
00015 #include "CoinSmartPtr.hpp"
00016 #include "BonTypes.hpp"
00017 
00018 
00019 namespace Bonmin {
00020 
00021 
00023 class AuxInfo : public OsiBabSolver {
00024 public:
00026   AuxInfo(int type);
00027 
00029   AuxInfo(const OsiBabSolver &other);
00030 
00032   AuxInfo(const AuxInfo &other);
00033   
00035   virtual ~AuxInfo();
00036   
00038   virtual OsiAuxInfo * clone() const;
00039   
00041   void setFeasibleNode(){
00042     infeasibleNode_ = false;}
00043   
00045   void setInfeasibleNode(){
00046     infeasibleNode_ = true;}
00047   
00049   bool infeasibleNode(){
00050     return infeasibleNode_;}
00051   
00053   const double * nlpSolution(){
00054 
00055     if(hasNlpSolution_)
00056       return nlpSolution_;
00057     else
00058       return NULL;
00059   }
00060 
00062   double nlpObjValue ();
00063 
00065   void setNlpSolution(const double * sol, int numcols, double objValue);
00066   
00068   void setHasNlpSolution(bool b){
00069     hasNlpSolution_ = b;}
00071   const std::vector<double>& bestSolution2() const
00072   {
00073     return (*bestSolution2_)();
00074   }
00077   double bestObj2() const
00078   {
00079     return (*bestObj2_)();
00080   }
00082   void setBestObj2(double o)
00083   {
00084     (*bestObj2_)() = o;
00085   }
00086   void setBestSolution2(int n, double * d)
00087   {
00088     (*bestSolution2_)().clear();
00089     (*bestSolution2_)().insert((*bestSolution2_)().end(),d, d+n);
00090   }
00091 protected: 
00093   bool infeasibleNode_;
00095   double objValue_;
00097   double * nlpSolution_;
00099   int numcols_;
00101   bool hasNlpSolution_;
00103   Coin::SmartPtr< SimpleReferenced<std::vector<double> > > bestSolution2_;
00105   Coin::SmartPtr< SimpleReferenced<double> > bestObj2_;
00106   };
00107 }/* End namespace.*/
00108 
00109 #endif
00110