asgn
 
Loading...
Searching...
No Matches
Tensors and tagged indexes

Concepts

concept  tagged::tag
 Any tag used to specify a dimension.
 
concept  tagged::selector_tag
 A bare tag used to select a dimension.
 

Classes

struct  tagged::tag_list< TL >
 A wrapped list of tags. More...
 
class  tagged::index_class< T >
 A tagged index. More...
 
class  tagged::range_class< T >
 A range generating tagged index values. More...
 
class  tagged::index_class< TL >
 A list of tagged indexes (a position in an N-dimensional space) More...
 
class  tagged::range_class< TL >
 A list of tagged ranges (an N-dimensional box) More...
 
class  tagged::tensor_view< E, TL >
 A reference to a sub-space of a tensor. More...
 
class  tagged::tensor_class< E, TL >
 A tensor - a multi-dimensional tagged generalization of vector/matrix. More...
 

Typedefs

template<tag T>
using tagged::selector = typename impl::tag_traits<T>::selector
 Extract selector tag from any tag.
 
template<typename E, tag ... TL>
using tagged::extract_tensor_view = typename impl::tensor_view_creator< E, typename impl::mixer_list_traits< range_class< TL...>, impl::multiplier_list< TL...>>::type>::type
 The type of a tensor_view acting as a reference to the complete tensor_class with the given tag list.
 
template<typename P, typename E, tag ... TL>
using tagged::permute_tensor_class = impl::permute_t< P, impl::permutator_tensor_class<E, TL...>>
 Provide a tensor_class for the selected dimensions with layout specified by a tagged::tag_list.
 
template<tag T>
using tagged::co = retag< typename impl::co_traits<selector<T>>::co, T>
 Provide a co-tag for a given tag.
 
template<typename X>
using tagged::co_list = typename impl::co_list_traits< X>::co_list
 Co-tag every element of a tag_list.
 

Functions

template<tag ... TL1, tag ... TL2>
index_class< TL1 ..., TL2 ... > tagged::operator& (const index_class< TL1 ... > &ia, const index_class< TL2 ... > &ib)
 Concatenate two (multi-dimensional) indexes together.
 
template<tag ... TL1, tag ... TL2>
range_class< TL1 ..., TL2 ... > tagged::operator& (const range_class< TL1 ... > &rnga, const range_class< TL2 ... > &rngb)
 Concatenate two (multi-dimensional) ranges.
 
template<tag T>
constexpr range_class< co< T > > tagged::operator~ (const range_class< T > &r)
 Return a co-tagged range with the same extent.
 
template<tag T>
index_class< co< T > > tagged::operator~ (const index_class< T > &r)
 Return a co-tagged index with the same value.
 

Detailed Description

Typedef Documentation

◆ co

template<tag T>
using tagged::co = retag< typename impl::co_traits<selector<T>>::co, T>

Provide a co-tag for a given tag.

Co-tagging is a self-inverse operation, i.e. co<co<T>>==T

The purpose of co-tagging is the conversion between covariant and contravariant indices.

Co-tagging preserves any static information that may be attached to the tag.

Template Parameters
TA tag

◆ co_list

template<typename X>
using tagged::co_list = typename impl::co_list_traits< X>::co_list

Co-tag every element of a tag_list.

Template Parameters
XA tag_list

◆ extract_tensor_view

template<typename E, tag ... TL>
using tagged::extract_tensor_view = typename impl::tensor_view_creator< E, typename impl::mixer_list_traits< range_class< TL...>, impl::multiplier_list< TL...>>::type>::type

The type of a tensor_view acting as a reference to the complete tensor_class with the given tag list.

Template Parameters
EElement type (possibly const)
...TLTag list

◆ permute_tensor_class

template<typename P, typename E, tag ... TL>
using tagged::permute_tensor_class = impl::permute_t< P, impl::permutator_tensor_class<E, TL...>>

Provide a tensor_class for the selected dimensions with layout specified by a tagged::tag_list.

Template Parameters
PA tagged::tag_list of selector tags
EAn element type
...TLA tag list, possibly containing tags carrying static range information

◆ selector

template<tag T>
using tagged::selector = typename impl::tag_traits<T>::selector

Extract selector tag from any tag.

Template Parameters
T

Function Documentation

◆ operator&() [1/2]

template<tag ... TL1, tag ... TL2>
index_class< TL1 ..., TL2 ... > tagged::operator& ( const index_class< TL1 ... > & ia,
const index_class< TL2 ... > & ib )

Concatenate two (multi-dimensional) indexes together.

Template Parameters
...TL1Tag list 1
...TL2Tag list 2
Parameters
ia(Multi-)tagged index 1
ib(Multi-)tagged index 2
Returns
Multi-tagged index

◆ operator&() [2/2]

template<tag ... TL1, tag ... TL2>
range_class< TL1 ..., TL2 ... > tagged::operator& ( const range_class< TL1 ... > & rnga,
const range_class< TL2 ... > & rngb )

Concatenate two (multi-dimensional) ranges.

Template Parameters
...TL1Tag list 1
...TL2Tag list 2
Parameters
rnga(Multi-)tagged range 1
rngb(Multi-)tagged range 2
Returns
Multi-tagged range

◆ operator~() [1/2]

template<tag T>
index_class< co< T > > tagged::operator~ ( const index_class< T > & r)
inline

Return a co-tagged index with the same value.

Template Parameters
TTag
Parameters
rTagged index
Returns
Co-tagged index

◆ operator~() [2/2]

template<tag T>
range_class< co< T > > tagged::operator~ ( const range_class< T > & r)
inlineconstexpr

Return a co-tagged range with the same extent.

Template Parameters
TTag
Parameters
rRange
Returns
Co-tagged range