The type of the object to which the coefficients refer to, encoding both topology and kind. More...
#include <Linear_Row.defs.hh>


Public Member Functions | |
| Flags () | |
| Default constructor: builds an object where all flags are invalid. | |
| Flags (Topology t) | |
Builds an object corresponding to the topology t. | |
| Flags (Topology t, Kind k) | |
Builds an object corresponding to the topology t and kind k. | |
| bool | operator== (const Flags &y) const |
Returns true if and only if *this and y are equal. | |
| bool | operator!= (const Flags &y) const |
Returns true if and only if *this and y are different. | |
| void | ascii_dump () const |
Writes to std::cerr an ASCII representation of *this. | |
| void | ascii_dump (std::ostream &s) const |
Writes to s an ASCII representation of *this. | |
| void | print () const |
Prints *this to std::cerr using operator<<. | |
| bool | ascii_load (std::istream &s) |
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this accordingly. Returns true if successful, false otherwise. | |
Testing and setting the type | |
| Topology | topology () const |
| bool | is_necessarily_closed () const |
| bool | is_not_necessarily_closed () const |
| bool | is_line_or_equality () const |
| bool | is_ray_or_point_or_inequality () const |
| void | set_necessarily_closed () |
| void | set_not_necessarily_closed () |
| void | set_is_line_or_equality () |
| void | set_is_ray_or_point_or_inequality () |
Static Protected Attributes | |
| static const unsigned | first_free_bit = Row::Flags::first_free_bit + 4 |
| Index of the first bit derived classes can use. | |
Private Member Functions | |
| Flags (base_type mask) | |
| Builds the type from a bit-mask. | |
Static Private Attributes | |
The bits that are currently in use | |
| static const unsigned | rpi_validity_bit = Row::Flags::first_free_bit + 0 |
| static const unsigned | rpi_bit = Row::Flags::first_free_bit + 1 |
| static const unsigned | nnc_validity_bit = Row::Flags::first_free_bit + 2 |
| static const unsigned | nnc_bit = Row::Flags::first_free_bit + 3 |
Friends | |
| class | Parma_Polyhedra_Library::Linear_Row |
The type of the object to which the coefficients refer to, encoding both topology and kind.
This combines the information about the topology (necessarily closed or not) and the kind (line/equality or ray/point/inequality) of a Linear_Row object.
Definition at line 144 of file Linear_Row.defs.hh.
| Parma_Polyhedra_Library::Linear_Row::Flags::Flags | ( | ) | [inline] |
Default constructor: builds an object where all flags are invalid.
Reimplemented from Parma_Polyhedra_Library::Row::Flags.
Definition at line 34 of file Linear_Row.inlines.hh.
00035 : Row::Flags() { 00036 // Note that the constructed type has its validity bit unset. 00037 }
| Parma_Polyhedra_Library::Linear_Row::Flags::Flags | ( | Topology | t | ) | [inline, explicit] |
Builds an object corresponding to the topology t.
Definition at line 40 of file Linear_Row.inlines.hh.
References nnc_validity_bit, and Parma_Polyhedra_Library::Row::Flags::set_bits().
00041 : Row::Flags(t << nnc_bit) { 00042 #ifndef NDEBUG 00043 set_bits(1 << nnc_validity_bit); 00044 #endif 00045 }
Builds an object corresponding to the topology t and kind k.
Definition at line 48 of file Linear_Row.inlines.hh.
References nnc_validity_bit, rpi_validity_bit, and Parma_Polyhedra_Library::Row::Flags::set_bits().
00049 : Row::Flags((k << rpi_bit) | (t << nnc_bit)) { 00050 #ifndef NDEBUG 00051 set_bits((1 << rpi_validity_bit) 00052 | (1 << nnc_validity_bit)); 00053 #endif 00054 }
| Parma_Polyhedra_Library::Linear_Row::Flags::Flags | ( | base_type | mask | ) | [explicit, private] |
Builds the type from a bit-mask.
Reimplemented from Parma_Polyhedra_Library::Row::Flags.
| void Parma_Polyhedra_Library::Linear_Row::Flags::ascii_dump | ( | std::ostream & | s | ) | const |
Writes to s an ASCII representation of *this.
Reimplemented from Parma_Polyhedra_Library::Row::Flags.
Definition at line 155 of file Linear_Row.cc.
References nnc_bit, nnc_validity_bit, rpi_bit, rpi_validity_bit, and Parma_Polyhedra_Library::Row::Flags::test_bits().
00155 { 00156 s << (test_bits(1 << Flags::rpi_validity_bit) ? '+' : '-') 00157 << rpi_valid << ' ' 00158 << (test_bits(1 << Flags::rpi_bit) ? '+' : '-') 00159 << is_rpi << ' ' 00160 << ' ' 00161 << (test_bits(1 << Flags::nnc_validity_bit) ? '+' : '-') 00162 << nnc_valid << ' ' 00163 << (test_bits(1 << Flags::nnc_bit) ? '+' : '-') 00164 << is_nnc; 00165 }
| void Parma_Polyhedra_Library::Linear_Row::Flags::ascii_dump | ( | ) | const |
Writes to std::cerr an ASCII representation of *this.
Reimplemented from Parma_Polyhedra_Library::Row::Flags.
Referenced by Parma_Polyhedra_Library::Linear_Row::ascii_dump().
| bool Parma_Polyhedra_Library::Linear_Row::Flags::ascii_load | ( | std::istream & | s | ) |
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this accordingly. Returns true if successful, false otherwise.
Reimplemented from Parma_Polyhedra_Library::Row::Flags.
Definition at line 170 of file Linear_Row.cc.
References Parma_Polyhedra_Library::Row::Flags::first_free_bit, Parma_Polyhedra_Library::Interval_NS::reset_bits(), and Parma_Polyhedra_Library::Interval_NS::set_bits().
00170 { 00171 std::string str; 00172 // Assume that the bits are used in sequence. 00173 reset_bits(std::numeric_limits<base_type>::max()); 00174 for (unsigned int bit = 0; 00175 bit < (sizeof(bit_names) / sizeof(char*)); 00176 ++bit) { 00177 if (!(s >> str)) 00178 return false; 00179 if (str[0] == '+') 00180 set_bits(1 << (Row::Flags::first_free_bit + bit)); 00181 else if (str[0] != '-') 00182 return false; 00183 if (str.compare(1, strlen(bit_names[bit]), bit_names[bit]) != 0) 00184 return false; 00185 } 00186 return true; 00187 }
| bool Parma_Polyhedra_Library::Linear_Row::Flags::is_line_or_equality | ( | ) | const [inline] |
Definition at line 71 of file Linear_Row.inlines.hh.
References is_ray_or_point_or_inequality(), rpi_validity_bit, and Parma_Polyhedra_Library::Row::Flags::test_bits().
Referenced by Parma_Polyhedra_Library::Linear_Row::is_line_or_equality().
00071 { 00072 PPL_ASSERT(test_bits(1 << rpi_validity_bit)); 00073 return !is_ray_or_point_or_inequality(); 00074 }
| bool Parma_Polyhedra_Library::Linear_Row::Flags::is_necessarily_closed | ( | ) | const [inline] |
Definition at line 91 of file Linear_Row.inlines.hh.
References is_not_necessarily_closed(), nnc_validity_bit, and Parma_Polyhedra_Library::Row::Flags::test_bits().
Referenced by Parma_Polyhedra_Library::Linear_Row::is_necessarily_closed(), and topology().
00091 { 00092 PPL_ASSERT(test_bits(1 << nnc_validity_bit)); 00093 return !is_not_necessarily_closed(); 00094 }
| bool Parma_Polyhedra_Library::Linear_Row::Flags::is_not_necessarily_closed | ( | ) | const [inline] |
Definition at line 85 of file Linear_Row.inlines.hh.
References nnc_bit, nnc_validity_bit, Parma_Polyhedra_Library::NOT_NECESSARILY_CLOSED, and Parma_Polyhedra_Library::Row::Flags::test_bits().
Referenced by is_necessarily_closed().
00085 { 00086 PPL_ASSERT(test_bits(1 << nnc_validity_bit)); 00087 return test_bits(NOT_NECESSARILY_CLOSED << nnc_bit); 00088 }
| bool Parma_Polyhedra_Library::Linear_Row::Flags::is_ray_or_point_or_inequality | ( | ) | const [inline] |
Definition at line 57 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::Linear_Row::RAY_OR_POINT_OR_INEQUALITY, rpi_bit, rpi_validity_bit, and Parma_Polyhedra_Library::Row::Flags::test_bits().
Referenced by is_line_or_equality(), and Parma_Polyhedra_Library::Linear_Row::is_ray_or_point_or_inequality().
00057 { 00058 PPL_ASSERT(test_bits(1 << rpi_validity_bit)); 00059 return test_bits(RAY_OR_POINT_OR_INEQUALITY << rpi_bit); 00060 }
| bool Parma_Polyhedra_Library::Linear_Row::Flags::operator!= | ( | const Flags & | y | ) | const [inline] |
Returns true if and only if *this and y are different.
Reimplemented from Parma_Polyhedra_Library::Row::Flags.
Definition at line 124 of file Linear_Row.inlines.hh.
References operator==().
00124 { 00125 return !operator==(y); 00126 }
| bool Parma_Polyhedra_Library::Linear_Row::Flags::operator== | ( | const Flags & | y | ) | const [inline] |
Returns true if and only if *this and y are equal.
Reimplemented from Parma_Polyhedra_Library::Row::Flags.
Definition at line 118 of file Linear_Row.inlines.hh.
References first_free_bit, and Parma_Polyhedra_Library::Row::Flags::get_bits().
Referenced by operator!=().
00118 { 00119 base_type mask = low_bits_mask<base_type>(first_free_bit); 00120 return (get_bits() & mask) == (y.get_bits() & mask); 00121 }
| void Parma_Polyhedra_Library::Linear_Row::Flags::print | ( | ) | const |
Prints *this to std::cerr using operator<<.
Reimplemented from Parma_Polyhedra_Library::Row::Flags.
| void Parma_Polyhedra_Library::Linear_Row::Flags::set_is_line_or_equality | ( | ) | [inline] |
Definition at line 77 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::Linear_Row::RAY_OR_POINT_OR_INEQUALITY, Parma_Polyhedra_Library::Row::Flags::reset_bits(), rpi_bit, rpi_validity_bit, and Parma_Polyhedra_Library::Row::Flags::set_bits().
Referenced by Parma_Polyhedra_Library::Linear_Row::set_is_line_or_equality().
00077 { 00078 #ifndef NDEBUG 00079 set_bits(1 << rpi_validity_bit); 00080 #endif 00081 reset_bits(RAY_OR_POINT_OR_INEQUALITY << rpi_bit); 00082 }
| void Parma_Polyhedra_Library::Linear_Row::Flags::set_is_ray_or_point_or_inequality | ( | ) | [inline] |
Definition at line 63 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::Linear_Row::RAY_OR_POINT_OR_INEQUALITY, rpi_bit, rpi_validity_bit, and Parma_Polyhedra_Library::Row::Flags::set_bits().
Referenced by Parma_Polyhedra_Library::Linear_Row::set_is_ray_or_point_or_inequality().
00063 { 00064 #ifndef NDEBUG 00065 set_bits(1 << rpi_validity_bit); 00066 #endif 00067 set_bits(RAY_OR_POINT_OR_INEQUALITY << rpi_bit); 00068 }
| void Parma_Polyhedra_Library::Linear_Row::Flags::set_necessarily_closed | ( | ) | [inline] |
Definition at line 105 of file Linear_Row.inlines.hh.
References nnc_bit, nnc_validity_bit, Parma_Polyhedra_Library::NOT_NECESSARILY_CLOSED, Parma_Polyhedra_Library::Row::Flags::reset_bits(), and Parma_Polyhedra_Library::Row::Flags::set_bits().
Referenced by Parma_Polyhedra_Library::Linear_Row::set_necessarily_closed().
00105 { 00106 #ifndef NDEBUG 00107 set_bits(1 << nnc_validity_bit); 00108 #endif 00109 reset_bits(NOT_NECESSARILY_CLOSED << nnc_bit); 00110 }
| void Parma_Polyhedra_Library::Linear_Row::Flags::set_not_necessarily_closed | ( | ) | [inline] |
Definition at line 97 of file Linear_Row.inlines.hh.
References nnc_bit, nnc_validity_bit, Parma_Polyhedra_Library::NOT_NECESSARILY_CLOSED, and Parma_Polyhedra_Library::Row::Flags::set_bits().
Referenced by Parma_Polyhedra_Library::Linear_Row::set_not_necessarily_closed().
00097 { 00098 #ifndef NDEBUG 00099 set_bits(1 << nnc_validity_bit); 00100 #endif 00101 set_bits(NOT_NECESSARILY_CLOSED << nnc_bit); 00102 }
| Topology Parma_Polyhedra_Library::Linear_Row::Flags::topology | ( | ) | const [inline] |
Definition at line 113 of file Linear_Row.inlines.hh.
References is_necessarily_closed(), Parma_Polyhedra_Library::NECESSARILY_CLOSED, and Parma_Polyhedra_Library::NOT_NECESSARILY_CLOSED.
Referenced by Parma_Polyhedra_Library::Linear_Row::topology().
00113 { 00114 return is_necessarily_closed() ? NECESSARILY_CLOSED : NOT_NECESSARILY_CLOSED; 00115 }
friend class Parma_Polyhedra_Library::Linear_Row [friend] |
Definition at line 209 of file Linear_Row.defs.hh.
const unsigned Parma_Polyhedra_Library::Linear_Row::Flags::first_free_bit = Row::Flags::first_free_bit + 4 [static, protected] |
Index of the first bit derived classes can use.
Reimplemented from Parma_Polyhedra_Library::Row::Flags.
Definition at line 207 of file Linear_Row.defs.hh.
Referenced by operator==().
const unsigned Parma_Polyhedra_Library::Linear_Row::Flags::nnc_bit = Row::Flags::first_free_bit + 3 [static, private] |
Definition at line 201 of file Linear_Row.defs.hh.
Referenced by ascii_dump(), is_not_necessarily_closed(), set_necessarily_closed(), and set_not_necessarily_closed().
const unsigned Parma_Polyhedra_Library::Linear_Row::Flags::nnc_validity_bit = Row::Flags::first_free_bit + 2 [static, private] |
Definition at line 199 of file Linear_Row.defs.hh.
Referenced by ascii_dump(), Flags(), is_necessarily_closed(), is_not_necessarily_closed(), set_necessarily_closed(), and set_not_necessarily_closed().
const unsigned Parma_Polyhedra_Library::Linear_Row::Flags::rpi_bit = Row::Flags::first_free_bit + 1 [static, private] |
Definition at line 197 of file Linear_Row.defs.hh.
Referenced by ascii_dump(), is_ray_or_point_or_inequality(), set_is_line_or_equality(), and set_is_ray_or_point_or_inequality().
const unsigned Parma_Polyhedra_Library::Linear_Row::Flags::rpi_validity_bit = Row::Flags::first_free_bit + 0 [static, private] |
Definition at line 195 of file Linear_Row.defs.hh.
Referenced by ascii_dump(), Flags(), is_line_or_equality(), is_ray_or_point_or_inequality(), set_is_line_or_equality(), and set_is_ray_or_point_or_inequality().
1.6.3