* apps/mesh-segm-skel/mesh-complex-max-curv-extrema.cc, * apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc, * apps/mesh-segm-skel/mesh-complex-pinv-curv-segm.cc, * apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc: Here. --- milena/ChangeLog | 10 ++++++++++ milena/apps/mesh-segm-skel/mesh-complex-max-curv-extrema.cc | 4 ---- milena/apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc | 1 - milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-segm.cc | 8 +++----- milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc | 9 ++++----- 5 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog index 58df7ec..82beada 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,15 @@ 2013-08-29 Roland Levillain roland@lrde.epita.fr
+ Fix the use of Pi in Milena's apps/mesh-segm-skel. + + * apps/mesh-segm-skel/mesh-complex-max-curv-extrema.cc, + * apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc, + * apps/mesh-segm-skel/mesh-complex-pinv-curv-segm.cc, + * apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc: + Here. + +2013-08-29 Roland Levillain roland@lrde.epita.fr + Fix header inclusions in Milena's apps/mesh-segm-skel.
* apps/mesh-segm-skel/mesh-complex-max-curv-1-collapse.cc, diff --git a/milena/apps/mesh-segm-skel/mesh-complex-max-curv-extrema.cc b/milena/apps/mesh-segm-skel/mesh-complex-max-curv-extrema.cc index e17c477..b57b9aa 100644 --- a/milena/apps/mesh-segm-skel/mesh-complex-max-curv-extrema.cc +++ b/milena/apps/mesh-segm-skel/mesh-complex-max-curv-extrema.cc @@ -65,10 +65,6 @@ #include "misc.hh"
-// Doesn't C++ have a better way to express Pi? -static const float pi = 4 * atanf(1); - - int main(int argc, char* argv[]) { if (argc != 3) diff --git a/milena/apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc b/milena/apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc index 2c879ff..080de26 100644 --- a/milena/apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc +++ b/milena/apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc @@ -43,7 +43,6 @@ #include <mln/morpho/closing/area.hh> #include <mln/morpho/watershed/flooding.hh>
-#include <mln/math/pi.hh> #include <mln/math/max.hh> #include <mln/math/sqr.hh>
diff --git a/milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-segm.cc b/milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-segm.cc index ced95a0..97b731c 100644 --- a/milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-segm.cc +++ b/milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-segm.cc @@ -45,6 +45,7 @@ #include <mln/morpho/closing/area.hh> #include <mln/morpho/meyer_wst.hh>
+#include <mln/math/pi.hh> #include <mln/math/max.hh> #include <mln/math/sqr.hh>
@@ -56,10 +57,6 @@ #include "misc.hh"
-// Doesn't C++ have a better way to express Pi? -static const float pi = 4 * atanf(1); - - int main(int argc, char* argv[]) { if (argc != 4) @@ -96,7 +93,8 @@ int main(int argc, char* argv[]) { float h = (curv.first(v) + curv.second(v)) / 2; // Pseudo-inverse curvature. - float h_inv = 1 / pi * (atan(-h) + pi / 2); + float h_inv = + 1 / float(mln::math::pi) * (atanf(-h) + float(mln::math::pi) / 2); float_ima(v) = h_inv; }
diff --git a/milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc b/milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc index d9e6ae4..f020794 100644 --- a/milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc +++ b/milena/apps/mesh-segm-skel/mesh-complex-pinv-curv-skel.cc @@ -54,6 +54,8 @@ #include <mln/topo/detach_cell.hh> #include <mln/topo/skeleton/breadth_first_thinning.hh>
+#include <mln/math/pi.hh> + #include <mln/util/timer.hh>
#include <mln/io/off/load.hh> @@ -64,10 +66,6 @@ #include "misc.hh"
-// Doesn't C++ have a better way to express Pi? -static const float pi = 4 * atanf(1); - - int main(int argc, char* argv[]) { @@ -110,7 +108,8 @@ main(int argc, char* argv[]) { float h = (curv.first(v) + curv.second(v)) / 2; // Pseudo-inverse curvature. - float h_inv = 1 / pi * (atan(-h) + pi / 2); + float h_inv = + 1 / float(mln::math::pi) * (atanf(-h) + float(mln::math::pi) / 2); float_ima(v) = h_inv; }