diff options
Diffstat (limited to 'doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp')
-rw-r--r-- | doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp index cb46887b6..049c747b0 100644 --- a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp +++ b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp @@ -2,13 +2,14 @@ #include <Eigen/Dense> using namespace std; +using namespace Eigen; int main() { - Eigen::MatrixXf mat(2,4); + MatrixXf mat(2,4); mat << 1, 2, 6, 9, 3, 1, 7, 2; - int maxIndex; + MatrixXf::Index maxIndex; float maxNorm = mat.colwise().sum().maxCoeff(&maxIndex); std::cout << "Maximum sum at position " << maxIndex << std::endl; |