Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

OsiAuxInfo.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2006, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef OsiAuxInfo_H
00004 #define OsiAuxInfo_H
00005 
00006 class OsiSolverInterface;
00007 
00008 //#############################################################################
00019 class OsiAuxInfo {
00020 public:
00021   // Default Constructor 
00022   OsiAuxInfo (void * appData = NULL);
00023 
00024   // Copy Constructor 
00025   OsiAuxInfo (const OsiAuxInfo & rhs);
00026   // Destructor
00027   virtual ~OsiAuxInfo();
00028   
00030   virtual OsiAuxInfo * clone() const;
00032   OsiAuxInfo & operator=(const OsiAuxInfo& rhs);
00033   
00035   inline void * getApplicationData() const
00036   { return appData_;};
00037 protected:
00039     void * appData_;
00040 };
00041 //#############################################################################
00047 class OsiBabSolver : public OsiAuxInfo {
00048 public:
00049   // Default Constructor 
00050   OsiBabSolver (int solverType=0);
00051 
00052   // Copy Constructor 
00053   OsiBabSolver (const OsiBabSolver & rhs);
00054   // Destructor
00055   virtual ~OsiBabSolver();
00056   
00058   virtual OsiAuxInfo * clone() const;
00060   OsiBabSolver & operator=(const OsiBabSolver& rhs);
00061   
00063   inline void setSolver(const OsiSolverInterface * solver)
00064   { solver_ = solver;};
00066   inline void setSolver(const OsiSolverInterface & solver)
00067   { solver_ = &solver;};
00068 
00074   int solution(double & objectiveValue,
00075                        double * newSolution, int numberColumns);
00079   void setSolution(const double * solution, int numberColumns, double objectiveValue);
00080 
00086   bool hasSolution(double & solutionValue, double * solution);
00087 
00099   inline void setSolverType(int value)
00100   { solverType_=value;};
00112   inline int solverType() const
00113   { return solverType_;};
00116   inline bool solutionAddsCuts() const
00117   { return solverType_==3;};
00120   inline bool solverAccurate() const
00121   { return solverType_==0||solverType_==2;};
00123   inline bool reducedCostsAccurate() const
00124   { return solverType_==0;};
00126   double mipBound() const;
00128   bool mipFeasible() const;
00130   inline void setMipBound(double value)
00131   { mipBound_ = value;};
00133   inline double bestObjectiveValue() const
00134   { return bestObjectiveValue_;};
00136   inline bool tryCuts() const
00137   { return solverType_!=2;};
00139   inline bool warmStart() const
00140   { return solverType_!=2;};
00141 protected:
00143   const OsiSolverInterface * solver_;
00155   int solverType_;
00157   double bestObjectiveValue_;
00159   double * bestSolution_;
00161   double mipBound_;
00163   int sizeSolution_;
00164 };
00165 
00166 #endif

Generated on Sun Jun 11 02:00:39 2006 by  doxygen 1.3.9.1