00001 00038 #ifndef ABA_LPVARSTAT_H 00039 #define ABA_LPVARSTAT_H 00040 #include <iostream> 00041 using namespace std; 00042 00043 #include "abacus/abacusroot.h" 00044 00045 class ABA_GLOBAL; 00046 00047 #ifdef ABACUS_PARALLEL 00048 class ABA_MESSAGE; 00049 #endif 00050 00051 class ABA_LPVARSTAT : public ABA_ABACUSROOT { 00052 public: 00053 00073 enum STATUS {AtLowerBound, Basic, AtUpperBound, NonBasicFree, 00074 Eliminated, Unknown}; 00075 00076 00081 ABA_LPVARSTAT(ABA_GLOBAL *glob); 00082 00088 ABA_LPVARSTAT(ABA_GLOBAL *glob, STATUS status); 00089 00095 ABA_LPVARSTAT(ABA_LPVARSTAT *lpVarStat); 00096 #ifdef ABACUS_PARALLEL 00097 00103 ABA_LPVARSTAT(const ABA_GLOBAL *glob, ABA_MESSAGE &msg); 00104 00109 void pack(ABA_MESSAGE &msg) const; 00110 #endif 00111 00122 friend ostream &operator<<(ostream& out, const ABA_LPVARSTAT &rhs); 00123 00126 STATUS status() const; 00127 00133 void status(STATUS stat); 00134 00140 void status(const ABA_LPVARSTAT *stat); 00141 00145 bool atBound() const; 00146 00150 bool basic() const; 00151 00152 private: 00153 00156 ABA_GLOBAL *glob_; 00157 00160 STATUS status_; 00161 }; 00162 00163 00164 inline ABA_LPVARSTAT::ABA_LPVARSTAT(ABA_GLOBAL *glob) 00165 : 00166 glob_(glob), 00167 status_(Unknown) 00168 { } 00169 00170 inline ABA_LPVARSTAT::ABA_LPVARSTAT(ABA_GLOBAL *glob, STATUS status) 00171 : 00172 glob_(glob), 00173 status_(status) 00174 { } 00175 00176 inline ABA_LPVARSTAT::ABA_LPVARSTAT(ABA_LPVARSTAT *lpVarStat) 00177 : 00178 glob_(lpVarStat->glob_), 00179 status_(lpVarStat->status_) 00180 { } 00181 00182 inline ABA_LPVARSTAT::STATUS ABA_LPVARSTAT::status() const 00183 { 00184 return status_; 00185 } 00186 00187 inline void ABA_LPVARSTAT::status(STATUS stat) 00188 { 00189 status_ = stat; 00190 } 00191 00192 inline void ABA_LPVARSTAT::status(const ABA_LPVARSTAT *stat) 00193 { 00194 status_ = stat->status_; 00195 } 00196 00197 inline bool ABA_LPVARSTAT::atBound() const 00198 { 00199 if (status_ == AtLowerBound || status_ == AtUpperBound) return true; 00200 else return false; 00201 } 00202 00203 inline bool ABA_LPVARSTAT::basic() const 00204 { 00205 return status_ == Basic ? true : false; 00206 } 00207 00208 00209 #endif // ABA_LPVARSTAT_H 00210