Skip to content
Snippets Groups Projects
Commit d1a86a65 authored by Timo Koch's avatar Timo Koch
Browse files

[md][1d3d] Avoid square root call in kernel evaluation

parent 5c1a8866
No related branches found
No related tags found
1 merge request!2493[md][1d3d] Avoid square root call in kernel evaluation
...@@ -540,9 +540,9 @@ private: ...@@ -540,9 +540,9 @@ private:
// compute distance // compute distance
auto proj = a; proj.axpy(t, ab); auto proj = a; proj.axpy(t, ab);
const auto r = (proj - point).two_norm(); const auto radiusSquared = (proj - point).two_norm2();
if (r > rho) if (radiusSquared > rho*rho)
return 0.0; return 0.0;
return 1.0/(M_PI*rho*rho); return 1.0/(M_PI*rho*rho);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment