dune-istl 2.12-git
Loading...
Searching...
No Matches
Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A > Class Template Reference

Builder that allows inserting indices into any index set in any order. More...

#include <dune/istl/experimental/sparseindexranges.hh>

Public Types

using allocator_type = A
 
using size_type = typename std::allocator_traits< allocator_type >::size_type
 Type of the size parameters.
 
using index_type = uint_fast64_t
 Type of the indices.
 

Public Member Functions

constexpr UnsequencedSparseIndexRangeBuilder (size_type size, size_type is_size, size_type avg_indices=0, allocator_type allocator=allocator_type())
 Construct an unsequenced builder for size index sets with index range [0, is_size).
 
constexpr ~UnsequencedSparseIndexRangeBuilder ()
 
constexpr UnsequencedSparseIndexRangeBuilder (const UnsequencedSparseIndexRangeBuilder &)=delete
 
constexpr UnsequencedSparseIndexRangeBuilder (UnsequencedSparseIndexRangeBuilder &&)=delete
 
constexpr UnsequencedSparseIndexRangeBuilder & operator= (const UnsequencedSparseIndexRangeBuilder &)=delete
 
constexpr UnsequencedSparseIndexRangeBuilder & operator= (UnsequencedSparseIndexRangeBuilder &&)=delete
 
constexpr void setSize (size_type i, size_type s)
 Set the reserved size of the i-th index set to s. Must be called before addIndex().
 
constexpr void incrementSize (size_type i, size_type increment=1)
 Increment the reserved size of the i-th index set by increment. Must be called before addIndex().
 
constexpr void addIndex (size_type i, index_type j)
 Insert index j into index set i. Duplicate insertions are silently ignored.
 

Friends

template<class OtherAlloc >
class CompressedSparseIndexRanges
 
template<class I , class OtherAlloc >
class SparseIndexRanges
 

Detailed Description

template<class A = std::allocator<void>>
class Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A >

Builder that allows inserting indices into any index set in any order.

Build sequence
  1. Optional. Call setSize(i, s) or incrementSize(i, delta) for every index set i.
  2. Call addIndex(i, j) for each (set i, index j) pair in any order. Duplicates are ignored.
  3. Construct a SparseIndexRanges or CompressedSparseIndexRanges using their constructors.

The builder is neither copyable nor movable. Its storage is transferred to the index ranges once built.

Member Typedef Documentation

◆ allocator_type

template<class A = std::allocator<void>>
using Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A >::allocator_type = A

◆ index_type

template<class A = std::allocator<void>>
using Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A >::index_type = uint_fast64_t

Type of the indices.

◆ size_type

template<class A = std::allocator<void>>
using Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A >::size_type = typename std::allocator_traits<allocator_type>::size_type

Type of the size parameters.

Constructor & Destructor Documentation

◆ UnsequencedSparseIndexRangeBuilder() [1/3]

template<class A >
constexpr Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A >::UnsequencedSparseIndexRangeBuilder ( size_type  size,
size_type  is_size,
size_type  avg_indices = 0,
allocator_type  allocator = allocator_type() 
)
constexpr

Construct an unsequenced builder for size index sets with index range [0, is_size).

Parameters
avg_indicesExpected average number of indices per set, used to initialize reserved sizes for index sets. This is a performance hint.

◆ ~UnsequencedSparseIndexRangeBuilder()

◆ UnsequencedSparseIndexRangeBuilder() [2/3]

template<class A = std::allocator<void>>
constexpr Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A >::UnsequencedSparseIndexRangeBuilder ( const UnsequencedSparseIndexRangeBuilder< A > &  )
constexprdelete

◆ UnsequencedSparseIndexRangeBuilder() [3/3]

template<class A = std::allocator<void>>
constexpr Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A >::UnsequencedSparseIndexRangeBuilder ( UnsequencedSparseIndexRangeBuilder< A > &&  )
constexprdelete

Member Function Documentation

◆ addIndex()

template<class A >
constexpr void Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A >::addIndex ( size_type  i,
index_type  j 
)
constexpr

Insert index j into index set i. Duplicate insertions are silently ignored.

◆ incrementSize()

template<class A >
constexpr void Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A >::incrementSize ( size_type  i,
size_type  increment = 1 
)
constexpr

Increment the reserved size of the i-th index set by increment. Must be called before addIndex().

◆ operator=() [1/2]

template<class A = std::allocator<void>>
constexpr UnsequencedSparseIndexRangeBuilder & Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A >::operator= ( const UnsequencedSparseIndexRangeBuilder< A > &  )
constexprdelete

◆ operator=() [2/2]

template<class A = std::allocator<void>>
constexpr UnsequencedSparseIndexRangeBuilder & Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A >::operator= ( UnsequencedSparseIndexRangeBuilder< A > &&  )
constexprdelete

◆ setSize()

template<class A >
constexpr void Dune::Experimental::UnsequencedSparseIndexRangeBuilder< A >::setSize ( size_type  i,
size_type  s 
)
constexpr

Set the reserved size of the i-th index set to s. Must be called before addIndex().

Friends And Related Symbol Documentation

◆ CompressedSparseIndexRanges

template<class A = std::allocator<void>>
template<class OtherAlloc >
friend class CompressedSparseIndexRanges
friend

◆ SparseIndexRanges

template<class A = std::allocator<void>>
template<class I , class OtherAlloc >
friend class SparseIndexRanges
friend

The documentation for this class was generated from the following file: