dune-pdelab 2.10-git
Loading...
Searching...
No Matches
Dune::PDELab::MultiIndex< T, n > Class Template Reference

A class for representing multi-indices. More...

#include <dune/pdelab/common/multiindex.hh>

Inheritance diagram for Dune::PDELab::MultiIndex< T, n >:
Inheritance graph

Classes

class  View
 

Public Types

typedef storage_type::value_type value_type
 
typedef storage_type::value_type value_type
 
typedef storage_type::pointer pointer
 
typedef storage_type::pointer pointer
 
typedef storage_type::const_pointer const_pointer
 
typedef storage_type::const_pointer const_pointer
 
typedef storage_type::reference reference
 
typedef storage_type::reference reference
 
typedef storage_type::const_reference const_reference
 
typedef storage_type::const_reference const_reference
 
typedef storage_type::size_type size_type
 
typedef storage_type::size_type size_type
 
typedef storage_type::difference_type difference_type
 
typedef storage_type::difference_type difference_type
 
typedef storage_type::iterator iterator
 
typedef storage_type::iterator iterator
 
typedef storage_type::const_iterator const_iterator
 
typedef storage_type::const_iterator const_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

 MultiIndex ()
 
 MultiIndex (const View &view)
 
 MultiIndex (const ReservedVector< T, n > &rv)
 Copy constructor from ReservedVector.
 
template<std::size_t _n>
requires (n != _n)
 MultiIndex (const MultiIndex< T, _n > &rv)
 Copy constructor from a multi-index of different size.
 
template<class... U>
 MultiIndex (const TypeTree::HybridTreePath< U... > &tp)
 Copy constructor from a hybrid multi-index.
 
void set (typename ReservedVector< T, n >::value_type index)
 
void push_front (const value_type &t)
 Appends an element to the beginning of a vector, up to the maximum size n, O(n) time.
 
void pop_front ()
 Erases the last element of the vector, O(1) time.
 
View view () const
 
View view (std::size_t size) const
 
bool operator== (const MultiIndex &r) const
 Tests whether two MultiIndices are equal.
 
bool operator!= (const MultiIndex &r) const
 Tests whether two MultiIndices are not equal.
 
constexpr bool operator== (const ReservedVector &that) const noexcept
 
constexpr auto operator<=> (const ReservedVector &that) const noexcept
 
constexpr auto operator<=> (const ReservedVector &that) const noexcept
 
constexpr void clear () noexcept
 
constexpr void clear () noexcept
 
constexpr void resize (size_type s) noexcept
 
constexpr void resize (size_type s) noexcept
 
constexpr iterator insert (const_iterator pos, const T &value)
 
constexpr iterator insert (const_iterator pos, T &&value)
 
constexpr iterator insert (const_iterator pos, size_type count, const T &value)
 
constexpr iterator insert (const_iterator pos, InputIt first, InputIt last)
 
constexpr iterator insert (const_iterator pos, std::initializer_list< T > ilist)
 
constexpr iterator insert (const_iterator pos, const T &value)
 
constexpr iterator insert (const_iterator pos, T &&value)
 
constexpr iterator insert (const_iterator pos, size_type count, const T &value)
 
constexpr iterator insert (const_iterator pos, InputIt first, InputIt last)
 
constexpr iterator insert (const_iterator pos, std::initializer_list< T > ilist)
 
constexpr void push_back (const value_type &t) noexcept(std::is_nothrow_copy_assignable_v< value_type >)
 
constexpr void push_back (value_type &&t) noexcept(std::is_nothrow_move_assignable_v< value_type >)
 
reference emplace_back (Args &&... args) noexcept(std::is_nothrow_constructible_v< value_type, decltype(args)... >)
 
reference emplace_back (Args &&... args) noexcept(std::is_nothrow_constructible_v< value_type, decltype(args)... >)
 
constexpr void pop_back () noexcept
 
constexpr iterator begin () noexcept
 
constexpr const_iterator begin () const noexcept
 
constexpr iterator begin () noexcept
 
constexpr const_iterator begin () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr reverse_iterator rbegin () noexcept
 
constexpr const_reverse_iterator rbegin () const noexcept
 
constexpr reverse_iterator rbegin () noexcept
 
constexpr const_reverse_iterator rbegin () const noexcept
 
constexpr const_reverse_iterator crbegin () const noexcept
 
constexpr const_reverse_iterator crbegin () const noexcept
 
constexpr iterator end () noexcept
 
constexpr const_iterator end () const noexcept
 
constexpr iterator end () noexcept
 
constexpr const_iterator end () const noexcept
 
