|
PPL
0.12.1
|
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 = Dense_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. | |
| Flags (Dense_Row::Flags flags) | |
| Constructor from a Dense_Row::Flags object. | |
Static Private Attributes | |
The bits that are currently in use | |
| static const unsigned | rpi_validity_bit = Dense_Row::Flags::first_free_bit + 0 |
| static const unsigned | rpi_bit = Dense_Row::Flags::first_free_bit + 1 |
| static const unsigned | nnc_validity_bit = Dense_Row::Flags::first_free_bit + 2 |
| static const unsigned | nnc_bit = Dense_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.
Default constructor: builds an object where all flags are invalid.
Definition at line 34 of file Linear_Row.inlines.hh.
: Dense_Row::Flags() { // Note that the constructed type has its validity bit unset. }
|
inlineexplicit |
Builds an object corresponding to the topology t.
Definition at line 45 of file Linear_Row.inlines.hh.
References nnc_validity_bit, and Parma_Polyhedra_Library::Row_Flags::set_bits().
: Dense_Row::Flags(static_cast<unsigned>(t) << nnc_bit) { #ifndef NDEBUG set_bits(1U << nnc_validity_bit); #endif }
|
inline |
Builds an object corresponding to the topology t and kind k.
Definition at line 53 of file Linear_Row.inlines.hh.
References nnc_validity_bit, rpi_validity_bit, and Parma_Polyhedra_Library::Row_Flags::set_bits().
: Dense_Row::Flags((static_cast<unsigned>(k) << rpi_bit) | (static_cast<unsigned>(t) << nnc_bit)) { #ifndef NDEBUG set_bits((1U << rpi_validity_bit) | (1U << nnc_validity_bit)); #endif }
|
explicitprivate |
Builds the type from a bit-mask.
|
inlineexplicitprivate |
Constructor from a Dense_Row::Flags object.
Definition at line 40 of file Linear_Row.inlines.hh.
: Dense_Row::Flags(flags) { }
| 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.
| 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.
{
bool is_rpi = test_bits(1U << Flags::rpi_bit);
bool is_nnc = test_bits(1U << Flags::nnc_bit);
bool rpi_valid;
bool nnc_valid;
#ifdef NDEBUG
// Dump unhandled bits always as true so to permit loading from a
// debug enabled executable without failing assertions.
rpi_valid = true;
nnc_valid = true;
#else
rpi_valid = test_bits(1U << Flags::rpi_validity_bit);
nnc_valid = test_bits(1U << Flags::nnc_validity_bit);
#endif
s << (rpi_valid ? '+' : '-') << rpi_valid_text << ' '
<< (is_rpi ? '+' : '-') << is_rpi_text << ' '
<< ' '
<< (nnc_valid ? '+' : '-') << nnc_valid_text << ' '
<< (is_nnc ? '+' : '-') << is_nnc_text;
}
| 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 179 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().
Referenced by Parma_Polyhedra_Library::Linear_Row::ascii_load().
{
std::string str;
// Assume that the bits are used in sequence.
reset_bits(std::numeric_limits<base_type>::max());
for (unsigned int bit = 0;
bit < (sizeof(bit_texts) / sizeof(char*));
++bit) {
if (!(s >> str))
return false;
if (str[0] == '+') {
bool load = true;
#ifdef NDEBUG
// Do not load unhandled bits.
if (bit == rpi_validity_bit || bit == nnc_validity_bit)
load = false;
#endif
if (load)
set_bits(1U << (Dense_Row::Flags::first_free_bit + bit));
}
else if (str[0] != '-')
return false;
if (str.compare(1, strlen(bit_texts[bit]), bit_texts[bit]) != 0)
return false;
}
return true;
}
|
inline |
Definition at line 78 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::Linear_Row::is_ray_or_point_or_inequality(), and PPL_ASSERT.
Referenced by Parma_Polyhedra_Library::Linear_Row::is_line_or_equality().
{
PPL_ASSERT(test_bits(1U << rpi_validity_bit)
&& ("rpi bit tested before being initialized" != 0));
return !is_ray_or_point_or_inequality();
}
|
inline |
Definition at line 100 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::Linear_Row::is_not_necessarily_closed(), and PPL_ASSERT.
Referenced by Parma_Polyhedra_Library::Linear_Row::is_necessarily_closed().
{
PPL_ASSERT(test_bits(1U << nnc_validity_bit)
&& ("nnc bit tested before being initialized" != 0));
return !is_not_necessarily_closed();
}
|
inline |
Definition at line 93 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::NOT_NECESSARILY_CLOSED, and PPL_ASSERT.
{
PPL_ASSERT(test_bits(1U << nnc_validity_bit)
&& ("nnc bit tested before being initialized" != 0));
return test_bits(static_cast<unsigned>(NOT_NECESSARILY_CLOSED) << nnc_bit);
}
|
inline |
Definition at line 62 of file Linear_Row.inlines.hh.
References PPL_ASSERT, and Parma_Polyhedra_Library::Linear_Row::RAY_OR_POINT_OR_INEQUALITY.
Referenced by Parma_Polyhedra_Library::Linear_Row::is_ray_or_point_or_inequality().
{
PPL_ASSERT(test_bits(1U << rpi_validity_bit)
&& ("rpi bit tested before being initialized" != 0));
return
test_bits(static_cast<unsigned>(RAY_OR_POINT_OR_INEQUALITY) << rpi_bit);
}
|
inline |
Returns true if and only if *this and y are different.
Definition at line 134 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::Linear_Row::operator==().
{
return !operator==(y);
}
|
inline |
Returns true if and only if *this and y are equal.
Definition at line 128 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::Row_Flags::get_bits(), and Parma_Polyhedra_Library::Interval_NS::get_bits().
{
base_type mask = low_bits_mask<base_type>(first_free_bit);
return (get_bits() & mask) == (y.get_bits() & mask);
}
| void Parma_Polyhedra_Library::Linear_Row::Flags::print | ( | ) | const |
Prints *this to std::cerr using operator<<.
Reimplemented from Parma_Polyhedra_Library::Row_Flags.
Definition at line 85 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::Linear_Row::RAY_OR_POINT_OR_INEQUALITY, Parma_Polyhedra_Library::Interval_NS::reset_bits(), and Parma_Polyhedra_Library::Interval_NS::set_bits().
Referenced by Parma_Polyhedra_Library::Linear_Row::set_is_line_or_equality().
{
#ifndef NDEBUG
set_bits(1U << rpi_validity_bit);
#endif
reset_bits(static_cast<unsigned>(RAY_OR_POINT_OR_INEQUALITY) << rpi_bit);
}
Definition at line 70 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::Linear_Row::RAY_OR_POINT_OR_INEQUALITY, and Parma_Polyhedra_Library::Interval_NS::set_bits().
Referenced by Parma_Polyhedra_Library::Linear_Row::set_is_ray_or_point_or_inequality().
{
#ifndef NDEBUG
set_bits(1U << rpi_validity_bit);
#endif
set_bits(static_cast<unsigned>(RAY_OR_POINT_OR_INEQUALITY) << rpi_bit);
}
Definition at line 115 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::NOT_NECESSARILY_CLOSED, Parma_Polyhedra_Library::Interval_NS::reset_bits(), and Parma_Polyhedra_Library::Interval_NS::set_bits().
Referenced by Parma_Polyhedra_Library::Linear_Row::set_necessarily_closed().
{
#ifndef NDEBUG
set_bits(1U << nnc_validity_bit);
#endif
reset_bits(static_cast<unsigned>(NOT_NECESSARILY_CLOSED) << nnc_bit);
}
Definition at line 107 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::NOT_NECESSARILY_CLOSED, and Parma_Polyhedra_Library::Interval_NS::set_bits().
Referenced by Parma_Polyhedra_Library::Linear_Row::set_not_necessarily_closed().
{
#ifndef NDEBUG
set_bits(1U << nnc_validity_bit);
#endif
set_bits(static_cast<unsigned>(NOT_NECESSARILY_CLOSED) << nnc_bit);
}
|
inline |
Definition at line 123 of file Linear_Row.inlines.hh.
References Parma_Polyhedra_Library::Linear_Row::is_necessarily_closed(), Parma_Polyhedra_Library::NECESSARILY_CLOSED, and Parma_Polyhedra_Library::NOT_NECESSARILY_CLOSED.
Referenced by Parma_Polyhedra_Library::Linear_Row::topology().
{
return is_necessarily_closed() ? NECESSARILY_CLOSED : NOT_NECESSARILY_CLOSED;
}
|
friend |
Definition at line 212 of file Linear_Row.defs.hh.
|
staticprotected |
Index of the first bit derived classes can use.
Reimplemented from Parma_Polyhedra_Library::Row_Flags.
Definition at line 210 of file Linear_Row.defs.hh.
|
staticprivate |
Definition at line 204 of file Linear_Row.defs.hh.
|
staticprivate |
Definition at line 202 of file Linear_Row.defs.hh.
Referenced by Flags().
|
staticprivate |
Definition at line 200 of file Linear_Row.defs.hh.
|
staticprivate |
Definition at line 198 of file Linear_Row.defs.hh.
Referenced by Flags().