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

Builder that fills index sets one at a time, in sequential order. More...

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

Classes

struct  EndSentinel
 
class  IndexRangeBuilder
 Handle for inserting indices into the current index set of a SequencedSparseIndexRangeBuilder. More...
 

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 SequencedSparseIndexRangeBuilder (size_type size, size_type is_size, size_type avg_indices=2048, allocator_type allocator=allocator_type())
 
constexpr ~SequencedSparseIndexRangeBuilder ()
 
constexpr SequencedSparseIndexRangeBuilder (const SequencedSparseIndexRangeBuilder &)=delete
 
constexpr SequencedSparseIndexRangeBuilder (SequencedSparseIndexRangeBuilder &&)=delete
 
constexpr SequencedSparseIndexRangeBuilder & operator= (const SequencedSparseIndexRangeBuilder &)=delete
 
constexpr SequencedSparseIndexRangeBuilder & operator= (SequencedSparseIndexRangeBuilder &&)=delete
 
constexpr IndexRangeBuilder begin ()
 Returns an IndexRangeBuilder positioned at the first index set.
 
constexpr EndSentinel end ()
 Returns the end sentinel used to detect when all index sets have been filled.
 

Friends

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

Detailed Description

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

Builder that fills index sets one at a time, in sequential order.

Use this builder when index sets are filled in order from first to last (e.g., processing rows of a sparse matrix from top to bottom).

Build sequence
Obtain an IndexRangeBuilder from begin() and advance it with operator++() after finishing each index set. A range-based for loop is the most convenient pattern:
for (auto& isb : sb) {
isb.insert(j1);
isb.insert(j2);
}
SparseIndexRanges sis(std::move(sb));
Compact storage of multiple sorted sparse index sets sharing a single allocation.
Definition sparseindexranges.hh:489
Builder that fills index sets one at a time, in sequential order.
Definition sparseindexranges.hh:329
Duplicate insertions within a set are silently ignored. After all sets are filled, 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::SequencedSparseIndexRangeBuilder< A >::allocator_type = A

◆ index_type

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

Type of the indices.

◆ size_type

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

Type of the size parameters.

Constructor & Destructor Documentation

◆ SequencedSparseIndexRangeBuilder() [1/3]

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

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

Parameters
avg_indicesExpected average number of indices per set; used to pre-allocate storage.

◆ ~SequencedSparseIndexRangeBuilder()

◆ SequencedSparseIndexRangeBuilder() [2/3]

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

◆ SequencedSparseIndexRangeBuilder() [3/3]

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

Member Function Documentation

◆ begin()

template<class A >
constexpr auto Dune::Experimental::SequencedSparseIndexRangeBuilder< A >::begin ( )
constexpr

Returns an IndexRangeBuilder positioned at the first index set.

◆ end()

template<class A >
constexpr auto Dune::Experimental::SequencedSparseIndexRangeBuilder< A >::end ( )
constexpr

Returns the end sentinel used to detect when all index sets have been filled.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

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: