4 #ifndef DUNE_SELECTION_HH
5 #define DUNE_SELECTION_HH
26 template<
typename TS,
typename TG,
typename TL,
int N>
54 : iter_(iter), end_(end)
57 while(iter_!=end_ && !AttributeSet::contains(iter_->local().attribute()))
64 for(++iter_; iter_!=end_; ++iter_)
65 if(AttributeSet::contains(iter_->local().attribute()))
72 return iter_->local().local();
77 return iter_ == other.iter_;
82 return iter_ != other.iter_;
94 template<
typename TS,
typename TG,
typename TL,
int N>
141 : indexSet_(&indexset)
175 template<
typename TS,
typename TG,
typename TL,
int N>
222 : selected_(), size_(0), built_(false)
265 template<
typename TS,
typename TG,
typename TL,
int N>
273 const const_iterator end = indexset.
end();
276 for(const_iterator index = indexset.
begin(); index != end; ++index)
277 if(AttributeSet::contains(index->local().attribute()))
280 selected_ =
new uint32_t[entries];
284 for(const_iterator index = indexset.
begin(); index != end; ++index)
285 if(AttributeSet::contains(index->local().attribute()))
286 selected_[entries++]= index->local().local();
292 template<
typename TS,
typename TG,
typename TL,
int N>
298 template<
typename TS,
typename TG,
typename TL,
int N>
301 return selected_+
size_;
304 template<
typename TS,
typename TG,
typename TL,
int N>
312 template<
typename TS,
typename TG,
typename TL,
int N>
319 template<
typename TS,
typename TG,
typename TL,
int N>
326 template<
typename TS,
typename TG,
typename TL,
int N>
332 template<
typename TS,
typename TG,
typename TL,
int N>
335 indexSet_ = &indexset;
TS AttributeSet
The type of the set of attributes.
Definition: selection.hh:187
SelectionIterator< TS, TG, TL, N > iterator
The type of the iterator of the selected indices.
Definition: selection.hh:129
const_iterator end() const
Get an iterator over the selected indices.
Definition: selection.hh:299
bool operator!=(const SelectionIterator< TS, TG, TL, N > &other) const
Definition: selection.hh:80
bool operator==(const SelectionIterator< TS, TG, TL, N > &other) const
Definition: selection.hh:75
const_iterator end() const
Get an iterator over the selected indices.
Definition: selection.hh:327
uint32_t operator*() const
Definition: selection.hh:70
Selection()
Definition: selection.hh:217
TG GlobalIndex
The type of the global index of the underlying index set.
Definition: selection.hh:192
iterator begin()
Get an iterator over the indices positioned at the first index.
A cached selection of indices.
Definition: selection.hh:176
void setIndexSet(const ParallelIndexSet &indexset)
Set the index set of the selection.
Definition: selection.hh:266
TL LocalIndex
The type of the local index of the underlying index set.
Definition: selection.hh:119
This file implements iterator facade classes for writing stl conformant iterators.
TS AttributeSet
The type of the Set of attributes.
Definition: selection.hh:106
ConstArrayListIterator< IndexPair< TG, TL >, N, std::allocator< Dune::IndexPair< TG, TL > > > ParallelIndexSetIterator
Definition: selection.hh:47
const_iterator begin() const
Get the index set we are a selection for.
Definition: selection.hh:320
SelectionIterator(const ParallelIndexSetIterator &iter, const ParallelIndexSetIterator &end)
Constructor.
Definition: selection.hh:53
iterator end()
Get an iterator over the indices positioned after the last index.
TG GlobalIndex
The type of the global index of the underlying index set.
Definition: selection.hh:111
Provides a map between global and local indices.
An uncached selection of indices.
Definition: selection.hh:95
~Selection()
Definition: selection.hh:313
Manager class for the mapping between local indices and globally unique indices.
Definition: indexset.hh:217
uint32_t * const_iterator
The type of the iterator of the selected indices.
Definition: selection.hh:215
TS AttributeSet
The type of the Set of attributes.
Definition: selection.hh:38
void setIndexSet(const ParallelIndexSet &indexset)
Set the index set of the selection.
Definition: selection.hh:333
Selection(const ParallelIndexSet &indexset)
Definition: selection.hh:221
A constant random access iterator for the Dune::ArrayList class.
Definition: arraylist.hh:21
uint32_t * iterator
The type of the iterator of the selected indices.
Definition: selection.hh:210
std::size_t size_
The size of the buffer.
Definition: variablesizecommunicator.hh:132
Dune::ParallelIndexSet< TG, TL, N > ParallelIndexSet
The type of the underlying index set.
Definition: selection.hh:43
void operator++()
Definition: selection.hh:61
Dune::ParallelIndexSet< GlobalIndex, LocalIndex, N > ParallelIndexSet
The type of the underlying index set.
Definition: selection.hh:124
iterator const_iterator
The type of the iterator of the selected indices.
Definition: selection.hh:134
const_iterator begin() const
Get the index set we are a selection for.
Definition: selection.hh:293
UncachedSelection()
Definition: selection.hh:136
Dune::ParallelIndexSet< GlobalIndex, LocalIndex, N > ParallelIndexSet
The type of the underlying index set.
Definition: selection.hh:205
A const iterator over an uncached selection.
Definition: selection.hh:27
void free()
Free allocated memory.
Definition: selection.hh:305
UncachedSelection(const ParallelIndexSet &indexset)
Definition: selection.hh:140
TL LocalIndex
The type of the local index of the underlying index set.
Definition: selection.hh:200