Skip to content
Snippets Groups Projects
Commit 53e8479d authored by Dennis Gläser's avatar Dennis Gläser
Browse files

Merge branch 'feature/optimize-kernel-evaluation' into 'master'

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

See merge request !2493
parents 5c1a8866 d1a86a65
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