00001
00002
00003 #ifndef OsiCut_H
00004 #define OsiCut_H
00005
00006 #include "OsiCollections.hpp"
00007 #include "OsiSolverInterface.hpp"
00008
00017 #if 0
00018 /
00019 /
00020 #endif
00021
00022
00023 class OsiCut {
00024
00025 public:
00026
00027
00030
00031 inline void setEffectiveness( double e );
00033 inline double effectiveness() const;
00035
00038
00039 inline void setGloballyValid( bool trueFalse )
00040 { globallyValid_=trueFalse;};
00041 inline void setGloballyValid( )
00042 { globallyValid_=true;};
00043 inline void setNotGloballyValid( )
00044 { globallyValid_=false;};
00046 inline bool globallyValid() const
00047 { return globallyValid_;};
00049
00052
00053 virtual void print() const {};
00055
00056 #if 0
00057 / **@name Times used */
00058 / /@{
00059 /
00060 inline void setTimesUsed( int t );
00061 /
00062 inline void incrementTimesUsed();
00063 /
00064 inline int timesUsed() const;
00065 / /@}
00066
00067 / **@name Times tested */
00068 / /@{
00069 /
00070 inline void setTimesTested( int t );
00071 /
00072 inline void incrementTimesTested();
00073 /
00074 inline int timesTested() const;
00075 / /@}
00076 #endif
00077
00078
00079
00082
00083 inline virtual bool operator==(const OsiCut& rhs) const;
00085 inline virtual bool operator!=(const OsiCut& rhs) const;
00087 inline virtual bool operator< (const OsiCut& rhs) const;
00089 inline virtual bool operator> (const OsiCut& rhs) const;
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00113 inline virtual bool consistent() const=0;
00114
00120 inline virtual bool consistent(const OsiSolverInterface& si) const=0;
00121
00143 inline virtual bool infeasible(const OsiSolverInterface &si) const=0;
00144
00149 virtual double violated(const double * solution) const=0;
00151
00152 protected:
00153
00156
00157 OsiCut ();
00158
00160 OsiCut ( const OsiCut &);
00161
00163 OsiCut & operator=( const OsiCut& rhs);
00164
00166 virtual ~OsiCut ();
00168
00169 private:
00170
00173
00174 double effectiveness_;
00176 bool globallyValid_;
00177 #if 0
00178
00179 int timesUsed_;
00181 int timesTested_;
00182 #endif
00183
00184 };
00185
00186
00187
00188
00189
00190 void OsiCut::setEffectiveness(double e) { effectiveness_=e; }
00191 double OsiCut::effectiveness() const { return effectiveness_; }
00192
00193 #if 0
00194 void OsiCut::setTimesUsed( int t ) { timesUsed_=t; }
00195 void OsiCut::incrementTimesUsed() { timesUsed_++; }
00196 int OsiCut::timesUsed() const { return timesUsed_; }
00197
00198 void OsiCut::setTimesTested( int t ) { timesTested_=t; }
00199 void OsiCut::incrementTimesTested() { timesTested_++; }
00200 int OsiCut::timesTested() const{ return timesTested_; }
00201 #endif
00202
00203
00204
00205
00206 bool
00207 OsiCut::operator==(const OsiCut& rhs) const
00208 {
00209 return effectiveness()==rhs.effectiveness();
00210 }
00211 bool
00212 OsiCut::operator!=(const OsiCut& rhs) const
00213 {
00214 return !( (*this)==rhs );
00215 }
00216 bool
00217 OsiCut::operator< (const OsiCut& rhs) const
00218 {
00219 return effectiveness()<rhs.effectiveness();
00220 }
00221 bool
00222 OsiCut::operator> (const OsiCut& rhs) const
00223 {
00224 return effectiveness()>rhs.effectiveness();
00225 }
00226 #endif