24 #ifndef PPL_Dense_Row_inlines_hh
25 #define PPL_Dense_Row_inlines_hh 1
27 #include "assertions.hh"
36 : size(0), capacity(0), coeff_allocator(), vec(0) {
43 vec[
size].~Coefficient();
45 coeff_allocator.deallocate(vec,
capacity);
50 return std::numeric_limits<size_t>::max() /
sizeof(
Coefficient);
77 PPL_ASSERT(
size() == sz);
88 PPL_ASSERT(
size() == sz);
137 PPL_ASSERT(sz <= capacity);
139 PPL_ASSERT(capacity != 0);
155 PPL_ASSERT(
size() == sz);
185 if (
this != &y &&
size() == y.
size()) {
204 PPL_ASSERT(k <
size());
208 inline Coefficient_traits::const_reference
211 PPL_ASSERT(k <
size());
257 inline Coefficient_traits::const_reference
306 Coefficient_traits::const_reference x) {
318 Coefficient_traits::const_reference x) {
349 : row(NULL), idx(0) {
361 PPL_ASSERT(idx < row->
size());
365 inline Coefficient_traits::const_reference
367 PPL_ASSERT(idx < row->
size());
378 PPL_ASSERT(idx < row->
size());
408 return (row == x.
row) && (idx == x.
idx);
413 return !(*
this == x);
427 return (idx <= row->
size());
433 : row(NULL), idx(0) {
444 inline Coefficient_traits::const_reference
446 PPL_ASSERT(idx < row->
size());
457 PPL_ASSERT(idx < row->
size());
487 return (row == x.
row) && (idx == x.
idx);
492 return !(*
this == x);
501 return (idx <= row->
size());
506 Coefficient_traits::const_reference coeff1,
507 Coefficient_traits::const_reference coeff2) {
513 Coefficient_traits::const_reference c1,
514 Coefficient_traits::const_reference c2,
528 std::vector<Dense_Row>::iterator y) {
534 #endif // !defined(PPL_Dense_Row_inlines_hh)
void swap(CO_Tree &x, CO_Tree &y)
void swap(Dense_Row &x, Dense_Row &y)
Swaps x with y.
bool operator!=(const iterator &x) const
A finite sequence of coefficients.
memory_size_type external_memory_in_bytes() const
Returns a lower bound to the size in bytes of the memory managed by *this.
Dense_Row & operator=(const Dense_Row &y)
Assignment operator.
size_t dimension_type
An unsigned integral type for representing space dimensions.
std::allocator< Coefficient > coeff_allocator
The allocator used to allocate/deallocate vec.
void linear_combine(const Dense_Row &y, Coefficient_traits::const_reference coeff1, Coefficient_traits::const_reference coeff2)
Dense_Row()
Constructs an empty row.
void swap_coefficients(dimension_type i, dimension_type j)
memory_size_type total_memory_in_bytes() const
Returns a lower bound to the total size in bytes of the memory occupied by *this. ...
const_iterator & operator++()
void reset(dimension_type i)
Coefficient_traits::const_reference operator*() const
dimension_type size() const
Gives the number of coefficients currently in use.
dimension_type size
The number of coefficients in the row.
bool operator!=(const Dense_Row &x, const Dense_Row &y)
Coefficient & operator[](dimension_type k)
Returns a reference to the element of the row indexed by k.
static dimension_type max_size()
Returns the size() of the largest possible Dense_Row.
dimension_type index() const
Returns the index of the element pointed to by *this.
bool operator==(const const_iterator &x) const
void m_swap(Dense_Row &y)
Swaps *this with y.
dimension_type index() const
Returns the index of the element pointed to by *this.
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
iterator find(dimension_type i)
Provided for compatibility with Sparse_Row.
bool operator==(const iterator &x) const
bool OK() const
Checks if all the invariants are satisfied.
void iter_swap(std::vector< Dense_Row >::iterator x, std::vector< Dense_Row >::iterator y)
The entire library is confined to this namespace.
iterator lower_bound(dimension_type i)
Provided for compatibility with Sparse_Row.
const_iterator & operator--()
void resize(dimension_type sz)
Resizes the row to sz.
dimension_type capacity
The capacity of the row.
iterator insert(dimension_type i, Coefficient_traits::const_reference x)
Provided for compatibility with Sparse_Row.
dimension_type capacity() const
Returns the capacity of the row.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
Coefficient & operator*()
Coefficient_traits::const_reference get(dimension_type i) const
bool operator!=(const const_iterator &x) const