constexpr const_iterator cend () const noexcept
 
constexpr const_iterator cend () const noexcept
 
constexpr reverse_iterator rend () noexcept
 
constexpr const_reverse_iterator rend () const noexcept
 
constexpr reverse_iterator rend () noexcept
 
constexpr const_reverse_iterator rend () const noexcept
 
constexpr const_reverse_iterator crend () const noexcept
 
constexpr const_reverse_iterator crend () const noexcept
 
constexpr reference at (size_type i)
 
constexpr const_reference at (size_type i) const
 
constexpr reference at (size_type i)
 
constexpr const_reference at (size_type i) const
 
constexpr reference operator[] (size_type i) noexcept
 
constexpr const_reference operator[] (size_type i) const noexcept
 
constexpr reference operator[] (size_type i) noexcept
 
constexpr const_reference operator[] (size_type i) const noexcept
 
constexpr reference front () noexcept
 
constexpr const_reference front () const noexcept
 
constexpr reference back () noexcept
 
constexpr const_reference back () const noexcept
 
constexpr pointer data () noexcept
 
constexpr const_pointer data () const noexcept
 
constexpr pointer data () noexcept
 
constexpr const_pointer data () const noexcept
 
constexpr void fill (const value_type &value) noexcept(std::is_nothrow_copy_assignable_v< value_type >)
 
constexpr void fill (const value_type &value) noexcept(std::is_nothrow_copy_assignable_v< value_type >)
 
void swap (ReservedVector &other) noexcept(std::is_nothrow_swappable_v< value_type >)
 
void swap (ReservedVector &other) noexcept(std::is_nothrow_swappable_v< value_type >)
 
constexpr size_type size () const noexcept
 
constexpr bool empty () const noexcept
 

Static Public Member Functions

static constexpr size_type capacity () noexcept
 
static constexpr size_type max_size () noexcept
 

Static Public Attributes

static const std::size_t max_depth = n
 The maximum possible depth of the MultiIndex.
 

Friends

reference front (MultiIndex &mi)
 Returns the front element of the MultiIndex.
 
const_reference front (const MultiIndex &mi)
 Returns the front element of the MultiIndex.
 
reference back (MultiIndex &mi)
 Returns the back element of the MultiIndex.
 
const_reference back (const MultiIndex &mi)
 Returns the back element of the MultiIndex.
 
MultiIndex push_back (MultiIndex mi, const value_type &t)
 Returns a copy of a multi-index with appended element.
 
MultiIndex push_front (MultiIndex mi, const value_type &t)
 Returns a copy of a multi-index with prepended element.
 
MultiIndex pop_back (MultiIndex mi)
 Returns a copy of a multi-index without the back element.
 
MultiIndex pop_front (MultiIndex mi)
 Returns a copy of a multi-index without the front element.
 
MultiIndex accumulate_back (MultiIndex mi, const value_type &t)
 Accumulates a value to the back element of the MultiIndex.
 
MultiIndex accumulate_front (MultiIndex mi, const value_type &t)
 Accumulates a value to the front element of the MultiIndex.
 
MultiIndex join (MultiIndex head, const MultiIndex &tail)
 Concatenates two MultiIndices into a new MultiIndex, up to the maximum size n.
 
MultiIndex reverse (MultiIndex rv)
 Reverses the order of elements in the MultiIndex.
 
std::ostreamoperator<< (std::ostream &s, const MultiIndex &mi)
 Writes a pretty representation of the MultiIndex to the given std::ostream.
 

Detailed Description

template<typename T, std::size_t n>
class Dune::PDELab::MultiIndex< T, n >

A class for representing multi-indices.

A MultiIndex represents an ordered tuple of indices.

Template Parameters
Tthe type of the index entries.
nthe maximum number of indices in the MultiIndex.

Constructor & Destructor Documentation

◆ MultiIndex() [1/5]

template<typename T , std::size_t n>
Dune::PDELab::MultiIndex< T, n >::MultiIndex ( )
inline

◆ MultiIndex() [2/5]

template<typename T , std::size_t n>
Dune::PDELab::MultiIndex< T, n >::MultiIndex ( const View view)
inline

◆ MultiIndex() [3/5]

template<typename T , std::size_t n>
Dune::PDELab::MultiIndex< T, n >::MultiIndex ( const ReservedVector< T, n > &  rv)
inline

Copy constructor from ReservedVector.

◆ MultiIndex() [4/5]

template<typename T , std::size_t n>
template<std::size_t _n>
requires (n != _n)
Dune::PDELab::MultiIndex< T, n >::MultiIndex ( const MultiIndex< T, _n > &  rv)
inline

