[eigen] Tensor Module: Index mapping support |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
If the user of the tensor component in eigen uses its own indices lets say Eigen::Array<int,3> idx(1,2,3); this is currently not possible: Eigen::Tensor<double,3> t(4,4,4) t( idx ) = 5; We could implement this maybe with the following wrappers (here for the resize function and CXX11 support of course as example): template<typename IndexType> void resize( const IndexType & dimensions ){ resize(dimensions, std::make_index_sequence<NTensorIndices>{} ); } template<typename IndexType, std::size_t... Is> void resize(const IndexType & dimensions, std::index_sequence<Is...> ) { m_tensor.resize( dimensions(Is)... ); } Or is this already provided in the tensor module such that one can use own index types ? Thanks a lot :-) BR Gabriel |
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |