mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
reimplement abs2 not to use std::norm which is incredibly slow.
This commit is contained in:
@@ -309,8 +309,7 @@ struct abs2_impl<std::complex<RealScalar> >
|
||||
{
|
||||
static inline RealScalar run(const std::complex<RealScalar>& x)
|
||||
{
|
||||
using std::norm;
|
||||
return norm(x);
|
||||
return real(x)*real(x) + imag(x)*imag(x);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user