Copy constructor from a multi-index of different size.

◆ MultiIndex() [5/5]

template<typename T , std::size_t n>
template<class... U>
Dune::PDELab::MultiIndex< T, n >::MultiIndex ( const TypeTree::HybridTreePath< U... > &  tp)
inline

Copy constructor from a hybrid multi-index.

Member Function Documentation

◆ operator!=()

template<typename T , std::size_t n>
bool Dune::PDELab::MultiIndex< T, n >::operator!= ( const MultiIndex< T, n > &  r) const
inline

Tests whether two MultiIndices are not equal.

◆ operator==()

template<typename T , std::size_t n>
bool Dune::PDELab::MultiIndex< T, n >::operator== ( const MultiIndex< T, n > &  r) const
inline

Tests whether two MultiIndices are equal.

Note
Only MultiIndices of identical max_depth are comparable.

◆ pop_front()

template<typename T , std::size_t n>
void Dune::PDELab::MultiIndex< T, n >::pop_front ( )
inline

Erases the last element of the vector, O(1) time.

◆ push_front()

template<typename T , std::size_t n>
void Dune::PDELab::MultiIndex< T, n >::push_front ( const value_type t)
inline

Appends an element to the beginning of a vector, up to the maximum size n, O(n) time.

◆ set()

template<typename T , std::size_t n>
void Dune::PDELab::MultiIndex< T, n >::set ( typename ReservedVector< T, n >::value_type  index)
inline

◆ view() [1/2]

template<typename T , std::size_t n>
View Dune::PDELab::MultiIndex< T, n >::view ( ) const
inline

◆ view() [2/2]

template<typename T , std::size_t n>
View Dune::PDELab::MultiIndex< T, n >::view ( std::size_t  size) const
inline

Friends And Related Symbol Documentation

◆ accumulate_back

template<typename T , std::size_t n>
MultiIndex accumulate_back ( MultiIndex< T, n >  mi,
const value_type t 
)
friend

Accumulates a value to the back element of the MultiIndex.

◆ accumulate_front

template<typename T , std::size_t n>
MultiIndex accumulate_front ( MultiIndex< T, n >  mi,
const value_type t 
)
friend

Accumulates a value to the front element of the MultiIndex.

◆ back [1/2]

template<typename T , std::size_t n>
const_reference back ( const MultiIndex< T, n > &  mi)
friend

Returns the back element of the MultiIndex.

◆ back [2/2]

template<typename T , std::size_t n>
reference back ( MultiIndex< T, n > &  mi)
friend

Returns the back element of the MultiIndex.

◆ front [1/2]

template<typename T , std::size_t n>
const_reference front ( const MultiIndex< T, n > &  mi)
friend

Returns the front element of the MultiIndex.

◆ front [2/2]

template<typename T , std::size_t n>
reference front ( MultiIndex< T, n > &  mi)
friend

Returns the front element of the MultiIndex.

◆ join

template<typename T , std::size_t n>
MultiIndex join ( MultiIndex< T, n >  head,
const MultiIndex< T, n > &  tail 
)
friend

Concatenates two MultiIndices into a new MultiIndex, up to the maximum size n.

◆ operator<<

template<typename T , std::size_t n>
std::ostream & operator<< ( std::ostream s,
const MultiIndex< T, n > &  mi 
)
friend

Writes a pretty representation of the MultiIndex to the given std::ostream.

◆ pop_back

template<typename T , std::size_t n>
MultiIndex pop_back ( MultiIndex< T, n >  mi)
friend

Returns a copy of a multi-index without the back element.

◆ pop_front

template<typename T , std::size_t n>
MultiIndex pop_front ( MultiIndex< T, n >  mi)
friend

Returns a copy of a multi-index without the front element.

◆ push_back

template<typename T , std::size_t n>
MultiIndex push_back ( MultiIndex< T, n >  mi,
const value_type t 
)
friend

Returns a copy of a multi-index with appended element.

◆ push_front

template<typename T , std::size_t n>
MultiIndex push_front ( MultiIndex< T, n >  mi,
const value_type t 
)
friend

Returns a copy of a multi-index with prepended element.

◆ reverse

template<typename T , std::size_t n>
MultiIndex reverse ( MultiIndex< T, n >  rv)
friend

Reverses the order of elements in the MultiIndex.

Member Data Documentation

◆ max_depth

template<typename T , std::size_t n>
const std::size_t Dune::PDELab::MultiIndex< T, n >::max_depth = n
static

The maximum possible depth of the MultiIndex.


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