aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/cxx11_meta.cpp
diff options
context:
space:
mode:
authorGravatar Christian Seiler <christian@iwakd.de>2013-11-14 23:35:11 +0100
committerGravatar Christian Seiler <christian@iwakd.de>2013-11-14 23:35:11 +0100
commit03a956925a969e3759418bd1e0fced82eb5f9d12 (patch)
tree9ec0cfecc851a8c75cdac18e981ecb01a69ec5a8 /unsupported/test/cxx11_meta.cpp
parentf97b3cd0249228820807229a2d529260522ba8c7 (diff)
CXX11/TensorSymmetry: add symmetry support for Tensor class
Add a symCoeff() method to the Tensor class template that allows the user of the class to set multiple elements of a tensor at once if they are connected by a symmetry operation with respect to the tensor's indices (symmetry/antisymmetry/hermiticity/antihermiticity under echange of two indices and combination thereof for different pairs of indices). A compile-time resolution of the required symmetry groups via meta templates is also implemented. For small enough groups this is used to unroll the loop that goes through all the elements of the Tensor that are connected by this group. For larger groups or groups where the symmetries are defined at run time, a standard run-time implementation of the same algorithm is provided. For example, the following code completely initializes all elements of the totally antisymmetric tensor in three dimensions ('epsilon tensor'): SGroup<3, AntiSymmetry<0,1>, AntiSymmetry<1,2>> sym; Eigen::Tensor<double, 3> epsilon(3,3,3); epsilon.setZero(); epsilon.symCoeff(sym, 0, 1, 2) = 1;
Diffstat (limited to 'unsupported/test/cxx11_meta.cpp')
0 files changed, 0 insertions, 0 deletions