From fb3aa7220f10a1ed7f5f41e57260889017974297 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 8 Nov 2011 22:42:51 +0100 Subject: [PATCH] reimplement abs2 not to use std::norm which is incredibly slow. --- Eigen/src/Core/MathFunctions.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 2b454db21..b4a4c8905 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -309,8 +309,7 @@ struct abs2_impl > { static inline RealScalar run(const std::complex& x) { - using std::norm; - return norm(x); + return real(x)*real(x) + imag(x)*imag(x); } };