DUNE PDELab (git)
Classes | |
class | Dune::TypeTree::HybridTreePath< T > |
A hybrid version of TreePath that supports both compile time and run time indices. More... | |
Functions | |
template<typename... T> | |
constexpr auto | Dune::TypeTree::makeTreePath (const T... t) |
helper function to construct a new HybridTreePath from the given indices. More... | |
template<typename... T> | |
constexpr auto | Dune::TypeTree::hybridTreePath (const T &... t) |
Constructs a new HybridTreePath from the given indices. More... | |
template<typename... T> | |
constexpr auto | Dune::TypeTree::treePath (const T &... t) |
Constructs a new HybridTreePath from the given indices. More... | |
template<typename... T> | |
constexpr std::size_t | Dune::TypeTree::treePathSize (const HybridTreePath< T... > &) |
Returns the size (number of components) of the given HybridTreePath . | |
template<std::size_t i, typename... T> | |
constexpr auto | Dune::TypeTree::treePathEntry (const HybridTreePath< T... > &tp, index_constant< i >={}) -> typename std::decay< decltype(std::get< i >(tp._data))>::type |
Returns a copy of the i-th element of the HybridTreePath . More... | |
template<std::size_t i, typename... T> | |
constexpr std::size_t | Dune::TypeTree::treePathIndex (const HybridTreePath< T... > &tp, index_constant< i >={}) |
Returns the index value of the i-th element of the HybridTreePath . More... | |
template<typename... T> | |
constexpr auto | Dune::TypeTree::back (const HybridTreePath< T... > &tp) -> decltype(tp.back()) |
Returns a copy of the last element of the HybridTreePath . More... | |
template<typename... T> | |
constexpr auto | Dune::TypeTree::front (const HybridTreePath< T... > &tp) -> decltype(tp.front()) |
Returns a copy of the first element of the HybridTreePath . More... | |
template<typename... T> | |
constexpr HybridTreePath< T..., std::size_t > | Dune::TypeTree::push_back (const HybridTreePath< T... > &tp, std::size_t i) |
Appends a run time index to a HybridTreePath . More... | |
template<std::size_t i, typename... T> | |
constexpr HybridTreePath< T..., index_constant< i > > | Dune::TypeTree::push_back (const HybridTreePath< T... > &tp, index_constant< i > i_={}) |
Appends a compile time index to a HybridTreePath . More... | |
template<typename... T> | |
constexpr HybridTreePath< std::size_t, T... > | Dune::TypeTree::push_front (const HybridTreePath< T... > &tp, std::size_t element) |
Prepends a run time index to a HybridTreePath . More... | |
template<std::size_t i, typename... T> | |
constexpr HybridTreePath< index_constant< i >, T... > | Dune::TypeTree::push_front (const HybridTreePath< T... > &tp, index_constant< i > _i={}) |
Prepends a compile time index to a HybridTreePath . More... | |
template<typename I , typename... T, std::enable_if_t<(sizeof...(T) > 0), bool > = true> | |
constexpr auto | Dune::TypeTree::accumulate_back (const HybridTreePath< T... > &tp, I i) |
Hybrid utility that accumulates to the back of a multi-index. More... | |
template<typename I , typename... T, std::enable_if_t<(sizeof...(T) > 0), bool > = true> | |
constexpr auto | Dune::TypeTree::accumulate_front (const HybridTreePath< T... > &tp, I i) |
Hybrid utility that accumulates to the front of a multi-index. More... | |
template<class... Head, class... Other> | |
constexpr auto | Dune::TypeTree::join (const HybridTreePath< Head... > &head, const Other &... tail) |
Join two tree paths into one. | |
template<class... T> | |
constexpr auto | Dune::TypeTree::reverse (const HybridTreePath< T... > &tp) |
Reverses the order of the elements in the path. | |
template<class... T, std::enable_if_t<(sizeof...(T) > 0), bool > = true> | |
constexpr auto | Dune::TypeTree::pop_front (const HybridTreePath< T... > &tp) |
Removes first index on a HybridTreePath . More... | |
template<class... T, std::enable_if_t<(sizeof...(T) > 0), bool > = true> | |
constexpr auto | Dune::TypeTree::pop_back (const HybridTreePath< T... > &tp) |
Removes last index on a HybridTreePath . More... | |
template<class... S, class... T> | |
constexpr bool | Dune::TypeTree::operator== (const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs) |
Compare two HybridTreePath s for value equality. More... | |
template<class S , S... lhs, class T , T... rhs> | |
constexpr auto | Dune::TypeTree::operator== (const HybridTreePath< std::integral_constant< S, lhs >... > &, const HybridTreePath< std::integral_constant< T, rhs >... > &) |
Overload for purely static HybridTreePath s. More... | |
template<class... S, class... T> | |
constexpr auto | Dune::TypeTree::operator!= (const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs) |
Compare two HybridTreePath s for unequality. | |
template<class S , S... lhs, class T , T... rhs> | |
constexpr auto | Dune::TypeTree::operator!= (const HybridTreePath< std::integral_constant< S, lhs >... > &, const HybridTreePath< std::integral_constant< T, rhs >... > &) |
Compare two static HybridTreePath s for unequality. | |
template<typename... T> | |
std::ostream & | Dune::TypeTree::operator<< (std::ostream &os, const HybridTreePath< T... > &tp) |
Dumps a HybridTreePath to a stream. | |
Detailed Description
Function Documentation
◆ accumulate_back()
|
constexpr |
Hybrid utility that accumulates to the back of a multi-index.
The back of the path will be accumulated and promoted in order to hold the new index:
References Dune::back(), Dune::Hybrid::plus, Dune::TypeTree::pop_back(), and Dune::push_back().
◆ accumulate_front()
|
constexpr |
Hybrid utility that accumulates to the front of a multi-index.
The front of the path will be accumulated and promoted in order to hold the new index:
References Dune::front(), Dune::Hybrid::plus, Dune::TypeTree::pop_front(), and Dune::push_front().
◆ back()
|
constexpr |
Returns a copy of the last element of the HybridTreePath
.
As HybridTreePath
instances should not be mutated after their creation, this function returns a copy of the value. As values are either std::integral_constant
or std::size_t
, that's just as cheap as returning a reference.
References Dune::TypeTree::HybridTreePath< T >::back().
◆ front()
|
constexpr |
Returns a copy of the first element of the HybridTreePath
.
As HybridTreePath
instances should not be mutated after their creation, this function returns a copy of the value. As values are either std::integral_constant
or std::size_t
, that's just as cheap as returning a reference.
References Dune::TypeTree::HybridTreePath< T >::front().
◆ hybridTreePath()
|
constexpr |
Constructs a new HybridTreePath
from the given indices.
This function returns a new HybridTreePath
with the given index values. It exists mainly to avoid having to manually specify the exact type of the new object.
It further ensures that the basic number type is std::size_t and casts any indices accordingly.
References Dune::TypeTree::makeTreePath().
Referenced by Dune::TypeTree::applyToTree(), Dune::TypeTree::applyToTreePair(), Dune::TypeTree::forEachLeafNode(), Dune::TypeTree::forEachNode(), Dune::TypeTree::leafTreePathTuple(), Dune::TypeTree::operator!=(), and Dune::TypeTree::operator==().
◆ makeTreePath()
|
constexpr |
helper function to construct a new HybridTreePath
from the given indices.
This function returns a new HybridTreePath
with the given index values. It is only a helper function used by treePath
and hybridTreePath
.
It expects that all indices use std::size_t as basic number type.
Referenced by Dune::TypeTree::hybridTreePath(), and Dune::TypeTree::treePath().
◆ operator==() [1/2]
|
constexpr |
Compare two HybridTreePath
s for value equality.
The function returns true if both tree paths are of the same length and all entries have the same value.
Note, it might be that the values are represented with different types. To check for same value and same type, use a combination of std::is_same
and this comparison operator.
References Dune::unpackIntegerSequence().
◆ operator==() [2/2]
|
constexpr |
Overload for purely static HybridTreePath
s.
The function returns std::true_type
if the values of the passed treepaths are equal. Otherwise returns std::false_type
. Note, this overload is chosen for purely static treepaths only.
References Dune::TypeTree::hybridTreePath().
◆ pop_back()
|
constexpr |
Removes last index on a HybridTreePath
.
This function returns a new HybridTreePath
without the last index.
References Dune::unpackIntegerSequence().
Referenced by Dune::TypeTree::accumulate_back().
◆ pop_front()
|
constexpr |
Removes first index on a HybridTreePath
.
This function returns a new HybridTreePath
without the first index.
References Dune::unpackIntegerSequence().
Referenced by Dune::TypeTree::accumulate_front().
◆ push_back() [1/2]
|
constexpr |
Appends a compile time index to a HybridTreePath
.
This function returns a new HybridTreePath
with the compile time index i
appended.
The value for the new entry can be passed either as a template parameter or as an index_constant
:
◆ push_back() [2/2]
|
constexpr |
Appends a run time index to a HybridTreePath
.
This function returns a new HybridTreePath
with the run time index i
appended.
Referenced by Dune::PDELab::LocalSparsityPattern::addLink().
◆ push_front() [1/2]
|
constexpr |
Prepends a compile time index to a HybridTreePath
.
This function returns a new HybridTreePath
with the compile time index i
prepended.
The value for the new entry can be passed either as a template parameter or as an index_constant
:
◆ push_front() [2/2]
|
constexpr |
Prepends a run time index to a HybridTreePath
.
This function returns a new HybridTreePath
with the run time index i
prepended.
◆ treePath()
|
constexpr |
Constructs a new HybridTreePath
from the given indices.
This function returns a new HybridTreePath
with the given index values. It exists mainly to avoid having to manually specify the exact type of the new object.
It further ensures that the basic number type is std::size_t and casts any indices accordingly.
References Dune::TypeTree::makeTreePath().
Referenced by Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >::LocalFunction::operator()(), and Dune::TypeTree::reverse().
◆ treePathEntry()
|
constexpr |
Returns a copy of the i-th element of the HybridTreePath
.
As HybridTreePath
instances should not be mutated after their creation, this function returns a copy of the value. As values are either std::integral_constant
or std::size_t
, that's just as cheap as returning a reference.
The index for the entry can be passed either as a template parameter or as an index_constant
:
◆ treePathIndex()
|
constexpr |
Returns the index value of the i-th element of the HybridTreePath
.
This function always returns the actual index value, irrespective of whether the entry is a compile time index or a run time index.
The index for the entry can be passed either as a template parameter or as an index_constant
: