24 #ifndef PPL_Sparse_Row_defs_hh
25 #define PPL_Sparse_Row_defs_hh 1
33 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
57 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
243 const iterator&
end();
246 const_iterator
begin()
const;
249 const const_iterator&
end()
const;
255 const_iterator
cbegin()
const;
266 const const_iterator&
cend()
const;
489 Coefficient_traits::const_reference x);
574 iterator
reset(iterator i);
592 iterator
reset(iterator first, iterator last);
655 template <
typename Func1,
typename Func2>
657 const Func1& f,
const Func2& g);
683 template <
typename Func1,
typename Func2>
685 const Func1& g,
const Func2& h);
715 template <
typename Func1,
typename Func2,
typename Func3>
717 const Func1& f,
const Func2& g,
const Func3& h);
745 Coefficient_traits::const_reference coeff1,
746 Coefficient_traits::const_reference coeff2);
755 Coefficient_traits::const_reference c1,
756 Coefficient_traits::const_reference c2,
828 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
831 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
841 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
844 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
847 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
850 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
859 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
863 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
865 Coefficient_traits::const_reference coeff1,
866 Coefficient_traits::const_reference coeff2);
868 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
875 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
877 Coefficient_traits::const_reference c1,
878 Coefficient_traits::const_reference c2,
881 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
885 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
887 Coefficient_traits::const_reference coeff1,
888 Coefficient_traits::const_reference coeff2);
890 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
897 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
899 Coefficient_traits::const_reference c1,
900 Coefficient_traits::const_reference c2,
903 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
907 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
909 Coefficient_traits::const_reference coeff1,
910 Coefficient_traits::const_reference coeff2);
912 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
919 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
921 Coefficient_traits::const_reference c1,
922 Coefficient_traits::const_reference c2,
930 #endif // !defined(PPL_Sparse_Row_defs_hh)
void normalize()
Normalizes the modulo of coefficients so that they are mutually prime.
iterator find(dimension_type i)
Looks for an element with index i.
void combine_needs_first(const Sparse_Row &y, const Func1 &f, const Func2 &g)
Calls g(x[i],y[i]), for each i.
void delete_element_and_shift(dimension_type i)
Deletes the i-th element from the row, shifting the next elements to the left.
bool operator!=(const Box< ITV > &x, const Box< ITV > &y)
void reset_after(dimension_type i)
Resets to zero the elements with index greater than or equal to i.
void swap(CO_Tree &x, CO_Tree &y)
void linear_combine(const Sparse_Row &y, Coefficient_traits::const_reference coeff1, Coefficient_traits::const_reference coeff2)
A finite sequence of coefficients.
size_t dimension_type
An unsigned integral type for representing space dimensions.
void combine_needs_second(const Sparse_Row &y, const Func1 &g, const Func2 &h)
Calls g(x[i],y[i]), for each i.
dimension_type size() const
Returns the size of the row.
void linear_combine(Dense_Row &x, const Dense_Row &y, Coefficient_traits::const_reference coeff1, Coefficient_traits::const_reference coeff2)
void m_swap(Sparse_Row &x)
Swaps *this and x.
void resize(dimension_type n)
Resizes the row to the specified size.
bool ascii_load(std::istream &s)
Loads the row from an ASCII representation generated using ascii_dump().
iterator reset(iterator i)
Resets to zero the value pointed to by i.
CO_Tree::iterator iterator
An iterator on the row elements.
A finite sparse sequence of coefficients.
An iterator on the tree elements, ordered by key.
Sparse_Row(dimension_type n=0)
Constructs a row with the specified size.
const iterator & end()
Returns an iterator that points after the last stored element.
#define PPL_OUTPUT_DECLARATIONS
void expand_within_capacity(dimension_type n)
Resizes the row to size n.
Coefficient & operator[](dimension_type i)
Gets a reference to the i-th element.
void clear()
Resets all the elements of this row.
A cache-oblivious binary search tree of pairs.
void shrink(dimension_type n)
Resizes the row to size n.
void fast_swap(dimension_type i, iterator itr)
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
memory_size_type total_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
CO_Tree tree
The tree used to store the elements.
iterator insert(dimension_type i, Coefficient_traits::const_reference x)
Equivalent to (*this)[i] = x; find(i), but faster.
The entire library is confined to this namespace.
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
A const iterator on the tree elements, ordered by key.
iterator lower_bound(dimension_type i)
Lower bound of index i.
void swap_coefficients(dimension_type i, dimension_type j)
Swaps the i-th element with the j-th element.
dimension_type size_
The size of the row.
dimension_type num_stored_elements() const
Returns the number of elements explicitly stored in the row.
iterator begin()
Returns an iterator that points at the first stored element.
const const_iterator & cend() const
Returns an iterator that points after the last element.
bool operator==(const Box< ITV > &x, const Box< ITV > &y)
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
void add_zeroes_and_shift(dimension_type n, dimension_type i)
Adds n zeroes before index i.
static dimension_type max_size()
Returns the size() of the largest possible Sparse_Row.
void combine(const Sparse_Row &y, const Func1 &f, const Func2 &g, const Func3 &h)
Calls g(x[i],y[i]), for each i.
Sparse_Row & operator=(const Dense_Row &row)
CO_Tree::const_iterator const_iterator
A const iterator on the row elements.
const_iterator cbegin() const
Returns an iterator that points at the first element.
bool OK() const
Checks the invariant.