
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena ChangeLog: 2009-06-11 Edwin Carlinet <carlinet@lrde.epita.fr> Move count, sum accus to math directory. * mln/accu/count.hh, * mln/accu/sum.hh: Move to... * mln/accu/math, * mln/accu/math/count.hh, * mln/accu/math/sum.hh: Move accus in math directory. * mln/accu/all.hh, * mln/accu/essential.hh, * mln/accu/math/all.hh, * mln/accu/math/essential.hh: Update all.hh, and essential.hh respecting the new location. * tests/accu/count.cc: Move to... * tests/accu/math, * tests/accu/math/count.cc: Move accus tests in math directory. * tests/accu/Makefile.am, * tests/accu/math/Makefile.am: Update accus Makefiles. * doc/examples/tuto3/first_routine.cc: * mln/accu/site_set/rectangularity.hh, * mln/accu/stat/deviation.hh, * mln/accu/stat/mean.hh, * mln/estim/sum.hh, * mln/labeling/fill_holes.hh, * mln/registration/icp.hh, * sandbox/edwin/tree/tree.cc, * sandbox/fabien/igr/dist_edges.cc, * sandbox/fabien/igr/filter.cc, * sandbox/fabien/igr/fixed_seg/main.cc, * sandbox/fabien/igr/igr.cc, * sandbox/fabien/igr/matlab.cc, * sandbox/fabien/igr/mean_median_label.cc, * sandbox/fabien/igr/seg_vol_irm.hh, * sandbox/fabien/igr/smooth_fixed_seg/main.cc, * sandbox/fabien/igr/time_max.cc, * sandbox/fabien/igr/time_max_norm.cc, * sandbox/fabien/igr/wst_edges.cc, * sandbox/fabien/level.cc, * sandbox/folio/test/histo/project_histo_add.cc, * sandbox/folio/test/histo/project_screen.cc, * sandbox/folio/test/histo/projected3d.cc, * sandbox/fred/old/mean.hh, * sandbox/garrigues/area_filter_auto_dual.cc, * sandbox/garrigues/union_find/canvas/reconstruction_on_function.hh, * sandbox/garrigues/union_find/canvas/reconstruction_on_set.hh, * sandbox/garrigues/union_find/canvas/self_dual_reconstruction.hh, * sandbox/icdar/2009/hsc/clean_input.hh, * sandbox/jardonnet/n_cmpt/fused_filter.cc, * sandbox/jardonnet/n_cmpt/n_cmpt.hh, * sandbox/jardonnet/n_cmpt/ref_filter.cc, * sandbox/laurent/ismm2009.cc, * sandbox/laurent/memo/ismm2009.v0.cc, * sandbox/laurent/memo/ismm2009.v1.cc, * sandbox/laurent/memo/ismm2009.v2.cc, * sandbox/laurent/playing_with_attributes.cc, * sandbox/lazzara/igr/igr-biggest-comp.cc, * sandbox/lazzara/igr/igr-cloud.cc, * sandbox/lazzara/igr/igr.cc, * sandbox/lazzara/igr/irm_seg_with_mm_and_rag.mine.cc, * sandbox/nivault/extract_character.cc, * sandbox/nivault/extract_score.cc, * sandbox/theo/color/filter_blen_rgb_edges.cc, * sandbox/theo/color/segment_gl_pixels.cc, * sandbox/theo/color/segment_rgb_edges.cc, * sandbox/theo/esiee/laurent/ismm09/main.cc, * sandbox/theo/esiee/laurent/ismm09/trash.hh, * sandbox/theo/experimental/projected_histo.cc, * sandbox/theo/publis/icip2009/compute_a.cc, * sandbox/theo/test_attribute.cc, * sandbox/theo/tufa_2008/filter_n.cc, * sandbox/theo/tufa_2008/n_cmpt.cc, * sandbox/theo/tufa_2008/steps.0.cc, * sandbox/theo/tufa_2008/steps.1.cc, * sandbox/theo/tufa_2008/steps.2.cc, * sandbox/theo/tufa_2008/steps.2b.cc, * sandbox/theo/tufa_2008/steps.3.cc, * tests/accu/all_accus.cc, * tests/accu/compute.cc, * tests/accu/image/init.cc, * tests/accu/image/set_value.cc, * tests/accu/image/take.cc, * tests/accu/image/take_as_init.cc, * tests/accu/image/take_n_times.cc, * tests/accu/image/to_result.cc, * tests/accu/image/untake.cc, * tests/accu/transform.cc, * tests/accu/transform_diagonal.cc, * tests/accu/transform_directional.cc, * tests/accu/transform_line.cc, * tests/accu/transform_snake.cc, * tests/accu/tuple.cc, * tests/labeling/compute.cc, * tests/labeling/n_max.cc, * tests/labeling/value.cc, * tests/morpho/closing/algebraic.cc, * tests/morpho/opening/algebraic.cc, * tests/set/compute.cc: Replace accu::accu_name by accu::math::accu_name, accu::meta::accu_name by accu::meta::math::accu_name, accu/accu_name.hh by accu/math/accu_name.hh. --- doc/examples/tuto3/first_routine.cc | 6 mln/accu/all.hh | 2 mln/accu/essential.hh | 2 mln/accu/math/all.hh | 58 ++ mln/accu/math/count.hh | 221 +++++++++ mln/accu/math/essential.hh | 36 + mln/accu/math/sum.hh | 226 ++++++++++ mln/accu/site_set/rectangularity.hh | 8 mln/accu/stat/deviation.hh | 12 mln/accu/stat/mean.hh | 8 mln/estim/sum.hh | 6 mln/labeling/fill_holes.hh | 4 mln/registration/icp.hh | 4 sandbox/edwin/tree/tree.cc | 4 sandbox/fabien/igr/dist_edges.cc | 4 sandbox/fabien/igr/filter.cc | 6 sandbox/fabien/igr/fixed_seg/main.cc | 6 sandbox/fabien/igr/igr.cc | 4 sandbox/fabien/igr/matlab.cc | 8 sandbox/fabien/igr/mean_median_label.cc | 2 sandbox/fabien/igr/seg_vol_irm.hh | 10 sandbox/fabien/igr/smooth_fixed_seg/main.cc | 4 sandbox/fabien/igr/time_max.cc | 4 sandbox/fabien/igr/time_max_norm.cc | 4 sandbox/fabien/igr/wst_edges.cc | 2 sandbox/fabien/level.cc | 4 sandbox/folio/test/histo/project_histo_add.cc | 6 sandbox/folio/test/histo/project_screen.cc | 6 sandbox/folio/test/histo/projected3d.cc | 6 sandbox/fred/old/mean.hh | 4 sandbox/garrigues/area_filter_auto_dual.cc | 4 sandbox/garrigues/union_find/canvas/reconstruction_on_function.hh | 2 sandbox/garrigues/union_find/canvas/reconstruction_on_set.hh | 2 sandbox/garrigues/union_find/canvas/self_dual_reconstruction.hh | 2 sandbox/icdar/2009/hsc/clean_input.hh | 4 sandbox/jardonnet/n_cmpt/fused_filter.cc | 4 sandbox/jardonnet/n_cmpt/n_cmpt.hh | 4 sandbox/jardonnet/n_cmpt/ref_filter.cc | 4 sandbox/laurent/ismm2009.cc | 4 sandbox/laurent/memo/ismm2009.v0.cc | 4 sandbox/laurent/memo/ismm2009.v1.cc | 4 sandbox/laurent/memo/ismm2009.v2.cc | 4 sandbox/laurent/playing_with_attributes.cc | 4 sandbox/lazzara/igr/igr-biggest-comp.cc | 4 sandbox/lazzara/igr/igr-cloud.cc | 2 sandbox/lazzara/igr/igr.cc | 2 sandbox/lazzara/igr/irm_seg_with_mm_and_rag.mine.cc | 2 sandbox/nivault/extract_character.cc | 2 sandbox/nivault/extract_score.cc | 2 sandbox/theo/color/filter_blen_rgb_edges.cc | 2 sandbox/theo/color/segment_gl_pixels.cc | 2 sandbox/theo/color/segment_rgb_edges.cc | 4 sandbox/theo/esiee/laurent/ismm09/main.cc | 2 sandbox/theo/esiee/laurent/ismm09/trash.hh | 2 sandbox/theo/experimental/projected_histo.cc | 4 sandbox/theo/publis/icip2009/compute_a.cc | 6 sandbox/theo/test_attribute.cc | 6 sandbox/theo/tufa_2008/filter_n.cc | 4 sandbox/theo/tufa_2008/n_cmpt.cc | 4 sandbox/theo/tufa_2008/steps.0.cc | 4 sandbox/theo/tufa_2008/steps.1.cc | 4 sandbox/theo/tufa_2008/steps.2.cc | 4 sandbox/theo/tufa_2008/steps.2b.cc | 4 sandbox/theo/tufa_2008/steps.3.cc | 4 tests/accu/Makefile.am | 5 tests/accu/all_accus.cc | 4 tests/accu/compute.cc | 4 tests/accu/image/init.cc | 4 tests/accu/image/set_value.cc | 4 tests/accu/image/take.cc | 4 tests/accu/image/take_as_init.cc | 4 tests/accu/image/take_n_times.cc | 4 tests/accu/image/to_result.cc | 4 tests/accu/image/untake.cc | 4 tests/accu/math/Makefile.am | 27 + tests/accu/math/count.cc | 61 ++ tests/accu/transform.cc | 6 tests/accu/transform_diagonal.cc | 6 tests/accu/transform_directional.cc | 4 tests/accu/transform_line.cc | 4 tests/accu/transform_snake.cc | 4 tests/accu/tuple.cc | 4 tests/labeling/compute.cc | 12 tests/labeling/n_max.cc | 4 tests/labeling/value.cc | 4 tests/morpho/closing/algebraic.cc | 2 tests/morpho/opening/algebraic.cc | 2 tests/set/compute.cc | 4 88 files changed, 802 insertions(+), 176 deletions(-) Index: trunk/milena/mln/accu/sum.hh (deleted) =================================================================== Index: trunk/milena/mln/accu/count.hh (deleted) =================================================================== Index: trunk/milena/mln/accu/site_set/rectangularity.hh =================================================================== --- trunk/milena/mln/accu/site_set/rectangularity.hh (revision 4098) +++ trunk/milena/mln/accu/site_set/rectangularity.hh (revision 4099) @@ -32,7 +32,7 @@ # include <mln/accu/internal/couple.hh> # include <mln/accu/bbox.hh> -# include <mln/accu/count.hh> +# include <mln/accu/math/count.hh> namespace mln { @@ -50,7 +50,7 @@ template <typename P> class rectangularity : public accu::internal::couple<accu::bbox<P>, - accu::count<P>, + accu::math::count<P>, float, rectangularity<P> > { @@ -58,12 +58,12 @@ public: typedef accu::internal::couple<accu::bbox<P>, - accu::count<P>, + accu::math::count<P>, float, rectangularity<P> > super_; typedef accu::bbox<P> A1; - typedef accu::count<P> A2; + typedef accu::math::count<P> A2; typedef float result; Index: trunk/milena/mln/accu/math/sum.hh =================================================================== --- trunk/milena/mln/accu/math/sum.hh (revision 0) +++ trunk/milena/mln/accu/math/sum.hh (revision 4099) @@ -0,0 +1,226 @@ +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// +// This file is part of Olena. +// +// Olena is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation, version 2 of the License. +// +// Olena is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Olena. If not, see <http://www.gnu.org/licenses/>. +// +// As a special exception, you may use this file as part of a free +// software project without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to produce +// an executable, this file does not by itself cause the resulting +// executable to be covered by the GNU General Public License. This +// exception does not however invalidate any other reasons why the +// executable file might be covered by the GNU General Public License. + +#ifndef MLN_ACCU_MATH_SUM_HH +# define MLN_ACCU_MATH_SUM_HH + +/// \file +/// +/// Define an accumulator that computes a sum. + +# include <mln/core/concept/meta_accumulator.hh> +# include <mln/accu/internal/base.hh> + +# include <mln/util/pix.hh> // To prevent accu::math::sum to work on pixels (ambiguous). + +# include <mln/trait/value_.hh> // For mln_sum. +# include <mln/value/builtin/all.hh> // In the case of summing builtin values. +# include <mln/literal/zero.hh> // For initialization. + + +namespace mln +{ + + namespace accu + { + + namespace math + { + + // Forward declaration. + template <typename T, typename S> + struct sum; + + } // end of namespace mln::accu::math + + namespace meta + { + + namespace math + { + + /// Meta accumulator for sum. + struct sum : public Meta_Accumulator< sum > + { + template <typename T, typename S = mln_sum(T)> + struct with + { + typedef accu::math::sum<T, S> ret; + }; + }; + + } // end of namespace mln::accu::meta::math + + } // end of namespace mln::accu::meta + + } // end of namespace mln::accu + + // Traits. + namespace trait + { + + template <typename T, typename S> + struct accumulator_< accu::math::sum<T,S> > + { + typedef accumulator::has_untake::yes has_untake; + typedef accumulator::has_set_value::yes has_set_value; + typedef accumulator::has_stop::no has_stop; + typedef accumulator::when_pix::not_ok when_pix; + }; + + } // end of namespace mln::trait + + + namespace accu + { + + namespace math + { + + /// \brief Generic sum accumulator class. + /// + /// Parameter \c T is the type of values that we sum. Parameter \c + /// S is the type to store the value sum; the default type of + /// \c S is the summation type (property) of \c T. + /// + /// \ingroup modaccuvalues + // + template <typename T, typename S = mln_sum(T)> + struct sum : public mln::accu::internal::base< const S&, sum<T,S> > + { + typedef T argument; + + sum(); + + /// Manipulators. + /// \{ + void init(); + void take(const argument& t); + void take_as_init_(const argument& t); + void take(const sum<T,S>& other); + + void untake(const argument& t); + void set_value(const S& s); + /// \} + + /// Get the value of the accumulator. + const S& to_result() const; + + /// Check whether this accu is able to return a result. + /// Always true here. + bool is_valid() const; + + protected: + + S s_; + }; + + + template <typename I, typename S> + struct sum< util::pix<I>, S >; + + +# ifndef MLN_INCLUDE_ONLY + + + + template <typename T, typename S> + inline + sum<T,S>::sum() + { + init(); + } + + template <typename T, typename S> + inline + void + sum<T,S>::init() + { + s_ = literal::zero; + } + + template <typename T, typename S> + inline + void sum<T,S>::take(const argument& t) + { + s_ += static_cast<S>(t); + } + + template <typename T, typename S> + inline + void sum<T,S>::untake(const argument& t) + { + s_ -= static_cast<S>(t); + } + + template <typename T, typename S> + inline + void sum<T,S>::take_as_init_(const argument& t) + { + s_ = static_cast<S>(t); + } + + template <typename T, typename S> + inline + void + sum<T,S>::take(const sum<T,S>& other) + { + s_ += other.s_; + } + + template <typename T, typename S> + inline + const S& + sum<T,S>::to_result() const + { + return s_; + } + + template <typename T, typename S> + inline + void + sum<T,S>::set_value(const S& s) + { + s_ = s; + } + + template <typename T, typename S> + inline + bool + sum<T,S>::is_valid() const + { + return true; + } + +# endif // ! MLN_INCLUDE_ONLY + + } // end of namespace mln::accu::math + + } // end of namespace mln::accu + +} // end of namespace mln + + +#endif // ! MLN_ACCU_MATH_SUM_HH Property changes on: trunk/milena/mln/accu/math/sum.hh ___________________________________________________________________ Added: svn:mergeinfo Index: trunk/milena/mln/accu/math/essential.hh =================================================================== --- trunk/milena/mln/accu/math/essential.hh (revision 0) +++ trunk/milena/mln/accu/math/essential.hh (revision 4099) @@ -0,0 +1,36 @@ +// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// +// This file is part of Olena. +// +// Olena is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation, version 2 of the License. +// +// Olena is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Olena. If not, see <http://www.gnu.org/licenses/>. +// +// As a special exception, you may use this file as part of a free +// software project without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to produce +// an executable, this file does not by itself cause the resulting +// executable to be covered by the GNU General Public License. This +// exception does not however invalidate any other reasons why the +// executable file might be covered by the GNU General Public License. + +#ifndef MLN_ACCU_MATH_ESSENTIAL_HH +# define MLN_ACCU_MATH_ESSENTIAL_HH + +/// \file +/// +/// File that includes the most useful mathematic accumulator types. + +# include <mln/accu/math/count.hh> +# include <mln/accu/math/sum.hh> + +#endif // ! MLN_ACCU_MATH_ESSENTIAL_HH Property changes on: trunk/milena/mln/accu/math/essential.hh ___________________________________________________________________ Added: svn:mergeinfo Index: trunk/milena/mln/accu/math/all.hh =================================================================== --- trunk/milena/mln/accu/math/all.hh (revision 0) +++ trunk/milena/mln/accu/math/all.hh (revision 4099) @@ -0,0 +1,58 @@ +// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// +// This file is part of Olena. +// +// Olena is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation, version 2 of the License. +// +// Olena is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Olena. If not, see <http://www.gnu.org/licenses/>. +// +// As a special exception, you may use this file as part of a free +// software project without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to produce +// an executable, this file does not by itself cause the resulting +// executable to be covered by the GNU General Public License. This +// exception does not however invalidate any other reasons why the +// executable file might be covered by the GNU General Public License. + +#ifndef MLN_ACCU_MATH_ALL_HH +# define MLN_ACCU_MATH_ALL_HH + +/// \file +/// +/// File that includes all mathematic accumulator types. + + +namespace mln +{ + + namespace accu + { + + namespace meta + { + + /// Namespace of mathematic meta-accumulators. + namespace math {} + + } // end of namespace mln::accu::meta + + /// Namespace of mathematic accumulators. + namespace math {} + + } // end of namespace mln::accu + +} // end of namespace mln + +# include <mln/accu/math/sum.hh> +# include <mln/accu/math/count.hh> + +#endif // ! MLN_ACCU_MATH_ALL_HH Index: trunk/milena/mln/accu/math/count.hh =================================================================== --- trunk/milena/mln/accu/math/count.hh (revision 0) +++ trunk/milena/mln/accu/math/count.hh (revision 4099) @@ -0,0 +1,221 @@ +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// +// This file is part of Olena. +// +// Olena is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation, version 2 of the License. +// +// Olena is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Olena. If not, see <http://www.gnu.org/licenses/>. +// +// As a special exception, you may use this file as part of a free +// software project without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to produce +// an executable, this file does not by itself cause the resulting +// executable to be covered by the GNU General Public License. This +// exception does not however invalidate any other reasons why the +// executable file might be covered by the GNU General Public License. + +#ifndef MLN_ACCU_MATH_COUNT_HH +# define MLN_ACCU_MATH_COUNT_HH + +/// \file +/// +/// Define an accumulator that counts. + +# include <mln/accu/internal/base.hh> +# include <mln/core/concept/meta_accumulator.hh> + + +namespace mln +{ + + namespace accu + { + + namespace math + { + + // Forward declaration. + template <typename T> + struct count; + + } // end of namespace mln::accu::math + + + namespace meta + { + + namespace math + { + + /// Meta accumulator for count. + struct count : public Meta_Accumulator< count > + { + template <typename T> + struct with + { + typedef accu::math::count<T> ret; + }; + }; + + } // end of namespace mln::accu::meta::math + + } // end of namespace mln::accu::meta + + } // end of namespace mln::accu + + // Traits. + namespace trait + { + + template <typename T> + struct accumulator_< accu::math::count<T> > + { + typedef accumulator::has_untake::yes has_untake; + typedef accumulator::has_set_value::yes has_set_value; + typedef accumulator::has_stop::no has_stop; + typedef accumulator::when_pix::use_pix when_pix; + }; + + } // end of namespace mln::trait + + + namespace accu + { + + namespace math + { + + /// \brief Generic counter accumulator. + /// The parameter \a T is the type to be count. + /// + /// \ingroup modaccusiteset + // + template <typename T> + struct count : public mln::accu::internal::base< unsigned , count<T> > + { + typedef T argument; + + count(); + + /// Manipulators. + /// \{ + void init(); + void take(const argument&); + void take(const count<T>& other); + + void untake(const argument&); + void untake(const count<T>& other); + + /// Force the value of the counter to \a c. + void set_value(unsigned c); + /// \} + + /// Get the value of the accumulator. + unsigned to_result() const; + + /// Check whether this accu is able to return a result. + /// Always true here. + bool is_valid() const; + + protected: + /// The value of the counter. + unsigned count_; + }; + + +# ifndef MLN_INCLUDE_ONLY + + + + template <typename T> + inline + count<T>::count() + { + init(); + } + + template <typename T> + inline + void + count<T>::init() + { + count_ = 0; + } + + template <typename T> + inline + void + count<T>::take(const argument&) + { + ++count_; + } + + template <typename T> + inline + void + count<T>::untake(const argument&) + { + mln_precondition(count_ > 0); + --count_; + } + + template <typename T> + inline + void + count<T>::take(const count<T>& other) + { + count_ += other.count_; + } + + template <typename T> + inline + void + count<T>::untake(const count<T>& other) + { + mln_precondition(other.count_ <= count_); + count_ -= other.count_; + } + + template <typename T> + inline + unsigned + count<T>::to_result() const + { + return count_; + } + + template <typename T> + inline + void + count<T>::set_value(unsigned c) + { + count_ = c; + } + + template <typename T> + inline + bool + count<T>::is_valid() const + { + return true; + } + +# endif // ! MLN_INCLUDE_ONLY + + } // end of namespace mln::accu::math + + } // end of namespace mln::accu + +} // end of namespace mln + + +#endif // ! MLN_ACCU_MATH_COUNT_HH Property changes on: trunk/milena/mln/accu/math/count.hh ___________________________________________________________________ Added: svn:mergeinfo Index: trunk/milena/mln/accu/all.hh =================================================================== --- trunk/milena/mln/accu/all.hh (revision 4098) +++ trunk/milena/mln/accu/all.hh (revision 4099) @@ -54,7 +54,6 @@ # include <mln/accu/bbox.hh> -# include <mln/accu/count.hh> # include <mln/accu/count_labels.hh> # include <mln/accu/center.hh> // << # include <mln/accu/count_adjacent_vertices.hh> >> @@ -66,7 +65,6 @@ # include <mln/accu/pair.hh> # include <mln/accu/rank.hh> # include <mln/accu/rms.hh> -# include <mln/accu/sum.hh> // << # include <mln/accu/tuple.hh> >> # include <mln/accu/volume.hh> Index: trunk/milena/mln/accu/essential.hh =================================================================== --- trunk/milena/mln/accu/essential.hh (revision 4098) +++ trunk/milena/mln/accu/essential.hh (revision 4099) @@ -32,10 +32,8 @@ # include <mln/accu/bbox.hh> # include <mln/accu/center.hh> -# include <mln/accu/count.hh> # include <mln/accu/histo.hh> # include <mln/accu/rank.hh> -# include <mln/accu/sum.hh> # include <mln/accu/stat/essential.hh> # include <mln/accu/image/essential.hh> Index: trunk/milena/mln/accu/stat/deviation.hh =================================================================== --- trunk/milena/mln/accu/stat/deviation.hh (revision 4098) +++ trunk/milena/mln/accu/stat/deviation.hh (revision 4099) @@ -31,8 +31,8 @@ /// Define an accumulator that computes a standard deviation. # include <mln/accu/internal/base.hh> -# include <mln/accu/count.hh> -# include <mln/accu/sum.hh> +# include <mln/accu/math/count.hh> +# include <mln/accu/math/sum.hh> # include <mln/math/sqr.hh> # include <mln/math/sqrt.hh> @@ -83,8 +83,8 @@ protected: - accu::count<T> count_; - accu::sum<T,S> sum_; + accu::math::count<T> count_; + accu::math::sum<T,S> sum_; T mean_; }; @@ -136,7 +136,7 @@ void deviation<T,S,M>::take(const argument& t) { count_.take(t); - sum_.take(math::sqr(t - mean_)); + sum_.take(mln::math::sqr(t - mean_)); } template <typename T, typename S, typename M> @@ -157,7 +157,7 @@ unsigned n = count_.to_result(); if (n == 0u) return M(); // Safety. - return static_cast<M>(math::sqrt(sum_.to_result() / n)); + return static_cast<M>(mln::math::sqrt(sum_.to_result() / n)); } template <typename T, typename S, typename M> Index: trunk/milena/mln/accu/stat/mean.hh =================================================================== --- trunk/milena/mln/accu/stat/mean.hh (revision 4098) +++ trunk/milena/mln/accu/stat/mean.hh (revision 4099) @@ -33,8 +33,8 @@ /// \todo Use accu::pair just like in accu::stat::min_max. # include <mln/accu/internal/base.hh> -# include <mln/accu/count.hh> -# include <mln/accu/sum.hh> +# include <mln/accu/math/count.hh> +# include <mln/accu/math/sum.hh> namespace mln @@ -114,8 +114,8 @@ protected: - accu::count<T> count_; - accu::sum<T,S> sum_; + accu::math::count<T> count_; + accu::math::sum<T,S> sum_; }; Index: trunk/milena/mln/estim/sum.hh =================================================================== --- trunk/milena/mln/estim/sum.hh (revision 4098) +++ trunk/milena/mln/estim/sum.hh (revision 4099) @@ -32,7 +32,7 @@ /// /// \todo Sum works on level so move into mln/level; otherwise on pix then ambiguous. -# include <mln/accu/sum.hh> +# include <mln/accu/math/sum.hh> # include <mln/data/compute.hh> @@ -67,7 +67,7 @@ mln_sum(mln_value(I)) sum(const Image<I>& input) { mln_precondition(exact(input).is_valid()); - return data::compute(accu::meta::sum(), input); + return data::compute(accu::meta::math::sum(), input); } template <typename I, typename S> @@ -75,7 +75,7 @@ void sum(const Image<I>& input, S& result) { mln_precondition(exact(input).is_valid()); - accu::sum<mln_value(I), S> a; + accu::math::sum<mln_value(I), S> a; result = data::compute(a, input); } Index: trunk/milena/mln/registration/icp.hh =================================================================== --- trunk/milena/mln/registration/icp.hh (revision 4098) +++ trunk/milena/mln/registration/icp.hh (revision 4099) @@ -64,7 +64,7 @@ # include <mln/debug/histo.hh> # include <mln/accu/histo.hh> -# include <mln/accu/sum.hh> +# include <mln/accu/math/sum.hh> # include <mln/value/int_u16.hh> @@ -378,7 +378,7 @@ float sd; { - accu::sum<float> s, s2; + accu::math::sum<float> s, s2; for_all(p) { vec3d_f Pk_i = pair.first.rotate(p.to_vec()) + pair.second; Index: trunk/milena/mln/labeling/fill_holes.hh =================================================================== --- trunk/milena/mln/labeling/fill_holes.hh (revision 4098) +++ trunk/milena/mln/labeling/fill_holes.hh (revision 4099) @@ -34,7 +34,7 @@ # include <mln/labeling/compute.hh> # include <mln/core/image/dmorph/image_if.hh> -# include <mln/accu/count.hh> +# include <mln/accu/math/count.hh> namespace mln @@ -83,7 +83,7 @@ mln_ch_value(I, L) lbls = labeling::background(input, nbh, nlabels); - accu::count<mln_value(I)> a_; + accu::math::count<mln_value(I)> a_; util::array<unsigned> arr = labeling::compute(a_, input, lbls, nlabels); unsigned bg_count = 0; Index: trunk/milena/sandbox/fred/old/mean.hh =================================================================== --- trunk/milena/sandbox/fred/old/mean.hh (revision 4098) +++ trunk/milena/sandbox/fred/old/mean.hh (revision 4099) @@ -70,7 +70,7 @@ namespace internal { template <typename T, typename S> - struct sum_set_value : public mln::accu::sum<T, S> + struct sum_set_value : public mln::accu::math::sum<T, S> { void set_value(const S& s); }; @@ -108,7 +108,7 @@ protected: - accu::count<value> count_; + accu::math::count<value> count_; internal::sum_set_value<value,result> sum_; }; Index: trunk/milena/sandbox/nivault/extract_score.cc =================================================================== --- trunk/milena/sandbox/nivault/extract_score.cc (revision 4098) +++ trunk/milena/sandbox/nivault/extract_score.cc (revision 4099) @@ -55,7 +55,7 @@ # include <mln/accu/stat/mean.hh> # include <mln/accu/bbox.hh> # include <mln/accu/p.hh> -# include <mln/accu/count.hh> +# include <mln/accu/math/count.hh> # include <mln/value/scalar.hh> # include <mln/make/voronoi.hh> Index: trunk/milena/sandbox/nivault/extract_character.cc =================================================================== --- trunk/milena/sandbox/nivault/extract_character.cc (revision 4098) +++ trunk/milena/sandbox/nivault/extract_character.cc (revision 4099) @@ -53,7 +53,7 @@ # include <mln/accu/stat/mean.hh> # include <mln/accu/bbox.hh> # include <mln/accu/p.hh> -# include <mln/accu/count.hh> +# include <mln/accu/math/count.hh> # include <mln/value/scalar.hh> # include <mln/make/voronoi.hh> Index: trunk/milena/sandbox/icdar/2009/hsc/clean_input.hh =================================================================== --- trunk/milena/sandbox/icdar/2009/hsc/clean_input.hh (revision 4098) +++ trunk/milena/sandbox/icdar/2009/hsc/clean_input.hh (revision 4099) @@ -4,7 +4,7 @@ #include <mln/labeling/background.hh> #include <mln/labeling/compute.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/bbox.hh> #include <mln/fun/i2v/array.hh> @@ -22,7 +22,7 @@ typedef value::label_16 L; L nlabels; image2d<L> lab = labeling::background(input, c8(), nlabels); - util::array<unsigned> count = labeling::compute(accu::count<point2d>(), lab, nlabels); + util::array<unsigned> count = labeling::compute(accu::math::count<point2d>(), lab, nlabels); util::array<box2d> box = labeling::compute(accu::bbox<point2d>(), lab, nlabels); fun::i2v::array<bool> ok(nlabels.next(), false); // default is text Index: trunk/milena/sandbox/jardonnet/n_cmpt/fused_filter.cc =================================================================== --- trunk/milena/sandbox/jardonnet/n_cmpt/fused_filter.cc (revision 4098) +++ trunk/milena/sandbox/jardonnet/n_cmpt/fused_filter.cc (revision 4099) @@ -8,7 +8,7 @@ #include <mln/core/alias/neighb2d.hh> #include <mln/morpho/tree/data.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/util/set.hh> #include <mln/labeling/regional_minima.hh> @@ -243,7 +243,7 @@ // We get a min-tree so that we can perform morphological closings. morpho::tree::data<I,S> t(f, s, c4()); - accu::count< util::pix<I> > attr; + accu::math::count< util::pix<I> > attr; image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t); Index: trunk/milena/sandbox/jardonnet/n_cmpt/ref_filter.cc =================================================================== --- trunk/milena/sandbox/jardonnet/n_cmpt/ref_filter.cc (revision 4098) +++ trunk/milena/sandbox/jardonnet/n_cmpt/ref_filter.cc (revision 4099) @@ -8,7 +8,7 @@ #include <mln/core/alias/neighb2d.hh> #include <mln/morpho/tree/data.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/util/set.hh> #include <mln/labeling/regional_minima.hh> @@ -216,7 +216,7 @@ // We get a min-tree so that we can perform morphological closings. morpho::tree::data<I,S> t(f, s, c4()); - accu::count< util::pix<I> > attr; + accu::math::count< util::pix<I> > attr; image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t); Index: trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt.hh =================================================================== --- trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt.hh (revision 4098) +++ trunk/milena/sandbox/jardonnet/n_cmpt/n_cmpt.hh (revision 4099) @@ -33,7 +33,7 @@ # include <mln/data/fill.hh> # include <mln/util/pix.hh> # include <mln/data/sort_psites.hh> -# include <mln/accu/count.hh> +# include <mln/accu/math/count.hh> # include <mln/accu/volume.hh> namespace mln @@ -76,7 +76,7 @@ typedef mln_psite(I) P; typedef accu::volume<I> A; - //typedef accu::count<unsigned> A; + //typedef accu::math::count<unsigned> A; typedef mln_psite(I) P; typedef p_array<P> S; Index: trunk/milena/sandbox/fabien/igr/mean_median_label.cc =================================================================== --- trunk/milena/sandbox/fabien/igr/mean_median_label.cc (revision 4098) +++ trunk/milena/sandbox/fabien/igr/mean_median_label.cc (revision 4099) @@ -20,7 +20,7 @@ #include <mln/value/label_16.hh> #include <mln/value/rgb8.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/stat/mean.hh> #include <mln/accu/image/all.hh> #include <mln/accu/stat/deviation.hh> Index: trunk/milena/sandbox/fabien/igr/time_max_norm.cc =================================================================== --- trunk/milena/sandbox/fabien/igr/time_max_norm.cc (revision 4098) +++ trunk/milena/sandbox/fabien/igr/time_max_norm.cc (revision 4099) @@ -13,9 +13,9 @@ #include <mln/io/dump/load.hh> #include <mln/io/pgm/save.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/stat/mean.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/image/all.hh> #include <mln/arith/minus.hh> Index: trunk/milena/sandbox/fabien/igr/smooth_fixed_seg/main.cc =================================================================== --- trunk/milena/sandbox/fabien/igr/smooth_fixed_seg/main.cc (revision 4098) +++ trunk/milena/sandbox/fabien/igr/smooth_fixed_seg/main.cc (revision 4099) @@ -19,7 +19,7 @@ #include <mln/value/int_u12.hh> #include <mln/value/label_16.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/stat/mean.hh> #include <mln/accu/image/all.hh> #include <mln/data/fill.hh> @@ -106,7 +106,7 @@ { float res = 0.f; - accu::sum<V> accu_sum; + accu::math::sum<V> accu_sum; image1d<V> tmp_ima; convert::from_to(v1, tmp_ima); Index: trunk/milena/sandbox/fabien/igr/time_max.cc =================================================================== --- trunk/milena/sandbox/fabien/igr/time_max.cc (revision 4098) +++ trunk/milena/sandbox/fabien/igr/time_max.cc (revision 4099) @@ -11,9 +11,9 @@ #include <mln/io/dicom/load.hh> #include <mln/io/magick/save.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/stat/mean.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/image/all.hh> #include <mln/arith/minus.hh> Index: trunk/milena/sandbox/fabien/igr/seg_vol_irm.hh =================================================================== --- trunk/milena/sandbox/fabien/igr/seg_vol_irm.hh (revision 4098) +++ trunk/milena/sandbox/fabien/igr/seg_vol_irm.hh (revision 4099) @@ -72,10 +72,10 @@ #include <mln/fun/v2b/threshold.hh> #include <mln/data/transform.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/center.hh> #include <mln/accu/stat/max.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/stat/mean.hh> #include <mln/accu/stat/deviation.hh> @@ -234,13 +234,13 @@ /*label_16 nlabels = 0; mln_ch_value(I, label_16) bg_labels = labeling::foreground(ima_bg, nbh, nlabels); - accu::count<int_u8> ab_; + accu::math::count<int_u8> ab_; util::array<unsigned> arr_b_label = labeling::compute(ab_, ima_bg, bg_labels, nlabels); util::array<label_16> arr_b_big = labeling::n_max<label_16>(arr_b_label, 1); data::fill((ima_bg | (pw::value(bg_labels) != pw::cst(arr_b_big[1]))).rw(), false); mln_ch_value(I, label_16) obj_labels = labeling::foreground(ima_obj, nbh, nlabels); - accu::count<int_u8> ao_; + accu::math::count<int_u8> ao_; util::array<unsigned> arr_o_label = labeling::compute(ao_, ima_obj, obj_labels, nlabels); util::array<label_16> arr_o_big = labeling::n_max<label_16>(arr_o_label, 1); data::fill((ima_obj | (pw::value(obj_labels) != pw::cst(arr_o_big[1]))).rw(), false);*/ @@ -265,7 +265,7 @@ histo::array<mln_value(I)> bg_histo = histo::compute(input | pw::value(ima_bg) == true); histo::array<mln_value(I)> obj_histo = histo::compute(input | pw::value(ima_obj) == true); - accu::sum<unsigned> sum_accu; + accu::math::sum<unsigned> sum_accu; image1d<unsigned> ima_bg_histo; convert::from_to(bg_histo, ima_bg_histo); ima_bg_histo(point1d(0)) = 0; Index: trunk/milena/sandbox/fabien/igr/wst_edges.cc =================================================================== --- trunk/milena/sandbox/fabien/igr/wst_edges.cc (revision 4098) +++ trunk/milena/sandbox/fabien/igr/wst_edges.cc (revision 4099) @@ -20,7 +20,7 @@ #include <mln/value/label_16.hh> #include <mln/value/rgb8.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/stat/mean.hh> #include <mln/accu/image/all.hh> #include <mln/accu/stat/deviation.hh> Index: trunk/milena/sandbox/fabien/igr/matlab.cc =================================================================== --- trunk/milena/sandbox/fabien/igr/matlab.cc (revision 4098) +++ trunk/milena/sandbox/fabien/igr/matlab.cc (revision 4099) @@ -9,9 +9,9 @@ #include <mln/io/dicom/load.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/stat/mean.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/image/all.hh> #include <mln/arith/minus.hh> #include <mln/arith/all.hh> @@ -80,7 +80,7 @@ // Mesure bruit de fond pour seuiller // calculé sur la première image image2d<bool> roi_noise; // FIXME: init this ROI, should be a domain - accu::count<bool> accu_nbrpix1; + accu::math::count<bool> accu_nbrpix1; unsigned nbrpix1 = data::compute(accu_nbrpix1, roi_noise); image2d<float> datasli = arr_ima[0]; @@ -186,7 +186,7 @@ std::cout << "kk = " << kk << std::endl; - image2d<accu::sum<float> > accu_sum; + image2d<accu::math::sum<float> > accu_sum; accu::image::init(accu_sum); for (int k = 0; k < dim3; ++k) accu::image::take(accu_sum, arr_smooth[k]); Index: trunk/milena/sandbox/fabien/igr/fixed_seg/main.cc =================================================================== --- trunk/milena/sandbox/fabien/igr/fixed_seg/main.cc (revision 4098) +++ trunk/milena/sandbox/fabien/igr/fixed_seg/main.cc (revision 4099) @@ -20,7 +20,7 @@ #include <mln/value/label_16.hh> #include <mln/value/rgb8.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/stat/mean.hh> #include <mln/accu/image/all.hh> #include <mln/accu/stat/deviation.hh> @@ -135,7 +135,7 @@ image1d<V> tmp_ima; image1d<V> tmp_ima2; - accu::sum<V> accu_sum; + accu::math::sum<V> accu_sum; convert::from_to(v1, tmp_ima); float sum_v1 = data::compute(accu_sum, tmp_ima); @@ -166,7 +166,7 @@ { float res = 0.f; - accu::sum<V> accu_sum; + accu::math::sum<V> accu_sum; image1d<V> tmp_ima; convert::from_to(v1, tmp_ima); Index: trunk/milena/sandbox/fabien/igr/dist_edges.cc =================================================================== --- trunk/milena/sandbox/fabien/igr/dist_edges.cc (revision 4098) +++ trunk/milena/sandbox/fabien/igr/dist_edges.cc (revision 4099) @@ -17,7 +17,7 @@ #include <mln/value/int_u8.hh> #include <mln/value/int_u12.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/arith/div.hh> #include <mln/convert/from_to.hh> #include <mln/data/compute.hh> @@ -83,7 +83,7 @@ image1d<V> tmp_ima; image1d<V> tmp_ima2; - accu::sum<V> accu_sum; + accu::math::sum<V> accu_sum; convert::from_to(v1, tmp_ima); double sum_v1 = data::compute(accu_sum, tmp_ima); Index: trunk/milena/sandbox/fabien/igr/igr.cc =================================================================== --- trunk/milena/sandbox/fabien/igr/igr.cc (revision 4098) +++ trunk/milena/sandbox/fabien/igr/igr.cc (revision 4099) @@ -62,7 +62,7 @@ #include <mln/fun/v2b/threshold.hh> #include <mln/data/transform.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/center.hh> #include <mln/set/compute.hh> #include <mln/value/label_16.hh> @@ -111,7 +111,7 @@ // Labeling. mln_ch_value(I, L) labels = labeling::flat_zones(threshold, nbh, nlabels); - accu::count<int_u8> a_; + accu::math::count<int_u8> a_; util::array<unsigned> a = labeling::compute(a_, threshold, labels, nlabels); // We keep the third and second biggest object. Index: trunk/milena/sandbox/fabien/igr/filter.cc =================================================================== --- trunk/milena/sandbox/fabien/igr/filter.cc (revision 4098) +++ trunk/milena/sandbox/fabien/igr/filter.cc (revision 4099) @@ -20,7 +20,7 @@ #include <mln/value/label_16.hh> #include <mln/value/rgb8.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/stat/mean.hh> #include <mln/accu/image/all.hh> #include <mln/accu/stat/deviation.hh> @@ -110,7 +110,7 @@ image1d<V> tmp_ima; image1d<V> tmp_ima2; - accu::sum<V> accu_sum; + accu::math::sum<V> accu_sum; convert::from_to(v1, tmp_ima); float sum_v1 = data::compute(accu_sum, tmp_ima); @@ -141,7 +141,7 @@ { float res = 0.f; - accu::sum<V> accu_sum; + accu::math::sum<V> accu_sum; image1d<V> tmp_ima; convert::from_to(v1, tmp_ima); Index: trunk/milena/sandbox/fabien/level.cc =================================================================== --- trunk/milena/sandbox/fabien/level.cc (revision 4098) +++ trunk/milena/sandbox/fabien/level.cc (revision 4099) @@ -35,7 +35,7 @@ #include <mln/value/int_u8.hh> #include <mln/io/pgm/load.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/compute.hh> #include "level.hh" @@ -61,7 +61,7 @@ { image2d<unsigned> labels = labeling::value(lena, l, c4(), n); unsigned npix = - accu::compute(accu::meta::count(), + accu::compute(accu::meta::math::count(), labels | (pw::value(labels) != pw::cst(0u))); npixels += npix; } Index: trunk/milena/sandbox/garrigues/union_find/canvas/reconstruction_on_function.hh =================================================================== --- trunk/milena/sandbox/garrigues/union_find/canvas/reconstruction_on_function.hh (revision 4098) +++ trunk/milena/sandbox/garrigues/union_find/canvas/reconstruction_on_function.hh (revision 4099) @@ -33,7 +33,7 @@ # include <mln/data/fill.hh> # include <mln/literal/zero.hh> # include <mln/convert/to_upper_window.hh> -# include <mln/accu/count.hh> +# include <mln/accu/math/count.hh> # include <mln/util/pix.hh> # include <mln/core/alias/neighb2d.hh> Index: trunk/milena/sandbox/garrigues/union_find/canvas/reconstruction_on_set.hh =================================================================== --- trunk/milena/sandbox/garrigues/union_find/canvas/reconstruction_on_set.hh (revision 4098) +++ trunk/milena/sandbox/garrigues/union_find/canvas/reconstruction_on_set.hh (revision 4099) @@ -33,7 +33,7 @@ # include <mln/data/fill.hh> # include <mln/literal/zero.hh> # include <mln/convert/to_upper_window.hh> -# include <mln/accu/count.hh> +# include <mln/accu/math/count.hh> # include <mln/util/pix.hh> # include <mln/core/alias/neighb2d.hh> Index: trunk/milena/sandbox/garrigues/union_find/canvas/self_dual_reconstruction.hh =================================================================== --- trunk/milena/sandbox/garrigues/union_find/canvas/self_dual_reconstruction.hh (revision 4098) +++ trunk/milena/sandbox/garrigues/union_find/canvas/self_dual_reconstruction.hh (revision 4099) @@ -33,7 +33,7 @@ # include <mln/data/fill.hh> # include <mln/literal/zero.hh> # include <mln/convert/to_upper_window.hh> -# include <mln/accu/count.hh> +# include <mln/accu/math/count.hh> # include <mln/util/pix.hh> # include <mln/core/alias/neighb2d.hh> Index: trunk/milena/sandbox/garrigues/area_filter_auto_dual.cc =================================================================== --- trunk/milena/sandbox/garrigues/area_filter_auto_dual.cc (revision 4098) +++ trunk/milena/sandbox/garrigues/area_filter_auto_dual.cc (revision 4099) @@ -33,7 +33,7 @@ # include <mln/data/fill.hh> # include <mln/literal/zero.hh> # include <mln/convert/to_upper_window.hh> -# include <mln/accu/count.hh> +# include <mln/accu/math/count.hh> # include <mln/util/pix.hh> # include <mln/core/alias/neighb2d.hh> @@ -187,7 +187,7 @@ typedef image2d<bool> I; typedef util::pix<I> pix_t; - typedef accu::count<pix_t> A; + typedef accu::math::count<pix_t> A; typedef mln_psite_(I) P; typedef p_array<P> S; Index: trunk/milena/sandbox/theo/test_attribute.cc =================================================================== --- trunk/milena/sandbox/theo/test_attribute.cc (revision 4098) +++ trunk/milena/sandbox/theo/test_attribute.cc (revision 4099) @@ -45,7 +45,7 @@ #include <mln/morpho/closing_area.hh> #include <mln/morpho/opening_area.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/io/pgm/load.hh> #include <mln/io/pgm/save.hh> #include <mln/io/pbm/save.hh> @@ -84,14 +84,14 @@ { S s = data::sort_psites_increasing(f); morpho::tree::data<I,S> t(f, s, c4()); - accu::count<Px> a; + accu::math::count<Px> a; area_inc = morpho::tree::compute_attribute_image(a, t); debug::println("area_inc =", area_inc); } { S s = data::sort_psites_decreasing(f); morpho::tree::data<I,S> t(f, s, c4()); - accu::count<Px> a; + accu::math::count<Px> a; area_dec = morpho::tree::compute_attribute_image(a, t); debug::println("area_dec =", area_dec); } Index: trunk/milena/sandbox/theo/esiee/laurent/ismm09/trash.hh =================================================================== --- trunk/milena/sandbox/theo/esiee/laurent/ismm09/trash.hh (revision 4098) +++ trunk/milena/sandbox/theo/esiee/laurent/ismm09/trash.hh (revision 4099) @@ -99,7 +99,7 @@ // << std::endl; // } -// // accu::count< util::pix<g_t> > a_; +// // accu::math::count< util::pix<g_t> > a_; // accu::height<g_t> a_; // compute_attribute_extincted(g, cplx2d::e2e(), a_, Index: trunk/milena/sandbox/theo/esiee/laurent/ismm09/main.cc =================================================================== --- trunk/milena/sandbox/theo/esiee/laurent/ismm09/main.cc (revision 4098) +++ trunk/milena/sandbox/theo/esiee/laurent/ismm09/main.cc (revision 4099) @@ -11,7 +11,7 @@ #include <mln/morpho/tree/compute_attribute_image.hh> #include <mln/morpho/attribute/height.hh> #include <mln/labeling/compute.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include "pseudo_tree.hh" #include "cplx2d.hh" Index: trunk/milena/sandbox/theo/experimental/projected_histo.cc =================================================================== --- trunk/milena/sandbox/theo/experimental/projected_histo.cc (revision 4098) +++ trunk/milena/sandbox/theo/experimental/projected_histo.cc (revision 4099) @@ -8,7 +8,7 @@ #include <mln/core/image/dmorph/image_if.hh> #include <mln/pw/value.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/stat/mean.hh> #include <mln/accu/image/init.hh> #include <mln/accu/image/take.hh> @@ -50,7 +50,7 @@ io::pbm::load(pic, "../../../img/fly.pbm"); debug::println(pic); - typedef accu::count<bool> A; + typedef accu::math::count<bool> A; image1d<A> h(pic.ncols()); accu::image::init(h); Index: trunk/milena/sandbox/theo/publis/icip2009/compute_a.cc =================================================================== --- trunk/milena/sandbox/theo/publis/icip2009/compute_a.cc (revision 4098) +++ trunk/milena/sandbox/theo/publis/icip2009/compute_a.cc (revision 4099) @@ -50,7 +50,7 @@ #include <mln/morpho/elementary/gradient.hh> #include <mln/labeling/regional_minima.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/opt/at.hh> #include <mln/set/card.hh> @@ -342,7 +342,7 @@ mln_invariant((nchildren | t.domain()) == nc_ref); - accu::count< util::pix<I> > fixme_; + accu::math::count< util::pix<I> > fixme_; mln_ch_value(I, mln_result(A)) a_ref; a_ref = morpho::tree::compute_attribute_image(fixme_, t); mln_assertion(a == a_ref); @@ -557,7 +557,7 @@ debug::println("f (gradient)", f); - typedef accu::count<point2d> A; + typedef accu::math::count<point2d> A; typedef mln_result_(A) L; A area; Index: trunk/milena/sandbox/theo/tufa_2008/steps.0.cc =================================================================== --- trunk/milena/sandbox/theo/tufa_2008/steps.0.cc (revision 4098) +++ trunk/milena/sandbox/theo/tufa_2008/steps.0.cc (revision 4099) @@ -37,7 +37,7 @@ #include <mln/core/alias/neighb2d.hh> #include <mln/morpho/tree/data.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/morpho/tree/compute_attribute_image.hh> #include <mln/morpho/closing_area.hh> @@ -154,7 +154,7 @@ // We get a min-tree so that we can perform morphological closings. morpho::tree::data<I,S> t(f, s, c4()); - accu::count< util::pix<I> > attr; + accu::math::count< util::pix<I> > attr; image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t); I g = filtering(f, a, c4(), 10); Index: trunk/milena/sandbox/theo/tufa_2008/steps.1.cc =================================================================== --- trunk/milena/sandbox/theo/tufa_2008/steps.1.cc (revision 4098) +++ trunk/milena/sandbox/theo/tufa_2008/steps.1.cc (revision 4099) @@ -37,7 +37,7 @@ #include <mln/core/alias/neighb2d.hh> #include <mln/morpho/tree/data.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/util/set.hh> #include <mln/labeling/regional_minima.hh> @@ -258,7 +258,7 @@ // We get a min-tree so that we can perform morphological closings. morpho::tree::data<I,S> t(f, s, c4()); - accu::count< util::pix<I> > attr; + accu::math::count< util::pix<I> > attr; image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t); run_run(f, a, c4()); Index: trunk/milena/sandbox/theo/tufa_2008/steps.2.cc =================================================================== --- trunk/milena/sandbox/theo/tufa_2008/steps.2.cc (revision 4098) +++ trunk/milena/sandbox/theo/tufa_2008/steps.2.cc (revision 4099) @@ -37,7 +37,7 @@ #include <mln/core/alias/neighb2d.hh> #include <mln/morpho/tree/data.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/util/set.hh> #include <mln/labeling/regional_minima.hh> @@ -233,7 +233,7 @@ // We get a min-tree so that we can perform morphological closings. morpho::tree::data<I,S> t(f, s, c4()); - accu::count< util::pix<I> > attr; + accu::math::count< util::pix<I> > attr; image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t); Index: trunk/milena/sandbox/theo/tufa_2008/steps.3.cc =================================================================== --- trunk/milena/sandbox/theo/tufa_2008/steps.3.cc (revision 4098) +++ trunk/milena/sandbox/theo/tufa_2008/steps.3.cc (revision 4099) @@ -37,7 +37,7 @@ #include <mln/core/alias/neighb2d.hh> #include <mln/morpho/tree/data.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/util/set.hh> #include <mln/labeling/regional_minima.hh> @@ -178,7 +178,7 @@ // We get a min-tree so that we can perform morphological closings. morpho::tree::data<I,S> t(f, s, c4()); - accu::count< util::pix<I> > attr; + accu::math::count< util::pix<I> > attr; image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t); run_run(f, a, c4()); Index: trunk/milena/sandbox/theo/tufa_2008/steps.2b.cc =================================================================== --- trunk/milena/sandbox/theo/tufa_2008/steps.2b.cc (revision 4098) +++ trunk/milena/sandbox/theo/tufa_2008/steps.2b.cc (revision 4099) @@ -37,7 +37,7 @@ #include <mln/core/alias/neighb2d.hh> #include <mln/morpho/tree/data.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <set> #include <mln/labeling/regional_minima.hh> @@ -177,7 +177,7 @@ // We get a min-tree so that we can perform morphological closings. morpho::tree::data<I,S> t(f, s, c4()); - accu::count< util::pix<I> > attr; + accu::math::count< util::pix<I> > attr; image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t); run_run(f, a, c4()); Index: trunk/milena/sandbox/theo/tufa_2008/filter_n.cc =================================================================== --- trunk/milena/sandbox/theo/tufa_2008/filter_n.cc (revision 4098) +++ trunk/milena/sandbox/theo/tufa_2008/filter_n.cc (revision 4099) @@ -39,7 +39,7 @@ #include <mln/core/alias/neighb2d.hh> #include <mln/morpho/tree/data.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/util/set.hh> #include <mln/labeling/regional_minima.hh> @@ -335,7 +335,7 @@ typedef morpho::tree::data<I,S> tree_t; tree_t t(f, s, nbh); - accu::count< util::pix<I> > attr; + accu::math::count< util::pix<I> > attr; I g = get_attribute_image(attr, t, nbh, n, echo); io::pgm::save(g, argv[3]); } Index: trunk/milena/sandbox/theo/tufa_2008/n_cmpt.cc =================================================================== --- trunk/milena/sandbox/theo/tufa_2008/n_cmpt.cc (revision 4098) +++ trunk/milena/sandbox/theo/tufa_2008/n_cmpt.cc (revision 4099) @@ -42,7 +42,7 @@ #include <mln/morpho/tree/compute_attribute_image.hh> #include <mln/accu/volume.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> namespace mln @@ -255,7 +255,7 @@ unsigned n = std::atoi(argv[2]); - accu::count< util::pix<I> > acc; + accu::math::count< util::pix<I> > acc; // accu::volume<I> acc; image2d<int_u8> g = n_cmpt(acc, f, c4(), n + 1); Index: trunk/milena/sandbox/theo/color/segment_rgb_edges.cc =================================================================== --- trunk/milena/sandbox/theo/color/segment_rgb_edges.cc (revision 4098) +++ trunk/milena/sandbox/theo/color/segment_rgb_edges.cc (revision 4099) @@ -22,7 +22,7 @@ #include <mln/morpho/meyer_wst.hh> #include <mln/labeling/compute.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/volume.hh> #include <mln/accu/stat/mean.hh> @@ -283,7 +283,7 @@ typedef f_t I; - // accu::count< util::pix<I> > a_; + // accu::math::count< util::pix<I> > a_; // accu::volume<I> a_; // accu::sum_pix< util::pix<I> > a_; Index: trunk/milena/sandbox/theo/color/filter_blen_rgb_edges.cc =================================================================== --- trunk/milena/sandbox/theo/color/filter_blen_rgb_edges.cc (revision 4098) +++ trunk/milena/sandbox/theo/color/filter_blen_rgb_edges.cc (revision 4099) @@ -25,7 +25,7 @@ #include <mln/morpho/watershed/flooding.hh> #include <mln/labeling/compute.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/volume.hh> #include <mln/accu/stat/mean.hh> Index: trunk/milena/sandbox/theo/color/segment_gl_pixels.cc =================================================================== --- trunk/milena/sandbox/theo/color/segment_gl_pixels.cc (revision 4098) +++ trunk/milena/sandbox/theo/color/segment_gl_pixels.cc (revision 4099) @@ -86,7 +86,7 @@ - // accu::count< util::pix<I> > a_; + // accu::math::count< util::pix<I> > a_; // accu::sum_pix< util::pix<I> > a_; // accu::volume<I> a_; accu::height<I> a_; Index: trunk/milena/sandbox/lazzara/igr/irm_seg_with_mm_and_rag.mine.cc =================================================================== --- trunk/milena/sandbox/lazzara/igr/irm_seg_with_mm_and_rag.mine.cc (revision 4098) +++ trunk/milena/sandbox/lazzara/igr/irm_seg_with_mm_and_rag.mine.cc (revision 4099) @@ -176,7 +176,7 @@ value::label_16 nlabels; mln_ch_value(I, value::label_16) lbl = labeling::background(ima, c4(), nlabels); - mln_VAR(lbl_count, labeling::compute(accu::meta::count(), ima, lbl, nlabels)); + mln_VAR(lbl_count, labeling::compute(accu::meta::math::count(), ima, lbl, nlabels)); unsigned max_id = 1; for (unsigned i = 2; i <= nlabels; ++i) Index: trunk/milena/sandbox/lazzara/igr/igr-biggest-comp.cc =================================================================== --- trunk/milena/sandbox/lazzara/igr/igr-biggest-comp.cc (revision 4098) +++ trunk/milena/sandbox/lazzara/igr/igr-biggest-comp.cc (revision 4099) @@ -53,7 +53,7 @@ value::label_16 nlabels; mln_ch_value(I, value::label_16) lbl = labeling::background(ima, c4(), nlabels); - mln_VAR(lbl_count, labeling::compute(accu::meta::count(), ima, lbl, nlabels)); + mln_VAR(lbl_count, labeling::compute(accu::meta::math::count(), ima, lbl, nlabels)); unsigned max_id = 1; for (unsigned i = 2; i <= nlabels; ++i) @@ -92,7 +92,7 @@ value::label_16 nlabels; mln_ch_value(I, value::label_16) labels = labeling::flat_zones(in, c8(), nlabels); - util::array<unsigned> arr = labeling::compute(accu::meta::count(), + util::array<unsigned> arr = labeling::compute(accu::meta::math::count(), in, labels, nlabels); unsigned big_second_count = 0; Index: trunk/milena/sandbox/lazzara/igr/igr.cc =================================================================== --- trunk/milena/sandbox/lazzara/igr/igr.cc (revision 4098) +++ trunk/milena/sandbox/lazzara/igr/igr.cc (revision 4099) @@ -86,7 +86,7 @@ value::label_16 nlabels; mln_ch_value(I, value::label_16) lbl = labeling::background(ima, c4(), nlabels); - mln_VAR(lbl_count, labeling::compute(accu::meta::count(), ima, lbl, nlabels)); + mln_VAR(lbl_count, labeling::compute(accu::meta::math::count(), ima, lbl, nlabels)); unsigned max_id = 1; for (unsigned i = 2; i <= nlabels; ++i) Index: trunk/milena/sandbox/lazzara/igr/igr-cloud.cc =================================================================== --- trunk/milena/sandbox/lazzara/igr/igr-cloud.cc (revision 4098) +++ trunk/milena/sandbox/lazzara/igr/igr-cloud.cc (revision 4099) @@ -33,7 +33,7 @@ #include <mln/core/image/dmorph/extension_fun.hh> #include <mln/accu/histo.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/debug/histo.hh> #include <mln/io/cloud/load.hh> Index: trunk/milena/sandbox/edwin/tree/tree.cc =================================================================== --- trunk/milena/sandbox/edwin/tree/tree.cc (revision 4098) +++ trunk/milena/sandbox/edwin/tree/tree.cc (revision 4099) @@ -22,7 +22,7 @@ // to check: #include <mln/labeling/blobs.hh> #include <mln/labeling/compute.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/debug/println.hh> #include <../../theo/color/change_attributes.hh> //----------------- @@ -285,7 +285,7 @@ - //filtercheck(*f, accu::meta::count()); + //filtercheck(*f, accu::meta::math::count()); io::pbm::save(f->img(), "out.pbm"); Index: trunk/milena/sandbox/folio/test/histo/project_histo_add.cc =================================================================== --- trunk/milena/sandbox/folio/test/histo/project_histo_add.cc (revision 4098) +++ trunk/milena/sandbox/folio/test/histo/project_histo_add.cc (revision 4099) @@ -21,9 +21,9 @@ #include "../../mln/histo/compute_histo_rgb.hh" #include "../../mln/histo/classify_with_histo_rgb.hh" -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/stat/mean.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/image/init.hh> #include <mln/accu/image/take.hh> #include <mln/accu/image/to_result.hh> @@ -97,7 +97,7 @@ std::cout << " => computing histogram..." << std::endl; image3d<unsigned> histo = histo::compute_histo_rgb<unsigned>(ima); - image2d<unsigned> proj = project_histo<accu::sum<unsigned, unsigned>, 2>(histo); + image2d<unsigned> proj = project_histo<accu::math::sum<unsigned, unsigned>, 2>(histo); image2d<value::int_u8> proj_int = data::stretch( value::int_u8(), data::transform( proj, take_log() ) ); Index: trunk/milena/sandbox/folio/test/histo/project_screen.cc =================================================================== --- trunk/milena/sandbox/folio/test/histo/project_screen.cc (revision 4098) +++ trunk/milena/sandbox/folio/test/histo/project_screen.cc (revision 4099) @@ -21,9 +21,9 @@ #include "../../mln/histo/compute_histo_rgb.hh" #include "../../mln/histo/classify_with_histo_rgb.hh" -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/stat/mean.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/image/init.hh> #include <mln/accu/image/take.hh> #include <mln/accu/image/to_result.hh> @@ -76,7 +76,7 @@ save_proj_histo(image3d<unsigned> histo, char* name) { std::cout << " => save..." << std::endl; - image2d<unsigned> proj = project_histo<accu::sum<unsigned, unsigned>, 2>(histo); + image2d<unsigned> proj = project_histo<accu::math::sum<unsigned, unsigned>, 2>(histo); image2d<value::int_u8> proj_int = data::stretch( value::int_u8(), data::transform( proj, take_log() ) ); Index: trunk/milena/sandbox/folio/test/histo/projected3d.cc =================================================================== --- trunk/milena/sandbox/folio/test/histo/projected3d.cc (revision 4098) +++ trunk/milena/sandbox/folio/test/histo/projected3d.cc (revision 4099) @@ -21,9 +21,9 @@ #include "../../mln/histo/compute_histo_rgb.hh" #include "../../mln/histo/classify_with_histo_rgb.hh" -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/stat/mean.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/image/init.hh> #include <mln/accu/image/take.hh> #include <mln/accu/image/to_result.hh> @@ -97,7 +97,7 @@ std::cout << " => computing histogram..." << std::endl; image3d<unsigned> histo = histo::compute_histo_rgb<unsigned>(ima); - // image2d<unsigned> proj = project_histo<accu::sum<unsigned, unsigned>, 2>(histo); + // image2d<unsigned> proj = project_histo<accu::math::sum<unsigned, unsigned>, 2>(histo); // image2d<value::int_u8> proj_int = data::stretch( value::int_u8(), // data::transform( proj, // take_log() ) ); Index: trunk/milena/sandbox/laurent/ismm2009.cc =================================================================== --- trunk/milena/sandbox/laurent/ismm2009.cc (revision 4098) +++ trunk/milena/sandbox/laurent/ismm2009.cc (revision 4099) @@ -19,7 +19,7 @@ #include <mln/data/stretch.hh> #include <mln/labeling/compute.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/height.hh> #include <mln/util/timer.hh> @@ -550,7 +550,7 @@ } typedef unsigned A; - util::array<A> a = labeling::compute(accu::meta::count(), + util::array<A> a = labeling::compute(accu::meta::math::count(), g, wst_g, n_basins); Index: trunk/milena/sandbox/laurent/playing_with_attributes.cc =================================================================== --- trunk/milena/sandbox/laurent/playing_with_attributes.cc (revision 4098) +++ trunk/milena/sandbox/laurent/playing_with_attributes.cc (revision 4099) @@ -17,7 +17,7 @@ #include <mln/data/sort_psites.hh> #include <mln/geom/nsites.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> @@ -325,7 +325,7 @@ typedef morpho::tree::data<I,S> tree_t; tree_t t(g, s, nbh); - accu::count< util::pix<I> > a_; // Kind of attribute. + accu::math::count< util::pix<I> > a_; // Kind of attribute. mln_ch_value(I,unsigned) a = morpho::tree::compute_attribute_image(a_, t); debug::println("a | nodes:", a | t.nodes()); Index: trunk/milena/sandbox/laurent/memo/ismm2009.v0.cc =================================================================== --- trunk/milena/sandbox/laurent/memo/ismm2009.v0.cc (revision 4098) +++ trunk/milena/sandbox/laurent/memo/ismm2009.v0.cc (revision 4099) @@ -22,7 +22,7 @@ #include <mln/labeling/regional_minima.hh> #include <mln/labeling/compute.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/morpho/gradient.hh> #include <mln/morpho/meyer_wst.hh> @@ -446,7 +446,7 @@ // Compute an attribute per region. typedef unsigned A; - util::array<A> a = labeling::compute(accu::meta::count(), + util::array<A> a = labeling::compute(accu::meta::math::count(), g, wst_g, n_basins); Index: trunk/milena/sandbox/laurent/memo/ismm2009.v1.cc =================================================================== --- trunk/milena/sandbox/laurent/memo/ismm2009.v1.cc (revision 4098) +++ trunk/milena/sandbox/laurent/memo/ismm2009.v1.cc (revision 4099) @@ -14,7 +14,7 @@ # include <mln/core/site_set/p_priority.hh> #include <mln/labeling/compute.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> @@ -323,7 +323,7 @@ // -------------------------------- typedef unsigned A; - util::array<A> a = labeling::compute(accu::meta::count(), + util::array<A> a = labeling::compute(accu::meta::math::count(), g, wst_g, n_basins); Index: trunk/milena/sandbox/laurent/memo/ismm2009.v2.cc =================================================================== --- trunk/milena/sandbox/laurent/memo/ismm2009.v2.cc (revision 4098) +++ trunk/milena/sandbox/laurent/memo/ismm2009.v2.cc (revision 4099) @@ -17,7 +17,7 @@ # include <mln/core/site_set/p_priority.hh> #include <mln/labeling/compute.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/util/timer.hh> @@ -496,7 +496,7 @@ // -------------------------------- typedef unsigned A; - util::array<A> a = labeling::compute(accu::meta::count(), + util::array<A> a = labeling::compute(accu::meta::math::count(), g, wst_g, n_basins); Index: trunk/milena/tests/accu/count.cc (deleted) =================================================================== Index: trunk/milena/tests/accu/transform_snake.cc =================================================================== --- trunk/milena/tests/accu/transform_snake.cc (revision 4098) +++ trunk/milena/tests/accu/transform_snake.cc (revision 4099) @@ -25,7 +25,7 @@ #include <mln/core/image/image2d.hh> #include <mln/accu/transform_snake.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/win/rectangle2d.hh> #include <mln/pw/all.hh> #include <mln/data/compare.hh> @@ -38,6 +38,6 @@ image2d<int> ima(4, 5); win::rectangle2d rec(3, 3); - image2d<unsigned> out = accu::transform_snake(accu::meta::count(), ima, rec); + image2d<unsigned> out = accu::transform_snake(accu::meta::math::count(), ima, rec); mln_assertion(out == (pw::cst(rec.size()) | ima.domain())); } Index: trunk/milena/tests/accu/image/to_result.cc =================================================================== --- trunk/milena/tests/accu/image/to_result.cc (revision 4098) +++ trunk/milena/tests/accu/image/to_result.cc (revision 4099) @@ -24,7 +24,7 @@ // executable file might be covered by the GNU General Public License. #include <mln/core/image/image2d.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/image/init.hh> #include <mln/accu/image/to_result.hh> @@ -37,7 +37,7 @@ { using namespace mln; - typedef accu::count<int> A; + typedef accu::math::count<int> A; image2d<A> ima(2, 2); accu::image::init(ima); Index: trunk/milena/tests/accu/image/take_n_times.cc =================================================================== --- trunk/milena/tests/accu/image/take_n_times.cc (revision 4098) +++ trunk/milena/tests/accu/image/take_n_times.cc (revision 4099) @@ -29,7 +29,7 @@ #include <mln/pw/cst.hh> #include <mln/pw/image.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/image/init.hh> #include <mln/accu/image/take_n_times.hh> @@ -38,7 +38,7 @@ { using namespace mln; - typedef accu::sum<int,int> A; + typedef accu::math::sum<int,int> A; image2d<A> ima(2, 2); accu::image::init(ima); Index: trunk/milena/tests/accu/image/init.cc =================================================================== --- trunk/milena/tests/accu/image/init.cc (revision 4098) +++ trunk/milena/tests/accu/image/init.cc (revision 4099) @@ -28,7 +28,7 @@ #include <mln/pw/cst.hh> #include <mln/pw/image.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/image/init.hh> @@ -36,7 +36,7 @@ { using namespace mln; - typedef accu::count<int> A; + typedef accu::math::count<int> A; image2d<A> ima(2, 2); accu::image::init(ima); Index: trunk/milena/tests/accu/image/take.cc =================================================================== --- trunk/milena/tests/accu/image/take.cc (revision 4098) +++ trunk/milena/tests/accu/image/take.cc (revision 4099) @@ -29,7 +29,7 @@ #include <mln/pw/cst.hh> #include <mln/pw/image.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/image/init.hh> #include <mln/accu/image/take.hh> @@ -38,7 +38,7 @@ { using namespace mln; - typedef accu::sum<int,int> A; + typedef accu::math::sum<int,int> A; image2d<A> ima(2, 2); accu::image::init(ima); Index: trunk/milena/tests/accu/image/set_value.cc =================================================================== --- trunk/milena/tests/accu/image/set_value.cc (revision 4098) +++ trunk/milena/tests/accu/image/set_value.cc (revision 4099) @@ -24,7 +24,7 @@ // executable file might be covered by the GNU General Public License. #include <mln/core/image/image2d.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/image/set_value.hh> #include <mln/data/compare.hh> @@ -36,7 +36,7 @@ { using namespace mln; - typedef accu::count<int> A; + typedef accu::math::count<int> A; image2d<A> ima(2, 2); accu::image::set_value(ima, 3); Index: trunk/milena/tests/accu/image/untake.cc =================================================================== --- trunk/milena/tests/accu/image/untake.cc (revision 4098) +++ trunk/milena/tests/accu/image/untake.cc (revision 4099) @@ -29,7 +29,7 @@ #include <mln/pw/cst.hh> #include <mln/pw/image.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/image/take_as_init.hh> #include <mln/accu/image/untake.hh> @@ -38,7 +38,7 @@ { using namespace mln; - typedef accu::sum<int,int> A; + typedef accu::math::sum<int,int> A; image2d<A> ima(2, 2); accu::image::take_as_init(ima, 60); Index: trunk/milena/tests/accu/image/take_as_init.cc =================================================================== --- trunk/milena/tests/accu/image/take_as_init.cc (revision 4098) +++ trunk/milena/tests/accu/image/take_as_init.cc (revision 4099) @@ -28,7 +28,7 @@ #include <mln/pw/cst.hh> #include <mln/pw/image.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/sum.hh> #include <mln/accu/image/take_as_init.hh> @@ -36,7 +36,7 @@ { using namespace mln; - typedef accu::sum<int,int> A; + typedef accu::math::sum<int,int> A; image2d<A> ima(2, 2); accu::image::take_as_init(ima, 3); Index: trunk/milena/tests/accu/math/Makefile.am =================================================================== --- trunk/milena/tests/accu/math/Makefile.am (revision 0) +++ trunk/milena/tests/accu/math/Makefile.am (revision 4099) @@ -0,0 +1,27 @@ +# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE). +# +# This file is part of Olena. +# +# Olena is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, version 2 of the License. +# +# Olena is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Olena. If not, see <http://www.gnu.org/licenses/>. +# + +## Process this file through Automake to create Makefile.in. + +include $(top_srcdir)/milena/tests/tests.mk + +check_PROGRAMS = \ + count + +count_SOURCES = count.cc + +TESTS = $(check_PROGRAMS) Property changes on: trunk/milena/tests/accu/math/Makefile.am ___________________________________________________________________ Added: svn:mergeinfo Index: trunk/milena/tests/accu/math/count.cc =================================================================== --- trunk/milena/tests/accu/math/count.cc (revision 0) +++ trunk/milena/tests/accu/math/count.cc (revision 4099) @@ -0,0 +1,61 @@ +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// +// This file is part of Olena. +// +// Olena is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation, version 2 of the License. +// +// Olena is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Olena. If not, see <http://www.gnu.org/licenses/>. +// +// As a special exception, you may use this file as part of a free +// software project without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to produce +// an executable, this file does not by itself cause the resulting +// executable to be covered by the GNU General Public License. This +// exception does not however invalidate any other reasons why the +// executable file might be covered by the GNU General Public License. + +#include <mln/accu/math/count.hh> + + +struct toto {}; + + +int main() +{ + using namespace mln; + + { + // The code below do not compile, as expected :-) + // accu::math::count<int> a; + // a.take_as_init(toto()); + } + { + accu::math::count<int> a; + mln_assertion(a.to_result() == 0); + } + { + accu::math::count<int> a; + for (int i = 0; i < 200; i++) + a.take(i); + mln_assertion(a.to_result() == 200); + } + { + accu::math::count<int> a, a_; + a.take_as_init(1); + mln_assertion(a == 1u); + a.take(2); + mln_assertion(a == 2u); + + a_.take_as_init(a); + mln_assertion(a_ == 2u); + } +} Property changes on: trunk/milena/tests/accu/math/count.cc ___________________________________________________________________ Added: svn:mergeinfo Index: trunk/milena/tests/accu/transform_diagonal.cc =================================================================== --- trunk/milena/tests/accu/transform_diagonal.cc (revision 4098) +++ trunk/milena/tests/accu/transform_diagonal.cc (revision 4099) @@ -25,7 +25,7 @@ #include <mln/core/image/image2d.hh> #include <mln/accu/transform_diagonal.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/pw/all.hh> #include <mln/data/compare.hh> @@ -38,13 +38,13 @@ { win::diag2d w(3); - image2d<unsigned> out = accu::transform_diagonal(accu::meta::count(), ima, w); + image2d<unsigned> out = accu::transform_diagonal(accu::meta::math::count(), ima, w); mln_assertion(out == (pw::cst(w.size()) | ima.domain())); } { win::backdiag2d w(3); - image2d<unsigned> out = accu::transform_diagonal(accu::meta::count(), ima, w); + image2d<unsigned> out = accu::transform_diagonal(accu::meta::math::count(), ima, w); mln_assertion(out == (pw::cst(w.size()) | ima.domain())); } Index: trunk/milena/tests/accu/transform.cc =================================================================== --- trunk/milena/tests/accu/transform.cc (revision 4098) +++ trunk/milena/tests/accu/transform.cc (revision 4099) @@ -26,7 +26,7 @@ #include <mln/core/image/image2d.hh> #include <mln/accu/transform.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/win/rectangle2d.hh> #include <mln/pw/all.hh> @@ -42,14 +42,14 @@ { image2d<unsigned> - out = accu::transform(ima, accu::count<int>(), rec), + out = accu::transform(ima, accu::math::count<int>(), rec), ref(ima.domain()); mln_assertion(out == (pw::cst(rec.size()) | ima.domain())); } { image2d<unsigned> - out = accu::transform(ima, accu::meta::count(), rec), + out = accu::transform(ima, accu::meta::math::count(), rec), ref(ima.domain()); mln_assertion(out == (pw::cst(rec.size()) | ima.domain())); } Index: trunk/milena/tests/accu/compute.cc =================================================================== --- trunk/milena/tests/accu/compute.cc (revision 4098) +++ trunk/milena/tests/accu/compute.cc (revision 4099) @@ -26,7 +26,7 @@ #include <mln/core/image/image2d.hh> #include <mln/value/int_u8.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/compute.hh> @@ -37,6 +37,6 @@ unsigned n = 3; image2d<int_u8> ima(n, n); - unsigned c = accu::compute(accu::meta::count(), ima); + unsigned c = accu::compute(accu::meta::math::count(), ima); mln_assertion(c = n * n); } Index: trunk/milena/tests/accu/transform_line.cc =================================================================== --- trunk/milena/tests/accu/transform_line.cc (revision 4098) +++ trunk/milena/tests/accu/transform_line.cc (revision 4099) @@ -25,7 +25,7 @@ #include <mln/core/image/image2d.hh> #include <mln/accu/transform_line.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/pw/all.hh> #include <mln/data/compare.hh> @@ -38,7 +38,7 @@ unsigned len = 3; for (unsigned dir = 0; dir < 2; ++dir) { - image2d<unsigned> out = accu::transform_line(accu::meta::count(), ima, len, dir); + image2d<unsigned> out = accu::transform_line(accu::meta::math::count(), ima, len, dir); mln_assertion(out == (pw::cst(3u) | ima.domain())); } Index: trunk/milena/tests/accu/Makefile.am =================================================================== --- trunk/milena/tests/accu/Makefile.am (revision 4098) +++ trunk/milena/tests/accu/Makefile.am (revision 4099) @@ -22,13 +22,13 @@ SUBDIRS = \ image \ site_set \ - stat + stat \ + math check_PROGRAMS = \ all_accus \ bbox \ compute \ - count \ histo \ line \ max_site \ @@ -60,3 +60,4 @@ tuple_SOURCES = tuple.cc TESTS = $(check_PROGRAMS) +# // ACCU_FIXME do not commit Index: trunk/milena/tests/accu/all_accus.cc =================================================================== --- trunk/milena/tests/accu/all_accus.cc (revision 4098) +++ trunk/milena/tests/accu/all_accus.cc (revision 4099) @@ -33,7 +33,7 @@ using namespace mln; accu::bbox<point2d> b; - accu::count<int> c; + accu::math::count<int> c; accu::histo<bool> h; accu::stat::max<int> ma; accu::stat::mean<int> me; @@ -44,5 +44,5 @@ accu::stat::min_max<int> mm; accu::nil<int> n; accu::pair< accu::stat::min<int>, accu::stat::max<int> > p; - accu::sum<int> s; + accu::math::sum<int> s; } Index: trunk/milena/tests/accu/transform_directional.cc =================================================================== --- trunk/milena/tests/accu/transform_directional.cc (revision 4098) +++ trunk/milena/tests/accu/transform_directional.cc (revision 4099) @@ -25,7 +25,7 @@ #include <mln/core/image/image2d.hh> #include <mln/accu/transform_directional.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/win/rectangle2d.hh> #include <mln/pw/all.hh> #include <mln/data/compare.hh> @@ -40,7 +40,7 @@ for (unsigned dir = 0; dir < 2; ++dir) { - image2d<unsigned> out = accu::transform_directional(accu::meta::count(), ima, rec, dir); + image2d<unsigned> out = accu::transform_directional(accu::meta::math::count(), ima, rec, dir); mln_assertion(out == (pw::cst(rec.size()) | ima.domain())); } } Index: trunk/milena/tests/accu/tuple.cc =================================================================== --- trunk/milena/tests/accu/tuple.cc (revision 4098) +++ trunk/milena/tests/accu/tuple.cc (revision 4099) @@ -29,7 +29,7 @@ #include <mln/accu/tuple.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/stat/max.hh> #include <mln/accu/stat/min.hh> #include <mln/accu/stat/mean.hh> @@ -39,7 +39,7 @@ { using namespace mln; - typedef accu::tuple<int, 4, accu::count<int>, accu::stat::max<int>, accu::stat::min<int>, accu::stat::mean<int> > teratuple; + typedef accu::tuple<int, 4, accu::math::count<int>, accu::stat::max<int>, accu::stat::min<int>, accu::stat::mean<int> > teratuple; teratuple tuple1; teratuple tuple2; Index: trunk/milena/tests/set/compute.cc =================================================================== --- trunk/milena/tests/set/compute.cc (revision 4098) +++ trunk/milena/tests/set/compute.cc (revision 4099) @@ -25,7 +25,7 @@ #include <mln/core/site_set/p_set.hh> #include <mln/core/alias/point2d.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/set/compute.hh> @@ -34,5 +34,5 @@ using namespace mln; p_set<point2d> s; - mln_assertion(set::compute(accu::meta::count(), s) == 0); + mln_assertion(set::compute(accu::meta::math::count(), s) == 0); } Index: trunk/milena/tests/morpho/closing/algebraic.cc =================================================================== --- trunk/milena/tests/morpho/closing/algebraic.cc (revision 4098) +++ trunk/milena/tests/morpho/closing/algebraic.cc (revision 4099) @@ -50,7 +50,7 @@ // FIXME: Can't be called with new implementation. (When_pix = not_ok). // { -// accu::count<point2d> a; +// accu::math::count<point2d> a; // io::pgm::save(morpho::closing::algebraic(lena, c4(), a, 10), // "ref.pgm"); // } Index: trunk/milena/tests/morpho/opening/algebraic.cc =================================================================== --- trunk/milena/tests/morpho/opening/algebraic.cc (revision 4098) +++ trunk/milena/tests/morpho/opening/algebraic.cc (revision 4099) @@ -50,7 +50,7 @@ // FIXME: Can't be called with new implementation. (When_pix = not_ok). // { -// accu::count<point2d> a; +// accu::math::count<point2d> a; // io::pgm::save(morpho::opening::algebraic(lena, c4(), a, 10), // "ref.pgm"); // } Index: trunk/milena/tests/labeling/n_max.cc =================================================================== --- trunk/milena/tests/labeling/n_max.cc (revision 4098) +++ trunk/milena/tests/labeling/n_max.cc (revision 4099) @@ -35,7 +35,7 @@ #include <mln/fun/v2b/threshold.hh> #include <mln/data/transform.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/io/pgm/all.hh> @@ -52,7 +52,7 @@ image2d<bool> threshold = data::transform(lena, fun::v2b::threshold<int_u8>(100)); label_8 nlabels; image2d<label_8> labels = labeling::flat_zones(threshold, c4(), nlabels); - accu::count<int_u8> a_; + accu::math::count<int_u8> a_; util::array<unsigned> a = labeling::compute(a_, threshold, labels, nlabels); util::array<label_8> arr_big = labeling::n_max<label_8>(a, 3); Index: trunk/milena/tests/labeling/compute.cc =================================================================== --- trunk/milena/tests/labeling/compute.cc (revision 4098) +++ trunk/milena/tests/labeling/compute.cc (revision 4099) @@ -27,8 +27,8 @@ #include <mln/core/alias/neighb2d.hh> #include <mln/labeling/blobs.hh> #include <mln/labeling/compute.hh> -#include <mln/accu/count.hh> -#include <mln/accu/sum.hh> +#include <mln/accu/math/count.hh> +#include <mln/accu/math/sum.hh> #include <mln/value/int_u8.hh> #include <mln/value/label_8.hh> #include <mln/util/array.hh> @@ -60,27 +60,27 @@ image2d<label_8> lbl = make::image(lblvals); label_8 nlabels = 3; - accu::sum<int_u8> sum; + accu::math::sum<int_u8> sum; util::array<float> sums = labeling::compute(sum, ima, lbl, nlabels); mln_assertion(sums[0] == 0); mln_assertion(sums[1] == 4); mln_assertion(sums[2] == 8); mln_assertion(sums[3] == 12); - sums = labeling::compute(accu::meta::sum(), ima, lbl, nlabels); + sums = labeling::compute(accu::meta::math::sum(), ima, lbl, nlabels); mln_assertion(sums[0] == 0); mln_assertion(sums[1] == 4); mln_assertion(sums[2] == 8); mln_assertion(sums[3] == 12); - accu::count<mln_site_(image2d<int_u8>)> count; + accu::math::count<mln_site_(image2d<int_u8>)> count; util::array<unsigned int> counts = labeling::compute(count, lbl, nlabels); mln_assertion(counts[0] == 18); mln_assertion(counts[1] == 4); mln_assertion(counts[2] == 4); mln_assertion(counts[3] == 4); - counts = labeling::compute(accu::meta::count(), lbl, nlabels); + counts = labeling::compute(accu::meta::math::count(), lbl, nlabels); mln_assertion(counts[0] == 18); mln_assertion(counts[1] == 4); mln_assertion(counts[2] == 4); Index: trunk/milena/tests/labeling/value.cc =================================================================== --- trunk/milena/tests/labeling/value.cc (revision 4098) +++ trunk/milena/tests/labeling/value.cc (revision 4099) @@ -28,7 +28,7 @@ #include <mln/value/int_u8.hh> #include <mln/io/pgm/load.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/accu/compute.hh> #include <mln/labeling/value.hh> #include <mln/data/paste.hh> @@ -53,7 +53,7 @@ { image2d<unsigned> labels = labeling::value(lena, l, c4(), n); unsigned npix = - accu::compute(accu::meta::count(), + accu::compute(accu::meta::math::count(), labels | (pw::value(labels) != pw::cst(0u))); npixels += npix; } Index: trunk/milena/doc/examples/tuto3/first_routine.cc =================================================================== --- trunk/milena/doc/examples/tuto3/first_routine.cc (revision 4098) +++ trunk/milena/doc/examples/tuto3/first_routine.cc (revision 4099) @@ -16,7 +16,7 @@ #include <mln/value/label_8.hh> -#include <mln/accu/count.hh> +#include <mln/accu/math/count.hh> #include <mln/pw/all.hh> @@ -43,7 +43,7 @@ V nlabels; mln_ch_value(I,V) lbl = labeling::blobs(ima, nbh, nlabels); util::array<unsigned> - count = labeling::compute(accu::meta::count(), lbl, nlabels); + count = labeling::compute(accu::meta::math::count(), lbl, nlabels); mln_concrete(I) output; initialize(output, ima); @@ -88,7 +88,7 @@ V nlabels; mln_ch_value(I,V) lbl = labeling::blobs(ima, nbh, nlabels); util::array<unsigned> - count = labeling::compute(accu::meta::count(), lbl, nlabels); + count = labeling::compute(accu::meta::math::count(), lbl, nlabels); // \} // \{