I am trying to find the maximum value of an Eigen tensor. I know how to do this using Eigen matrices but obviously this is not working for a tensor:
Example
static const int nx = 4;
static const int ny = 4;
static const int nz = 4;
Eigen::Tensor<double, 3> Test(nx,ny,nz);
Test.setZero();
Eigen::Tensor<double, 3> MaxTest(nx,ny,nz);
MaxTest.setZero();
MaxTest = Test.maxCoeff();
Usually for an Eigen matrix I would do the following:
MaxTest = Test.array().maxCoeff();
But this is not working, instead I get the error:
class "Eigen::Tensor<std::complex<double>, 3, 0, Eigen::DenseIndex>" has no member "maxCoeff"
Is there another way to get the maximum value of this tensor? Something equivalent to max(max(max(tensor)))
in MATLAB.
Test.maximum();
but this does notdouble max = Test.maximum();
– Ravage