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

Merge branch 'fix/test_3d2pfvadaptive' into 'master'

Improve harmonic mean to have less divisions

See merge request !1038
parents 80fa3924 f9545d71
No related branches found
No related tags found
1 merge request!1038Improve harmonic mean to have less divisions
...@@ -69,7 +69,7 @@ constexpr Scalar harmonicMean(Scalar x, Scalar y, Scalar wx = 1.0, Scalar wy = 1 ...@@ -69,7 +69,7 @@ constexpr Scalar harmonicMean(Scalar x, Scalar y, Scalar wx = 1.0, Scalar wy = 1
if (x*y <= 0) if (x*y <= 0)
return 0; return 0;
return (wx + wy) / (wx / x + wy / y); return (wx + wy) * x * y / (wy * x + wx * y);
} }
/*! /*!
......
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