Eigen colwise() equivalent to reduce an n by m by o matrix

25 Views Asked by At

I have a matrix such that

Eigen::MatrixXd mat(5,10,20);

I want to reduce this to an 5 by 10 matrix by summing along the last dimension. If it were a 2d matrix, I could use colwise() or rowwise(). Is there something I can use here? Or do I need to loop through all elements?

0

There are 0 best solutions below