Namespaces | |
TensorExpressions | |
Classes | |
struct | TensorExpressions::TensorContract< Index1, Index2, T, X, Symm, IndexList, ArgsList > |
struct | TensorExpressions::Product< T1, T2, ArgsList1, ArgsList2 > |
struct | TensorIndex< I > |
Represents the indices in a TensorExpression. More... | |
struct | Expression |
Marks a class as being a TensorExpression. More... | |
struct | TensorExpression< Derived, DataType, Symm, IndexList, ArgsList< Args... > > |
The base class all tensor expression implementations derive from. More... | |
Typedefs | |
template<template< typename > class TE, typename ReplacedArgList , typename I , typename TotalContracted > | |
using | TensorExpressions::fully_contracted = detail::fully_contract_helper< TE, ReplacedArgList, I, TotalContracted > |
Represents a fully contracted Tensor. | |
template<typename T > | |
using | next_tensor_index = TensorIndex< T::value+1 > |
Given an TensorIndex<size_t> return TensorIndex<size_t + 1> More... | |
template<typename A , typename B > | |
using | plus_tensor_index = TensorIndex< A::value+B::value > |
Metafunction to return the sum of two TensorIndex's. | |
template<typename Lhs , typename Rhs > | |
using | rhs_elements_in_lhs = tmpl::fold< Rhs, tmpl::list<>, detail::rhs_elements_in_lhs_helper< tmpl::_state, tmpl::_element, tmpl::pin< Lhs > >> |
Returns a list of all the elements in the typelist Rhs that are also in the typelist Lhs. More... | |
template<typename Rhs , typename Lhs , typename RhsOnyWithLhs > | |
using | generate_transformation = tmpl::enumerated_fold< Rhs, tmpl::list<>, detail::generate_transformation_impl< tmpl::_state, tmpl::_element, tmpl::_3, tmpl::pin< Lhs >, tmpl::pin< Rhs >, tmpl::pin< RhsOnyWithLhs > >> |
Generate transformation to account for index order difference in RHS and LHS. More... | |
template<typename List > | |
using | repeated = tmpl::fold< List, tmpl::list<>, detail::repeated_helper< tmpl::pin< List >, tmpl::_state, tmpl::_element > > |
template<typename List , typename ReplaceList > | |
using | replace_indices = typename detail::replace_indices_impl< List, ReplaceList, 0 >::type |
Functions | |
template<typename T1 , typename T2 , typename X , typename Symm1 , typename Symm2 , typename IndexList1 , typename IndexList2 , typename Args1 , typename Args2 > | |
auto | operator+ (const TensorExpression< T1, X, Symm1, IndexList1, Args1 > &t1, const TensorExpression< T2, X, Symm2, IndexList2, Args2 > &t2) |
template<typename T1 , typename T2 , typename X , typename Symm1 , typename Symm2 , typename IndexList1 , typename IndexList2 , typename Args1 , typename Args2 > | |
auto | operator- (const TensorExpression< T1, X, Symm1, IndexList1, Args1 > &t1, const TensorExpression< T2, X, Symm2, IndexList2, Args2 > &t2) |
template<int Index1, int Index2, typename T , typename X , typename Symm , typename IndexList , typename Args > | |
auto | TensorExpressions::contract (const TensorExpression< T, X, Symm, IndexList, Args > &t) |
template<typename... LhsIndices, typename T , Requires< std::is_base_of< Expression, T >::value > = nullptr> | |
auto | TensorExpressions::evaluate (const T &te) |
Evaluate a Tensor Expression with LHS indices set in the template parameters. More... | |
template<typename T1 , typename T2 , typename X , typename Symm1 , typename Symm2 , typename IndexList1 , typename IndexList2 , typename Args1 , typename Args2 > | |
auto | operator* (const TensorExpression< T1, X, Symm1, IndexList1, Args1 > &t1, const TensorExpression< T2, X, Symm2, IndexList2, Args2 > &t2) |
TensorIndex< 0 > | ti_a |
The available TensorIndex's to use in a TensorExpression. More... | |
Tensor Expressions allow writing expressions of tensors in a way similar to what is used with pen and paper.
Tensor expressions are implemented using (smart) expression templates. This allows a domain specific language making expressions such as
possible.
using generate_transformation = tmpl::enumerated_fold< Rhs, tmpl::list<>, detail::generate_transformation_impl<tmpl::_state, tmpl::_element, tmpl::_3, tmpl::pin<Lhs>, tmpl::pin<Rhs>, tmpl::pin<RhsOnyWithLhs> >> |
Generate transformation to account for index order difference in RHS and LHS.
Generates the transformation \(\mathcal{T}\) that rearranges the Tensor index array to account for index order differences between the LHS and RHS of the tensor expression.
For typelists Rhs
, Lhs
and RhsOnyWithLhs
, where RhsOnlyWithLhs
is the result of the metafunction rhs_elements_in_lhs,
Returns: typelist
using next_tensor_index = TensorIndex<T::value + 1> |
Given an TensorIndex<size_t>
return TensorIndex<size_t + 1>
T | the args to increment |
using repeated = tmpl::fold< List, tmpl::list<>, detail::repeated_helper<tmpl::pin<List>, tmpl::_state, tmpl::_element> > |
Returns a list of all the types that occurred more than once in List.
using rhs_elements_in_lhs = tmpl::fold<Rhs, tmpl::list<>, detail::rhs_elements_in_lhs_helper<tmpl::_state, tmpl::_element, tmpl::pin<Lhs> >> |
Returns a list of all the elements in the typelist Rhs that are also in the typelist Lhs.
Given two typelists Lhs
and Rhs
, returns a typelist of all the elements in Rhs
that are also in Lhs
in the same order that they are in the Rhs
.
For typelists List1
and List2
,
Returns: typelist
Semantics: If Lhs = tmpl::list<A, B, C, D>
and Rhs = tmpl::list<B, E, A>
, then
auto TensorExpressions::evaluate | ( | const T & | te | ) |
Evaluate a Tensor Expression with LHS indices set in the template parameters.
LhsIndices | the indices on the left hand side of the tensor expression |
Returns: Tensor<typename T::type, typename T::symmetry, typename T::index_list>
auto operator* | ( | const TensorExpression< T1, X, Symm1, IndexList1, Args1 > & | t1, |
const TensorExpression< T2, X, Symm2, IndexList2, Args2 > & | t2 | ||
) |
T1 | |
T2 | |
X | |
Symm1 | |
Symm2 | |
IndexList1 | |
IndexList2 | |
Args1 | |
Args2 |
t1 | |
t2 |
Returns:
TensorIndex<0> ti_a |
The available TensorIndex's to use in a TensorExpression.
Available tensor indices to use in a Tensor Expression.