00001
00002
00003 #ifndef OsiSolverBranch_H
00004 #define OsiSolverBranch_H
00005
00006 class OsiSolverInterface;
00007 #include "CoinWarmStartBasis.hpp"
00008 #include "CoinFinite.hpp"
00009
00010
00011
00017 class OsiSolverBranch {
00018
00019 public:
00021
00022
00023 void addBranch(int iColumn, double value);
00024
00026 void addBranch(int way,int numberTighterLower, const int * whichLower, const double * newLower,
00027 int numberTighterUpper, const int * whichUpper, const double * newUpper);
00029 void addBranch(int way,int numberColumns,const double * oldLower, const double * newLower,
00030 const double * oldUpper, const double * newUpper);
00031
00033 void applyBounds(OsiSolverInterface & solver,int way) const;
00035 bool feasibleOneWay(const OsiSolverInterface & solver) const;
00037 inline const int * starts() const
00038 { return start_;}
00040 inline const int * which() const
00041 { return indices_;}
00043 inline const double * bounds() const
00044 { return bound_;}
00046
00047
00049
00050
00051 OsiSolverBranch();
00052
00054 OsiSolverBranch(const OsiSolverBranch & rhs);
00055
00057 OsiSolverBranch & operator=(const OsiSolverBranch & rhs);
00058
00060 ~OsiSolverBranch ();
00061
00063
00064 private:
00066
00067
00068 int start_[5];
00070 int * indices_;
00072 double * bound_;
00074 };
00075
00076
00082 class OsiSolverResult {
00083
00084 public:
00086
00087
00088 void createResult(const OsiSolverInterface & solver,const double * lowerBefore,
00089 const double * upperBefore);
00090
00092 void restoreResult(OsiSolverInterface & solver) const;
00093
00095 inline const CoinWarmStartBasis & basis() const
00096 { return basis_;}
00097
00099 inline double objectiveValue() const
00100 { return objectiveValue_;}
00101
00103 inline const double * primalSolution() const
00104 { return primalSolution_;}
00105
00107 inline const double * dualSolution() const
00108 { return dualSolution_;}
00109
00111 inline const OsiSolverBranch & fixed() const
00112 { return fixed_;}
00114
00115
00117
00118
00119 OsiSolverResult();
00120
00122 OsiSolverResult(const OsiSolverInterface & solver,const double * lowerBefore,
00123 const double * upperBefore);
00124
00126 OsiSolverResult(const OsiSolverResult & rhs);
00127
00129 OsiSolverResult & operator=(const OsiSolverResult & rhs);
00130
00132 ~OsiSolverResult ();
00133
00135
00136 private:
00138
00139
00140 double objectiveValue_;
00142 CoinWarmStartBasis basis_;
00144 double * primalSolution_;
00146 double * dualSolution_;
00148 OsiSolverBranch fixed_;
00150 };
00151 #endif