|
template<tag ... TL2>
requires (sizeof...(TL2) == sizeof...(TL)) |
| tensor_class (const range_class< TL2 ... > &rng) |
| Initialize the tensor_class to a size defined by a range_class.
|
|
template<tag ... TL2>
requires (sizeof...(TL2) == sizeof...(TL)) |
| tensor_class (const range_class< TL2 ... > &rng, const E &e) noexcept |
| Initialize the tensor_class to a size defined by a range_class.
|
|
view_type | view () |
| Return tensor_view acting as a reference to the complete tensor_class.
|
|
const_view_type | view () const |
| Return tensor_view acting as a const reference to the complete tensor_class.
|
|
template<tag ... TL2>
requires (sizeof...(TL2) < sizeof...(TL)) && impl::subset_selector< tag_list< TL2...>, tag_list< TL...>> |
auto | operator[] (const index_class< TL2 ... > &i) |
| Extract a reference to a sub-space of this tensor.
|
|
template<tag ... TL2>
requires (sizeof...(TL2) < sizeof...(TL)) && impl::subset_selector< tag_list< TL2...>, tag_list< TL...>> |
auto | operator[] (const index_class< TL2 ... > &i) const |
| Extract an immutable reference to a sub-space of this tensor.
|
|
const range_class< TL ... > & | range () const |
| The range corresponding to this tensor.
|
|
template<tag ... TL2>
requires (sizeof...(TL2) == sizeof...(TL)) && impl::subset_selector< tag_list< TL2...>, tag_list< TL...>> |
E & | operator[] (const index_class< TL2... > &i) |
| Access an element of this tensor.
|
|
template<tag ... TL2>
requires (sizeof...(TL2) == sizeof...(TL)) && impl::subset_selector< tag_list< TL2...>, tag_list< TL...>> |
const E & | operator[] (const index_class< TL2... > &i) const |
| Read an element of this tensor.
|
|
E * | data () |
| A pointer to the beginning of the array containing the data.
|
|
const E * | data () const |
| A const pointer to the beginning of the array containing the data.
|
|
E * | flat_data () |
| A pointer to the beginning of the array containing the data.
|
|
const E * | flat_data () const |
| A const pointer to the beginning of the array containing the data.
|
|
template<typename E, tag ... TL>
class tagged::tensor_class< E, TL >
A tensor - a multi-dimensional tagged generalization of vector/matrix.
The order of tags in the template argument list defines the layout. The right-most tag becomes the inner-most dimension (with contiguously stored elements).
The tensor contains precomputed multipliers for each dimension so that indexing in each dimension works in constant time.
Optimization: If K rightmost tags have statically defined range, the multipliers of the righmost (K+1) dimensions are precomputed statically and not stored as run-time data inside the class. The same precomputation is applied in every tensor_view referencing this tensor_class.
- Template Parameters
-
E | Element type |
...TL | Tag list |