#ifndef HPC_ULMBLAS_IAMAX_H #define HPC_ULMBLAS_IAMAX_H 1 #include <cmath> namespace hpc { namespace ulmblas { template <typename Index, typename TX> Index iamax(Index n, const TX *x, Index incX) { Index i0=0; for (Index i=1; i<n; ++i) { if (std::abs(x[i*incX])>std::abs(x[i0*incX])) { i0 = i; } } return i0; } } } // namespace ulmblas, hpc #endif // HPC_ULMBLAS_IAMAX_H |