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;
This commit adds an initial implementation of a class template Tensor
that allows for the storage of objects with more than two indices.
Currently, only storing data and setting the object to zero for POD
data types are implemented.
Create a new directory CXX11 under unsupported/Eigen that contains code
that requires C++11. In that directory, add a few generic templates
useful for any module relying on C++11. These templates may be included
with #include <[unsupported/]Eigen/CXX11/Core>. At the moment, this
will only provide templates in the Eigen::internal namespace.
The former is very low level and generic. The later abstarct the former for dense expressions. This refactoring permits
to get rid of the very ugly SwapWrapper and SelfCwiseBinaryOp classes.
In the future, this will also permit to simplify all these evaluation loops and perhaps to reuse them for reduxions.
That will also permit to specialize for operations like expr1 += expr2 outside Eigen, and so for any kind
of expressions (dense, sparse, tensor, etc.)