Dear all, When I am implementing a spectrum decomposition for an arbitrary symmetric matrix, I need to copy a full matrix into a rank-2 tensor. I know that FullMatrix has a copy_to() member function like below
*template<typename number >template<int dim>void FullMatrix< number >::copy_to ( Tensor< 2, dim > & T,const size_type src_r_i = 0,const size_type src_r_j = dim - 1,const size_type src_c_i = 0,const size_type src_c_j = dim - 1,const unsigned int dst_r = 0,const unsigned int dst_c = 0 ) const* However, the above copy_to() function only works when the tensor dimension is less or equal to 3, that is, Tensor<2, dim>, dim <=3. When dim is larger than 3, I have to use for loops to copy each matrix entry into the rank-2 tensor. I know that it is typical to set dim as 2 or 3. However, does it make sense to make FullMatrix::copy_to() work for a general rank-2 tensor? By the way, in the file full_matrix.inst.in, *for (S : REAL_SCALARS) { template void FullMatrix<S>::copy_to<1>(Tensor<2, 1> &, const size_type, const size_type, const size_type, const size_type, const unsigned int, const unsigned int) const; template void FullMatrix<S>::copy_to<2>(Tensor<2, 2> &, const size_type, const size_type, const size_type, const size_type, const unsigned int, const unsigned int) const; template void FullMatrix<S>::copy_to<3>(Tensor<2, 3> &, const size_type, const size_type, const size_type, const size_type, const unsigned int, const unsigned int) const; }* This is probably the reason why copy_to only works for dim <=3 Best, Tao -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/4a697071-4b80-46b7-8f83-3d9df71e3662n%40googlegroups.com.