24 #ifndef PPL_OR_Matrix_defs_hh
25 #define PPL_OR_Matrix_defs_hh 1
34 #ifndef PPL_OR_MATRIX_EXTRA_DEBUG
35 #ifdef PPL_ABI_BREAKING_EXTRA_DEBUG
36 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
43 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
44 #define PPL_OR_MATRIX_EXTRA_DEBUG 1
45 #else // !defined(PPL_ABI_BREAKING_EXTRA_DEBUG)
46 #define PPL_OR_MATRIX_EXTRA_DEBUG 0
47 #endif // !defined(PPL_ABI_BREAKING_EXTRA_DEBUG)
48 #endif // !defined(PPL_OR_MATRIX_EXTRA_DEBUG)
52 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
55 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
57 bool operator==(
const OR_Matrix<T>& x,
const OR_Matrix<T>& y);
59 namespace IO_Operators {
61 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
64 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
67 operator<<(std::ostream& s, const OR_Matrix<T>& m);
74 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
102 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
104 template <
typename T>
111 template <
typename U>
119 template <
typename V>
134 #if !defined(__GNUC__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 0)
141 #if PPL_OR_MATRIX_EXTRA_DEBUG
146 #else // !PPL_OR_MATRIX_EXTRA_DEBUG
151 #endif // !PPL_OR_MATRIX_EXTRA_DEBUG
156 #if !defined(__GNUC__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 0)
162 #if PPL_OR_MATRIX_EXTRA_DEBUG
170 #endif // PPL_OR_MATRIX_EXTRA_DEBUG
176 template <
typename V>
template<
typename W>
178 template <typename V> template<typename W>
200 template <typename U>
222 template <
typename V>
229 template <
typename V>
236 pointer operator->()
const;
251 reference
operator[](difference_type m)
const;
257 template <
typename Un
signed>
259 operator+=(Unsigned m);
271 template <
typename Un
signed>
323 template <
typename V>
template<
typename W>
355 OR_Matrix(dimension_type num_dimensions);
361 template <typename U>
362 explicit
OR_Matrix(const OR_Matrix<U>& y);
368 OR_Matrix& operator=(const OR_Matrix& y);
403 void
m_swap(OR_Matrix& y);
417 void
grow(dimension_type new_dim);
427 void
shrink(dimension_type new_dim);
517 friend
bool operator==<T>(const OR_Matrix<T>& x, const OR_Matrix<T>& y);
525 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
528 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
529 template <
typename T>
532 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
535 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
536 template <
typename T>
539 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
551 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
552 template <
typename Temp,
typename To,
typename T>
561 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
573 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
574 template <
typename Temp,
typename To,
typename T>
583 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
595 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
596 template <
typename Temp,
typename To,
typename T>
610 #endif // !defined(PPL_OR_Matrix_defs_hh)
void swap(OR_Matrix< T > &x, OR_Matrix< T > &y)
Swaps x with y.
friend bool operator==(const OR_Matrix< T > &x, const OR_Matrix< T > &y)
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
Enable_If< Is_Singleton< T >::value, Interval< B, Info > >::type operator*(const Interval< B, Info > &x, const T &y)
bool operator!=(const OR_Matrix< T > &x, const OR_Matrix< T > &y)
Returns true if and only if x and y are different.
dimension_type num_rows() const
Returns the number of rows in the matrix.
bool operator>(const Ptr_Iterator< P > &x, const Ptr_Iterator< Q > &y)
row_iterator row_end()
Returns the past-the-end const_iterator.
void shrink(dimension_type new_dim)
Makes the matrix shrink by removing the last space dimensions.
std::random_access_iterator_tag iterator_category
size_t dimension_type
An unsigned integral type for representing space dimensions.
Pseudo_Row< const Parma_Polyhedra_Library::Checked_Number > const_row_reference_type
A const reference to a matrix's row.
Pseudo_Row()
Default constructor: creates an invalid object that has to be assigned.
any_row_iterator< Parma_Polyhedra_Library::Checked_Number > row_iterator
A (non const) row iterator.
const Pseudo_Row< U > & reference
Rounding_Dir
Rounding directions for arithmetic computations.
DB_Row< Parma_Polyhedra_Library::Checked_Number >::const_iterator const_element_iterator
A const element iterator.
bool operator>=(const Ptr_Iterator< P > &x, const Ptr_Iterator< Q > &y)
A template class to derive both OR_Matrix::iterator and OR_Matrix::const_iterator.
memory_size_type total_memory_in_bytes() const
Returns the total size in bytes of the memory occupied by *this.
U & operator[](dimension_type k) const
Subscript operator.
dimension_type space_dimension() const
Returns the space-dimension of the matrix.
bool euclidean_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const OR_Matrix< T > &x, const OR_Matrix< T > &y, Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2)
Computes the euclidean distance between x and y.
void resize_no_copy(dimension_type new_dim)
Resizes the matrix without worrying about the old contents.
bool OK() const
Checks if all the invariants are satisfied.
void m_swap(OR_Matrix &y)
Swaps *this with y.
An object that behaves like a matrix's row with respect to the subscript operators.
dimension_type i
Internal index: i = (e+1)*(e+1)/2.
U * first
Holds a reference to the beginning of this row.
The base class for the single rows of matrices.
A wrapper for numeric types implementing a given policy.
#define PPL_OUTPUT_DECLARATIONS
bool ascii_load(std::istream &s)
Loads from s an ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets *this ...
element_iterator element_begin()
Returns an iterator pointing to the first element, if *this is not empty; otherwise, returns the past-the-end const_iterator.
bool l_infinity_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const OR_Matrix< T > &x, const OR_Matrix< T > &y, Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2)
Computes the distance between x and y.
static dimension_type row_first_element_index(dimension_type k)
Returns the index into vec of the first element of the row of index k.
Pseudo_Row & operator=(const Pseudo_Row &y)
Assignment operator.
dimension_type e
External index.
const Pseudo_Row< U > * pointer
any_row_iterator< const Parma_Polyhedra_Library::Checked_Number > const_row_iterator
A const row iterator.
bool operator<(const Ptr_Iterator< P > &x, const Ptr_Iterator< Q > &y)
static dimension_type row_size(dimension_type k)
Returns the size of the row of index k.
friend class any_row_iterator
Pseudo_Row< U > value_type
void grow(dimension_type new_dim)
Makes the matrix grow by adding more space dimensions.
Pseudo_Row< U > value
Represents the beginning of a row.
DB_Row< T > vec
Contains the rows of the matrix.
dimension_type space_dim
Contains the dimension of the space of the matrix.
The entire library is confined to this namespace.
Enable_If< Is_Singleton< T >::value, Interval< B, Info > >::type operator+(const Interval< B, Info > &x, const T &y)
static dimension_type max_num_rows()
Returns the maximum number of rows of a OR_Matrix.
dimension_type vec_capacity
Contains the capacity of vec.
bool rectilinear_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const OR_Matrix< T > &x, const OR_Matrix< T > &y, Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2)
Computes the rectilinear (or Manhattan) distance between x and y.
bool operator<=(const Ptr_Iterator< P > &x, const Ptr_Iterator< Q > &y)
DB_Row< Parma_Polyhedra_Library::Checked_Number >::iterator element_iterator
A (non const) element iterator.
Pseudo_Row< Parma_Polyhedra_Library::Checked_Number > row_reference_type
A (non const) reference to a matrix's row.
A matrix representing octagonal constraints.
bool operator==(const Box< ITV > &x, const Box< ITV > &y)
Enable_If< Is_Singleton< T >::value, Interval< B, Info > >::type operator-(const Interval< B, Info > &x, const T &y)
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
void clear()
Clears the matrix deallocating all its rows.
A class that provides a type member called type equivalent to T if and only if b is true...
row_iterator row_begin()
Returns an iterator pointing to the first row, if *this is not empty; otherwise, returns the past-the...
element_iterator element_end()
Returns the past-the-end const_iterator.