mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-12 14:25:16 +08:00
reimplement abs2 not to use std::norm which is incredibly slow.
This commit is contained in:
parent
45a6bb34c3
commit
fb3aa7220f
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user