PPL
1.2
|
The base class for the single rows of matrices. More...
#include <DB_Row_defs.hh>
Public Types | |
typedef Implementation::Ptr_Iterator< T * > | iterator |
A (non const) random access iterator to access the row's elements. More... | |
typedef Implementation::Ptr_Iterator< const T * > | const_iterator |
A const random access iterator to access the row's elements. More... | |
Public Member Functions | |
DB_Row () | |
Pre-constructs a row: construction must be completed by construct(). More... | |
DB_Row (dimension_type sz) | |
Tight constructor: resizing will require reallocation. More... | |
DB_Row (dimension_type sz, dimension_type capacity) | |
Sizing constructor with capacity. More... | |
DB_Row (const DB_Row &y) | |
Ordinary copy constructor. More... | |
DB_Row (const DB_Row &y, dimension_type capacity) | |
Copy constructor with specified capacity. More... | |
DB_Row (const DB_Row &y, dimension_type sz, dimension_type capacity) | |
Copy constructor with specified size and capacity. More... | |
~DB_Row () | |
Destructor. More... | |
DB_Row & | operator= (const DB_Row &y) |
Assignment operator. More... | |
void | m_swap (DB_Row &y) |
Swaps *this with y . More... | |
void | assign (DB_Row &y) |
Assigns the implementation of y to *this . More... | |
void | allocate (dimension_type capacity) |
Allocates memory for a default constructed DB_Row object, allowing for capacity coefficients at most. More... | |
void | expand_within_capacity (dimension_type new_size) |
Expands the row to size new_size . More... | |
void | shrink (dimension_type new_size) |
Shrinks the row by erasing elements at the end. More... | |
dimension_type | size () const |
Gives the number of coefficients currently in use. More... | |
iterator | begin () |
Returns the const iterator pointing to the first element, if *this is not empty; otherwise, returns the past-the-end const iterator. More... | |
iterator | end () |
Returns the past-the-end iterator. More... | |
const_iterator | begin () const |
Returns the const iterator pointing to the first element, if *this is not empty; otherwise, returns the past-the-end const iterator. More... | |
const_iterator | end () const |
Returns the past-the-end const iterator. More... | |
memory_size_type | total_memory_in_bytes () const |
Returns a lower bound to the total size in bytes of the memory occupied by *this . More... | |
memory_size_type | external_memory_in_bytes () const |
Returns a lower bound to the size in bytes of the memory managed by *this . More... | |
memory_size_type | total_memory_in_bytes (dimension_type capacity) const |
Returns the total size in bytes of the memory occupied by *this , provided the capacity of *this is given by capacity . More... | |
memory_size_type | external_memory_in_bytes (dimension_type capacity) const |
Returns the size in bytes of the memory managed by *this , provided the capacity of *this is given by capacity . More... | |
bool | OK (dimension_type row_size, dimension_type row_capacity) const |
Checks if all the invariants are satisfied. More... | |
Post-constructors. | |
void | construct (dimension_type sz) |
Constructs properly a default-constructed element. More... | |
void | construct (dimension_type sz, dimension_type capacity) |
Constructs properly a default-constructed element. More... | |
template<typename U > | |
void | construct_upward_approximation (const DB_Row< U > &y, dimension_type capacity) |
Constructs properly a conservative approximation of y . More... | |
Subscript operators. | |
T & | operator[] (dimension_type k) |
Returns a reference to the element of the row indexed by k . More... | |
const T & | operator[] (dimension_type k) const |
Returns a constant reference to the element of the row indexed by k . More... | |
Static Public Member Functions | |
static dimension_type | max_size () |
Returns the size() of the largest possible DB_Row. More... | |
Private Member Functions | |
void | copy_construct_coefficients (const DB_Row &y) |
Exception-safe copy construction mechanism for coefficients. More... | |
![]() | |
DB_Row_Impl_Handler () | |
Default constructor. More... | |
~DB_Row_Impl_Handler () | |
Destructor. More... | |
Friends | |
template<typename U > | |
class | Parma_Polyhedra_Library::DB_Row |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T > | |
void | swap (DB_Row< T > &x, DB_Row< T > &y) |
Swaps x with y . More... | |
template<typename T > | |
void | iter_swap (typename std::vector< DB_Row< T > >::iterator x, typename std::vector< DB_Row< T > >::iterator y) |
Swaps objects referred by x and y . More... | |
template<typename T > | |
bool | operator!= (const DB_Row< T > &x, const DB_Row< T > &y) |
template<typename T > | |
void | swap (DB_Row< T > &x, DB_Row< T > &y) |
template<typename T > | |
void | iter_swap (typename std::vector< DB_Row< T > >::iterator x, typename std::vector< DB_Row< T > >::iterator y) |
template<typename T > | |
bool | operator== (const DB_Row< T > &x, const DB_Row< T > &y) |
Classical comparison operators. | |
template<typename T > | |
bool | operator== (const DB_Row< T > &x, const DB_Row< T > &y) |
template<typename T > | |
bool | operator!= (const DB_Row< T > &x, const DB_Row< T > &y) |
Additional Inherited Members | |
![]() | |
Impl * | impl |
A pointer to the actual implementation. More... | |
The base class for the single rows of matrices.
The class template DB_Row<T> allows for the efficient representation of the single rows of a DB_Matrix. It contains elements of type T stored as a vector. The class T is a family of extended numbers that must provide representation for ,
,
(and, consequently for nan, not a number, since this arises as the ``result'' of undefined sums like
).
The class T must provide the following methods:
is the default constructor: no assumption is made on the particular object constructed, provided T().OK()
gives true
(see below).
is the destructor.
returns true
if and only *this
represents the not a number value.
returns true
if and only if *this
satisfies all its invariants.
Definition at line 120 of file DB_Row_defs.hh.
typedef Implementation::Ptr_Iterator<const T*> Parma_Polyhedra_Library::DB_Row< T >::const_iterator |
A const random access iterator to access the row's elements.
Definition at line 247 of file DB_Row_defs.hh.
typedef Implementation::Ptr_Iterator<T*> Parma_Polyhedra_Library::DB_Row< T >::iterator |
A (non const) random access iterator to access the row's elements.
Definition at line 244 of file DB_Row_defs.hh.
|
inline |
Pre-constructs a row: construction must be completed by construct().
Definition at line 168 of file DB_Row_inlines.hh.
|
inline |
Tight constructor: resizing will require reallocation.
Definition at line 253 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::construct().
|
inline |
Sizing constructor with capacity.
Definition at line 245 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row< T >::construct().
|
inline |
Ordinary copy constructor.
Definition at line 259 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row< T >::allocate(), Parma_Polyhedra_Library::compute_capacity(), Parma_Polyhedra_Library::DB_Row< T >::copy_construct_coefficients(), Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, Parma_Polyhedra_Library::DB_Row< T >::max_size(), and Parma_Polyhedra_Library::DB_Row< T >::size().
|
inline |
Copy constructor with specified capacity.
It is assumed that capacity
is greater than or equal to y
size.
Definition at line 269 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row< T >::allocate(), Parma_Polyhedra_Library::DB_Row< T >::copy_construct_coefficients(), Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, Parma_Polyhedra_Library::DB_Row< T >::max_size(), and Parma_Polyhedra_Library::DB_Row< T >::size().
|
inline |
Copy constructor with specified size and capacity.
It is assumed that sz
is greater than or equal to the size of y
and, of course, that sz
is less than or equal to capacity
. Any new position is initialized to .
Definition at line 280 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row< T >::allocate(), Parma_Polyhedra_Library::DB_Row< T >::copy_construct_coefficients(), Parma_Polyhedra_Library::DB_Row< T >::expand_within_capacity(), Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, Parma_Polyhedra_Library::DB_Row< T >::max_size(), and Parma_Polyhedra_Library::DB_Row< T >::size().
|
inline |
|
inline |
Allocates memory for a default constructed DB_Row object, allowing for capacity
coefficients at most.
It is assumed that no allocation has been performed before (otherwise, a memory leak will occur). After execution, the size of the DB_Row object is zero.
Definition at line 174 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.
Referenced by Parma_Polyhedra_Library::DB_Row< T >::DB_Row().
|
inline |
Assigns the implementation of y
to *this
.
Definition at line 317 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.
|
inline |
Returns the const iterator pointing to the first element, if *this
is not empty; otherwise, returns the past-the-end const iterator.
Definition at line 349 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.
|
inline |
Returns the const iterator pointing to the first element, if *this
is not empty; otherwise, returns the past-the-end const iterator.
Definition at line 363 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.
|
inline |
Constructs properly a default-constructed element.
Builds a row with size sz
and minimum capacity.
Definition at line 239 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::construct().
Referenced by Parma_Polyhedra_Library::DB_Row< T >::DB_Row().
|
inline |
Constructs properly a default-constructed element.
sz | The size of the row that will be constructed. |
capacity | The minimum capacity of the row that will be constructed. |
The row that we are constructing has a minimum capacity of (i.e., it can contain at least) elements
, sz
of which will be constructed now.
Definition at line 230 of file DB_Row_inlines.hh.
|
inline |
Constructs properly a conservative approximation of y
.
y | A row containing the elements whose upward approximations will be used to properly construct *this . |
capacity | The capacity of the constructed row. |
It is assumed that capacity
is greater than or equal to the size of y
.
Definition at line 219 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, and Parma_Polyhedra_Library::DB_Row< T >::size().
|
inlineprivate |
Exception-safe copy construction mechanism for coefficients.
Definition at line 207 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, and Parma_Polyhedra_Library::DB_Row< T >::size().
Referenced by Parma_Polyhedra_Library::DB_Row< T >::DB_Row().
|
inline |
Returns the past-the-end iterator.
Definition at line 356 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.
|
inline |
Returns the past-the-end const iterator.
Definition at line 370 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.
|
inline |
Expands the row to size new_size
.
Adds new positions to the implementation of the row obtaining a new row with size new_size
. It is assumed that new_size
is between the current size and capacity of the row. The new positions are initialized to .
Definition at line 196 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.
Referenced by Parma_Polyhedra_Library::DB_Row< T >::DB_Row().
|
inline |
Returns a lower bound to the size in bytes of the memory managed by *this
.
Definition at line 390 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.
|
inline |
Returns the size in bytes of the memory managed by *this
, provided the capacity of *this
is given by capacity
.
Definition at line 377 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.
|
inline |
Swaps *this
with y
.
Definition at line 306 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, and Parma_Polyhedra_Library::swap().
Referenced by Parma_Polyhedra_Library::DB_Row< T >::swap().
|
inlinestatic |
Returns the size() of the largest possible DB_Row.
Definition at line 148 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::max_size().
Referenced by Parma_Polyhedra_Library::DB_Row< T >::DB_Row(), Parma_Polyhedra_Library::DB_Matrix< T >::max_num_columns(), and Parma_Polyhedra_Library::OR_Matrix< T >::operator=().
bool Parma_Polyhedra_Library::DB_Row< T >::OK | ( | dimension_type | row_size, |
dimension_type | row_capacity | ||
) | const |
Checks if all the invariants are satisfied.
Definition at line 129 of file DB_Row_templates.hh.
References Parma_Polyhedra_Library::is_not_a_number(), and Parma_Polyhedra_Library::DB_Row< T >::size().
|
inline |
Assignment operator.
Definition at line 327 of file DB_Row_inlines.hh.
|
inline |
Returns a reference to the element of the row indexed by k
.
Definition at line 335 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.
|
inline |
Returns a constant reference to the element of the row indexed by k
.
Definition at line 342 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.
|
inline |
Shrinks the row by erasing elements at the end.
Destroys elements of the row implementation from position new_size
to the end. It is assumed that new_size
is not greater than the current size.
Definition at line 298 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl.
|
inline |
Gives the number of coefficients currently in use.
Definition at line 154 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::impl, and Parma_Polyhedra_Library::DB_Row_Impl_Handler< T >::Impl::size().
Referenced by Parma_Polyhedra_Library::DB_Row< T >::construct_upward_approximation(), Parma_Polyhedra_Library::DB_Row< T >::copy_construct_coefficients(), Parma_Polyhedra_Library::DB_Row< T >::DB_Row(), Parma_Polyhedra_Library::DB_Row< T >::OK(), and Parma_Polyhedra_Library::DB_Row< T >::operator==().
|
inline |
Returns a lower bound to the total size in bytes of the memory occupied by *this
.
Definition at line 401 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::external_memory_in_bytes().
|
inline |
Returns the total size in bytes of the memory occupied by *this
, provided the capacity of *this
is given by capacity
.
Definition at line 384 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::external_memory_in_bytes().
|
related |
Swaps objects referred by x
and y
.
|
related |
Definition at line 408 of file DB_Row_inlines.hh.
Definition at line 207 of file DB_Row_templates.hh.
References Parma_Polyhedra_Library::DB_Row< T >::size().
Definition at line 297 of file DB_Row_defs.hh.
Definition at line 415 of file DB_Row_inlines.hh.
References Parma_Polyhedra_Library::DB_Row< T >::m_swap().