Commit d1a86a65 authored by Timo Koch's avatar Timo Koch
Browse files

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

parent 5c1a8866
......@@ -540,9 +540,9 @@ private:
// compute distance
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 1.0/(M_PI*rho*rho);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment