[eigen] Support for trace of tensors

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


I am evaluating Eigen::Tensor, it is very nice and allows to reduce some of my code a lot.
In tensor calculus the trace is an important operation.
could it be supported by Eigen:Tensor ?

For example
Eigen::Tensor<double,3> S( 2,2,2 );

Eigen::array<DimPair, 1> dims = {{DimPair(0, 1)}}; 

// compute the trace of S along the first and second dimensions
Eigen::Tensor<double,1> V=S.trace( dims );

​Best regards
Christophe Prud'homme
Feel++ Project Manager
Professor in Applied Mathematics 
@ Université de Strasbourg (France)

Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/