24 #ifndef PPL_BDS_Status_inlines_hh
25 #define PPL_BDS_Status_inlines_hh 1
38 : flags(ZERO_DIM_UNIV) {
44 return (flags & mask) == mask;
50 return (flags & mask) != 0;
68 return flags == ZERO_DIM_UNIV;
75 if (flags == ZERO_DIM_UNIV) {
85 flags = ZERO_DIM_UNIV;
91 return test_any(
EMPTY);
100 template <
typename T>
106 template <
typename T>
109 return test_any(SHORTEST_PATH_CLOSED);
112 template <
typename T>
116 reset(SHORTEST_PATH_CLOSED | SHORTEST_PATH_REDUCED);
119 template <
typename T>
122 set(SHORTEST_PATH_CLOSED);
125 template <
typename T>
128 return test_any(SHORTEST_PATH_REDUCED);
131 template <
typename T>
134 reset(SHORTEST_PATH_REDUCED);
137 template <
typename T>
140 PPL_ASSERT(test_shortest_path_closed());
141 set(SHORTEST_PATH_REDUCED);
144 template <
typename T>
147 if (test_zero_dim_univ()) {
160 std::cerr <<
"The empty flag is incompatible with any other one."
168 if (test_shortest_path_reduced()) {
169 if (test_shortest_path_closed()) {
174 std::cerr <<
"The shortest-path reduction flag should also imply "
175 <<
"the closure flag."
187 namespace Implementation {
189 namespace BD_Shapes {
193 extern const char*
empty;
208 get_field(std::istream& s,
const char* keyword,
bool& positive) {
211 || (str[0] != yes && str[0] != no)
212 || str.substr(1) != keyword) {
215 positive = (str[0] ==
yes);
223 template <
typename T>
226 using namespace Implementation::BD_Shapes;
236 template <typename T>
239 using namespace Implementation::BD_Shapes;
249 if (!get_field(s,
empty, positive)) {
256 if (!get_field(s,
sp_closed, positive)) {
283 #endif // !defined(PPL_BDS_Status_inlines_hh)
void set(flags_t mask)
Set the bits in mask.
The empty element, i.e., the empty set.
void reset(flags_t mask)
Reset the bits in mask.
void reset_zero_dim_univ()
const char * zero_dim_univ
void set_shortest_path_reduced()
A conjunctive assertion about a BD_Shape object.
The standard C++ namespace.
void set_zero_dim_univ()
Turns *this into an zero-dimensional universe BDS.
void ascii_dump() const
Writes to std::cerr an ASCII representation of *this.
bool test_shortest_path_reduced() const
bool get_field(std::istream &s, const char *keyword, bool &positive)
#define PPL_OUTPUT_TEMPLATE_DEFINITIONS_ASCII_ONLY(type_symbol, class_prefix)
void reset_shortest_path_closed()
Marks *this as possibly not shortest-path closed.
unsigned int flags_t
Status is implemented by means of a finite bitset.
void set_shortest_path_closed()
bool OK() const
Checks if all the invariants are satisfied.
bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
bool test_any(flags_t mask) const
Check whether at least one bit in mask is set.
bool OK() const
Returns true if and only if *this satisfies all its invariants.
void set_shortest_path_closed()
Marks *this as shortest-path closed.
bool test_zero_dim_univ() const
The entire library is confined to this namespace.
void reset_shortest_path_reduced()
A bounded difference shape.
Status()
By default Status is the zero-dim universe assertion.
void reset_shortest_path_reduced()
Marks *this as possibly not shortest-path reduced.
void set_empty()
Turns *this into an empty BDS.
#define PPL_UNINITIALIZED(type, name)
void reset_shortest_path_closed()
bool test_shortest_path_closed() const
bool test_all(flags_t mask) const
Check whether all bits in mask are set.
void set_shortest_path_reduced()
Marks *this as shortest-path closed.