URL:
https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-06-05 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Move min, max, min_h, max_h, min_max accus in accu/stat.
* mln/accu/max.hh,
* mln/accu/max_h.hh,
* mln/accu/min.hh,
* mln/accu/min_h.hh,
* mln/accu/min_max.hh: Moved to...
* mln/accu/stat/max.hh,
* mln/accu/stat/max_h.hh,
* mln/accu/stat/min.hh,
* mln/accu/stat/min_h.hh,
* mln/accu/stat/min_max.hh: New.
* tests/accu/max.cc,
* tests/accu/max_h.cc,
* tests/accu/min.cc,
* tests/accu/min_h.cc,
* tests/accu/min_max.cc: Moved to...
* tests/accu/stat/max.cc,
* tests/accu/stat/max_h.cc,
* tests/accu/stat/min.cc,
* tests/accu/stat/min_h.cc,
* tests/accu/stat/min_max.cc: New.
* tests/accu/Makefile.am,
* tests/accu/stat/Makefile.am:
Update makefiles respecting stat accus directory.
* apps/statues/mesh-complex-max-curv.cc,
* apps/statues/mesh-max-curv.cc,
* doc/examples/accu-right-instanciation.cc,
* doc/examples/trash/tuto_bis.cc,
* doc/examples/tuto4_genericity_and_algorithms.cc,
* mln/accu/all.hh,
* mln/accu/essential.hh,
* mln/accu/max_site.hh,
* mln/accu/mean.hh,
* mln/accu/stat/all.hh,
* mln/canvas/distance_front.hh,
* mln/core/image/imorph/labeled_image.hh,
* mln/debug/println.spe.hh,
* mln/estim/min_max.hh,
* mln/labeling/colorize.hh,
* mln/morpho/elementary/dilation.hh,
* mln/morpho/elementary/erosion.hh,
* mln/morpho/elementary/gradient.hh,
* mln/morpho/elementary/gradient_external.hh,
* mln/morpho/elementary/gradient_internal.hh,
* mln/morpho/general.spe.hh,
* sandbox/abraham/mln/morpho/basic_najman.hh,
* sandbox/abraham/mln/morpho/najman_wst.hh,
* sandbox/abraham/mln/morpho/vector_median.hh,
* sandbox/abraham/mln/morpho/vmt.hh,
* sandbox/edwin/exec/color_internal_gradient.hh,
* sandbox/edwin/tree/propagation.cc,
* sandbox/fabien/igr/norm.cc,
* sandbox/fabien/igr/seg_vol_irm.hh,
* sandbox/folio/mln/dt/canvas_dt.hh,
* sandbox/folio/mln/dt/dt_old/distance_front_new.hh,
* sandbox/folio/mln/dt/dt_old/naive.cc,
* sandbox/folio/mln/dt/raw_cp_fast.hh,
* sandbox/folio/mln/dt/raw_path_fast.hh,
* sandbox/folio/test/dt/naive.cc,
* sandbox/fred/old/overload.cc,
* sandbox/fred/tests/wip.cc,
* sandbox/garrigues/fllt/fllt.hh,
* sandbox/garrigues/fllt/lower.hh,
* sandbox/garrigues/fllt/upper.hh,
* sandbox/garrigues/level_set.hh,
* sandbox/garrigues/lower.hh,
* sandbox/garrigues/union_find/reconstructions_on_function.hh,
* sandbox/garrigues/union_find/self_dual_reconstruction.hh,
* sandbox/garrigues/upper.hh,
* sandbox/inim/2009/color/min_tree_area_filter.cc,
* sandbox/inim/2009/color/min_tree_color.cc,
* sandbox/inim/2009/color/min_tree_color_v2.cc,
* sandbox/inim/2009/color/min_tree_height_filter.cc,
* sandbox/inim/2009/color/min_tree_volume_filter.cc,
* sandbox/inim/2009/color/reference.cc,
* sandbox/inim/2009/color/reference2.cc,
* sandbox/theo/browsing/fwd.cc,
* sandbox/theo/cs2d/cs2d_morpho.hh,
* sandbox/theo/csi/fred.cc,
* sandbox/theo/dmap.cc,
* sandbox/theo/esiee/laurent/ismm09/pseudo_tree.hh,
* sandbox/theo/esiee/laurent/presentation/classif.cc,
* sandbox/theo/esiee/laurent/presentation/wst2d.cc,
* sandbox/theo/esiee/laurent/presentation/wst_edge.cc,
* sandbox/theo/esiee/slides_2009_may/dilation.hh,
* sandbox/theo/exec/color_internal_gradient.cc,
* tests/accu/all_accus.cc,
* tests/accu/line.cc,
* tests/accu/pair.cc,
* tests/accu/tuple.cc,
* tests/data/compute.cc,
* tests/data/compute_full.cc,
* tests/data/update.cc,
* tests/estim/min_max.cc,
* tests/morpho/closing/area.cc:
Replace accu::accu_name by accu::stat::accu_name,
accu::meta::accu_name by accu::meta::stat::accu_name.
* mln/morpho/dilation.hh,
* mln/morpho/erosion.hh:
Idem + replace mln_morpho_select_accu(..., accu_name) by
mln_morpho_select_accu(..., stat::accu_name).
---
apps/statues/mesh-complex-max-curv.cc | 4
apps/statues/mesh-max-curv.cc | 4
doc/examples/accu-right-instanciation.cc | 4
doc/examples/trash/tuto_bis.cc | 2
doc/examples/tuto4_genericity_and_algorithms.cc | 2
mln/accu/all.hh | 10
mln/accu/essential.hh | 10
mln/accu/max_site.hh | 2
mln/accu/mean.hh | 2
mln/accu/stat/all.hh | 9
mln/accu/stat/max.hh | 178 ++++++
mln/accu/stat/max_h.hh | 315 ++++++++++++
mln/accu/stat/min.hh | 177 ++++++
mln/accu/stat/min_h.hh | 312 +++++++++++
mln/accu/stat/min_max.hh | 90 +++
mln/canvas/distance_front.hh | 6
mln/core/image/imorph/labeled_image.hh | 4
mln/debug/println.spe.hh | 4
mln/estim/min_max.hh | 4
mln/labeling/colorize.hh | 4
mln/morpho/dilation.hh | 12
mln/morpho/elementary/dilation.hh | 2
mln/morpho/elementary/erosion.hh | 2
mln/morpho/elementary/gradient.hh | 6
mln/morpho/elementary/gradient_external.hh | 2
mln/morpho/elementary/gradient_internal.hh | 2
mln/morpho/erosion.hh | 12
mln/morpho/general.spe.hh | 4
sandbox/abraham/mln/morpho/basic_najman.hh | 2
sandbox/abraham/mln/morpho/najman_wst.hh | 2
sandbox/abraham/mln/morpho/vector_median.hh | 4
sandbox/abraham/mln/morpho/vmt.hh | 4
sandbox/edwin/exec/color_internal_gradient.hh | 4
sandbox/edwin/tree/propagation.cc | 2
sandbox/fabien/igr/norm.cc | 4
sandbox/fabien/igr/seg_vol_irm.hh | 4
sandbox/folio/mln/dt/canvas_dt.hh | 2
sandbox/folio/mln/dt/dt_old/distance_front_new.hh | 6
sandbox/folio/mln/dt/dt_old/naive.cc | 2
sandbox/folio/mln/dt/raw_cp_fast.hh | 2
sandbox/folio/mln/dt/raw_path_fast.hh | 2
sandbox/folio/test/dt/naive.cc | 2
sandbox/fred/old/overload.cc | 4
sandbox/fred/tests/wip.cc | 6
sandbox/garrigues/fllt/fllt.hh | 4
sandbox/garrigues/fllt/lower.hh | 2
sandbox/garrigues/fllt/upper.hh | 2
sandbox/garrigues/level_set.hh | 4
sandbox/garrigues/lower.hh | 2
sandbox/garrigues/union_find/reconstructions_on_function.hh | 4
sandbox/garrigues/union_find/self_dual_reconstruction.hh | 2
sandbox/garrigues/upper.hh | 2
sandbox/inim/2009/color/min_tree_area_filter.cc | 2
sandbox/inim/2009/color/min_tree_color.cc | 2
sandbox/inim/2009/color/min_tree_color_v2.cc | 2
sandbox/inim/2009/color/min_tree_height_filter.cc | 2
sandbox/inim/2009/color/min_tree_volume_filter.cc | 2
sandbox/inim/2009/color/reference.cc | 4
sandbox/inim/2009/color/reference2.cc | 4
sandbox/theo/browsing/fwd.cc | 6
sandbox/theo/cs2d/cs2d_morpho.hh | 6
sandbox/theo/csi/fred.cc | 2
sandbox/theo/dmap.cc | 4
sandbox/theo/esiee/laurent/ismm09/pseudo_tree.hh | 4
sandbox/theo/esiee/laurent/presentation/classif.cc | 2
sandbox/theo/esiee/laurent/presentation/wst2d.cc | 4
sandbox/theo/esiee/laurent/presentation/wst_edge.cc | 6
sandbox/theo/esiee/slides_2009_may/dilation.hh | 2
sandbox/theo/exec/color_internal_gradient.cc | 4
tests/accu/Makefile.am | 10
tests/accu/all_accus.cc | 8
tests/accu/line.cc | 4
tests/accu/pair.cc | 4
tests/accu/stat/Makefile.am | 12
tests/accu/stat/max.cc | 55 ++
tests/accu/stat/max_h.cc | 62 ++
tests/accu/stat/min.cc | 54 ++
tests/accu/stat/min_h.cc | 64 ++
tests/accu/stat/min_max.cc | 71 ++
tests/accu/tuple.cc | 6
tests/data/compute.cc | 8
tests/data/compute_full.cc | 24
tests/data/update.cc | 8
tests/estim/min_max.cc | 4
tests/morpho/closing/area.cc | 4
85 files changed, 1551 insertions(+), 164 deletions(-)
Index: trunk/milena/mln/debug/println.spe.hh
===================================================================
--- trunk/milena/mln/debug/println.spe.hh (revision 4006)
+++ trunk/milena/mln/debug/println.spe.hh (revision 4007)
@@ -45,7 +45,7 @@
# include <mln/debug/format.hh>
# include <mln/debug/put_word.hh>
# include <mln/data/fill.hh>
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/max.hh>
# include <mln/opt/at.hh>
//FIXME: do not include all these headers
@@ -99,7 +99,7 @@
void
println(const box2d& b, const I& input)
{
- accu::max<unsigned> len_;
+ accu::stat::max<unsigned> len_;
mln_piter(I) p(input.domain());
for_all(p)
{
Index: trunk/milena/mln/core/image/imorph/labeled_image.hh
===================================================================
--- trunk/milena/mln/core/image/imorph/labeled_image.hh (revision 4006)
+++ trunk/milena/mln/core/image/imorph/labeled_image.hh (revision 4007)
@@ -49,7 +49,7 @@
# include <mln/util/array.hh>
# ifndef NDEBUG
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/max.hh>
# include <mln/data/compute.hh>
# endif // ! NDEBUG
@@ -250,7 +250,7 @@
void
labeled_image<I>::init_(const I& ima, const mln_value(I)& nlabels)
{
- mln_precondition(data::compute(accu::meta::max(), ima) == nlabels);
+ mln_precondition(data::compute(accu::meta::stat::max(), ima) == nlabels);
this->data_ = new internal::data< labeled_image<I> >(ima, nlabels);
this->update_();
}
Index: trunk/milena/mln/accu/min.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/max.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/min_max.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/min_h.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/max_h.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/all.hh
===================================================================
--- trunk/milena/mln/accu/all.hh (revision 4006)
+++ trunk/milena/mln/accu/all.hh (revision 4007)
@@ -69,13 +69,13 @@
# include <mln/accu/line.hh>
# include <mln/accu/lor.hh>
# include <mln/accu/lor_basic.hh>
-# include <mln/accu/max.hh>
-# include <mln/accu/max_h.hh>
+# include <mln/accu/stat/max.hh>
+# include <mln/accu/stat/max_h.hh>
# include <mln/accu/mean.hh>
# include <mln/accu/median_h.hh>
-# include <mln/accu/min.hh>
-# include <mln/accu/min_h.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min.hh>
+# include <mln/accu/stat/min_h.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/accu/nil.hh>
# include <mln/accu/pair.hh>
# include <mln/accu/rank.hh>
Index: trunk/milena/mln/accu/max_site.hh
===================================================================
--- trunk/milena/mln/accu/max_site.hh (revision 4006)
+++ trunk/milena/mln/accu/max_site.hh (revision 4007)
@@ -33,7 +33,7 @@
/// Define an accumulator that computes the first site with the maximum value
/// in an image.
///
-/// \todo Use accu::pair just like in accu::min_max.
+/// \todo Use accu::pair just like in accu::stat::min_max.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
Index: trunk/milena/mln/accu/essential.hh
===================================================================
--- trunk/milena/mln/accu/essential.hh (revision 4006)
+++ trunk/milena/mln/accu/essential.hh (revision 4007)
@@ -36,13 +36,13 @@
# include <mln/accu/center.hh>
# include <mln/accu/count.hh>
# include <mln/accu/histo.hh>
-# include <mln/accu/max.hh>
-# include <mln/accu/max_h.hh>
+# include <mln/accu/stat/max.hh>
+# include <mln/accu/stat/max_h.hh>
# include <mln/accu/mean.hh>
# include <mln/accu/median_h.hh>
-# include <mln/accu/min.hh>
-# include <mln/accu/min_h.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min.hh>
+# include <mln/accu/stat/min_h.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/accu/rank.hh>
# include <mln/accu/sum.hh>
Index: trunk/milena/mln/accu/stat/min.hh
===================================================================
--- trunk/milena/mln/accu/stat/min.hh (revision 0)
+++ trunk/milena/mln/accu/stat/min.hh (revision 4007)
@@ -0,0 +1,177 @@
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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_STAT_MIN_HH
+# define MLN_ACCU_STAT_MIN_HH
+
+/// \file mln/accu/stat/min.hh
+///
+/// Define an accumulator that computes a min.
+
+# include <mln/accu/internal/base.hh>
+# include <mln/core/concept/meta_accumulator.hh>
+# include <mln/trait/value_.hh>
+# include <mln/util/pix.hh>
+
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace stat
+ {
+ // Forward declaration.
+ template <typename T>
+ struct min;
+ }
+
+ namespace meta
+ {
+ namespace stat
+ {
+ /// Meta accumulator for min.
+
+ struct min : public Meta_Accumulator< min >
+ {
+ template <typename T>
+ struct with
+ {
+ typedef accu::stat::min<T> ret;
+ };
+ };
+ } // end of namespace mln::accu::meta::stat
+ } // end of namespace mln::accu::meta
+
+
+ namespace stat
+ {
+ /// \brief Generic min accumulator class.
+ /*!
+ * The parameter \c T is the type of values.
+ *
+ * \ingroup modaccuvalues
+ */
+ template <typename T>
+ struct min : public mln::accu::internal::base< const T&, min<T> >
+ {
+ typedef T argument;
+
+ min();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take_as_init_(const argument& t);
+ void take(const argument& t);
+ void take(const min<T>& other);
+ /// \}
+
+ /// Get the value of the accumulator.
+ const T& to_result() const;
+
+ /// Check whether this accu is able to return a result.
+ /// Always true here.
+ bool is_valid() const;
+
+ protected:
+
+ T t_;
+ };
+
+
+ template <typename I> struct min< util::pix<I> >;
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename T>
+ inline
+ min<T>::min()
+ {
+ init();
+ }
+
+ template <typename T>
+ inline
+ void
+ min<T>::init()
+ {
+ t_ = mln_max(T);
+ }
+
+ template <typename T>
+ inline
+ void min<T>::take_as_init_(const argument& t)
+ {
+ t_ = t;
+ }
+
+ template <typename T>
+ inline
+ void min<T>::take(const argument& t)
+ {
+ if (t < t_)
+ t_ = t;
+ }
+
+ template <typename T>
+ inline
+ void
+ min<T>::take(const min<T>& other)
+ {
+ if (other.t_ < t_)
+ t_ = other.t_;
+ }
+
+ template <typename T>
+ inline
+ const T&
+ min<T>::to_result() const
+ {
+ return t_;
+ }
+
+ template <typename T>
+ inline
+ bool
+ min<T>::is_valid() const
+ {
+ return true;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::accu::stat
+ } // end of namespace mln::accu
+
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_STAT_MIN_HH
Property changes on: trunk/milena/mln/accu/stat/min.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/stat/max.hh
===================================================================
--- trunk/milena/mln/accu/stat/max.hh (revision 0)
+++ trunk/milena/mln/accu/stat/max.hh (revision 4007)
@@ -0,0 +1,178 @@
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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_STAT_MAX_HH
+# define MLN_ACCU_STAT_MAX_HH
+
+/// \file mln/accu/stat/max.hh
+///
+/// Define an accumulator that computes a max.
+
+# include <mln/core/concept/meta_accumulator.hh>
+# include <mln/accu/internal/base.hh>
+# include <mln/trait/value_.hh>
+# include <mln/util/pix.hh>
+
+
+namespace mln
+{
+ namespace accu
+ {
+ namespace stat
+ {
+ // Forward declaration.
+ template <typename T>
+ struct max;
+ }
+
+
+ namespace meta
+ {
+ namespace stat
+ {
+ /// Meta accumulator for max.
+
+ struct max : public Meta_Accumulator< max >
+ {
+ template <typename T>
+ struct with
+ {
+ typedef accu::stat::max<T> ret;
+ };
+ };
+
+ } // end of namespace mln::accu::meta::stat
+ } // end of namespace mln::accu::meta
+
+
+ namespace stat
+ {
+
+ /// \brief Generic max accumulator class.
+ ///
+ /// The parameter \c T is the type of values.
+ ///
+ /// \ingroup modaccuvalues
+ template <typename T>
+ struct max : public mln::accu::internal::base< const T& , max<T> >
+ {
+ typedef T argument;
+
+ max();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take_as_init_(const argument& t);
+ void take(const argument& t);
+ void take(const max<T>& other);
+ /// \}
+
+ /// Get the value of the accumulator.
+ const T& to_result() const;
+
+ /// Check whether this accu is able to return a result.
+ /// Always true here.
+ bool is_valid() const;
+
+ protected:
+
+ T t_;
+ };
+
+
+ template <typename I> struct max< util::pix<I> >;
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename T>
+ inline
+ max<T>::max()
+ {
+ init();
+ }
+
+ template <typename T>
+ inline
+ void
+ max<T>::init()
+ {
+ t_ = mln_min(T);
+ }
+
+ template <typename T>
+ inline
+ void
+ max<T>::take_as_init_(const argument& t)
+ {
+ t_ = t;
+ }
+
+ template <typename T>
+ inline
+ void
+ max<T>::take(const argument& t)
+ {
+ if (t > t_)
+ t_ = t;
+ }
+
+ template <typename T>
+ inline
+ void
+ max<T>::take(const max<T>& other)
+ {
+ if (other.t_ > t_)
+ t_ = other.t_;
+ }
+
+ template <typename T>
+ inline
+ const T&
+ max<T>::to_result() const
+ {
+ return t_;
+ }
+
+ template <typename T>
+ inline
+ bool
+ max<T>::is_valid() const
+ {
+ return true;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+ } // end of namespace mln::accu::stat
+
+ } // end of namespace mln::accu
+
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_STAT_MAX_HH
Property changes on: trunk/milena/mln/accu/stat/max.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/stat/all.hh
===================================================================
--- trunk/milena/mln/accu/stat/all.hh (revision 4006)
+++ trunk/milena/mln/accu/stat/all.hh (revision 4007)
@@ -37,6 +37,11 @@
{
namespace accu
{
+ namespace meta
+ {
+ /// Namespace of statistical meta-accumulators.
+ namespace stat {}
+ }
/// Namespace of statistical accumulators.
namespace stat {}
@@ -48,6 +53,10 @@
# include <mln/accu/stat/deviation.hh>
# include <mln/accu/stat/var.hh>
# include <mln/accu/stat/variance.hh>
+# include <mln/accu/stat/max.hh>
+# include <mln/accu/stat/min.hh>
+# include <mln/accu/stat/min_max.hh>
+
#endif // ! MLN_ACCU_STAT_ALL_HH
Index: trunk/milena/mln/accu/stat/min_max.hh
===================================================================
--- trunk/milena/mln/accu/stat/min_max.hh (revision 0)
+++ trunk/milena/mln/accu/stat/min_max.hh (revision 4007)
@@ -0,0 +1,90 @@
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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_STAT_MIN_MAX_HH
+# define MLN_ACCU_STAT_MIN_MAX_HH
+
+/// \file mln/accu/stat/min_max.hh
+///
+/// Define an accumulator that computes a min and a max.
+///
+/// \todo A macro to create such accumulators.
+
+# include <utility>
+
+# include <mln/accu/pair.hh>
+# include <mln/accu/stat/min.hh>
+# include <mln/accu/stat/max.hh>
+# include <mln/trait/value_.hh>
+# include <mln/util/pix.hh>
+
+
+namespace mln
+{
+ namespace accu
+ {
+ namespace stat
+ {
+ // Forward declaration.
+ template <typename V>
+ struct min_max;
+ }
+
+ namespace meta
+ {
+ namespace stat
+ {
+ // FIXME: Doc!
+ typedef meta::pair<meta::stat::min,meta::stat::max> min_max;
+
+ } // end of namespace mln::accu::meta::stat
+ } // end of namespace mln::accu::meta
+
+ namespace stat
+ {
+
+ /// \brief Generic min and max accumulator class.
+ /*!
+ * The parameter \c V is the type of values.
+ *
+ * \ingroup modaccuvalues
+ */
+ template <typename V>
+ struct min_max : public pair< min<V>, max<V> >
+ {
+ };
+
+ template <typename I> struct min_max< util::pix<I> >;
+
+ } // end of namespace mln::accu::stat
+ } // end of namespace mln::accu
+
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_STAT_MIN_MAX_HH
Property changes on: trunk/milena/mln/accu/stat/min_max.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/stat/min_h.hh
===================================================================
--- trunk/milena/mln/accu/stat/min_h.hh (revision 0)
+++ trunk/milena/mln/accu/stat/min_h.hh (revision 4007)
@@ -0,0 +1,312 @@
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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_STAT_MIN_H_HH
+# define MLN_ACCU_STAT_MIN_H_HH
+
+/// \file mln/accu/stat/min_h.hh
+///
+/// Define a generic min accumulator class based on histogram.
+
+# include <mln/accu/internal/base.hh>
+# include <mln/accu/histo.hh>
+# include <mln/value/set.hh>
+# include <mln/util/pix.hh>
+
+
+namespace mln
+{
+ namespace accu
+ {
+
+ namespace stat
+ {
+ // Forward declaration.
+ template <typename V>
+ struct min_h;
+ }
+
+ namespace meta
+ {
+ namespace stat
+ {
+
+ /// Meta accumulator for min.
+ struct min_h : public Meta_Accumulator< min_h >
+ {
+ template <typename T>
+ struct with
+ {
+ typedef accu::stat::min_h<T> ret;
+ };
+ };
+
+ } // end of namespace mln::meta::stat
+ } // end of namespace mln::meta
+
+
+ namespace stat
+ {
+ /// \brief Generic min function based on histogram over a value
+ /// set with type \c V.
+ ///
+ /// \ingroup modaccuvalues
+ //
+ template <typename V>
+ struct min_h : public mln::accu::internal::base< const V& , min_h<V>
>
+ {
+ typedef V argument;
+
+ min_h();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take(const argument& t);
+ void take_as_init_(const argument& t);
+ void take(const min_h<V>& other);
+ void untake(const argument& t);
+ /// \}
+
+ unsigned card() const { return h_.sum(); }
+
+ /// Get the value of the accumulator.
+ const argument& to_result() const;
+
+ const accu::histo<V>& histo() const;
+
+ /// Check whether this accu is able to return a result.
+ /// Always true here.
+ bool is_valid() const;
+
+ void debug_print_() const;
+
+ protected:
+
+ mutable accu::histo<V> h_;
+ const value::set<V>& s_; // derived from h_
+
+ mutable unsigned sum_;
+ mutable bool valid_;
+ mutable unsigned i_; // the min index
+ mutable argument t_; // the min value
+
+ // Auxiliary methods
+ void update_() const;
+ void go_minus_() const;
+ void go_plus_() const;
+ };
+
+
+
+ template <typename I> struct min_h< util::pix<I> >;
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename V>
+ inline
+ min_h<V>::min_h()
+ : h_(),
+ s_(h_.vset())
+ {
+ init();
+ }
+
+ template <typename V>
+ inline
+ void
+ min_h<V>::take(const argument& t)
+ {
+ if (h_.sum() == 0)
+ {
+ this->take_as_init_(t);
+ return;
+ }
+ h_.take(t);
+ if (t < t_)
+ {
+ ++sum_;
+ valid_ = false;
+ }
+ }
+
+ template <typename V>
+ inline
+ void
+ min_h<V>::take(const min_h<V>& other)
+ {
+ // h_
+ h_.take(other.h_);
+ for (unsigned i = 0; i < i_; ++i)
+ sum_ += other.h_[i];
+ valid_ = false;
+ // FIXME: Optimize.
+ }
+
+ template <typename V>
+ inline
+ void
+ min_h<V>::untake(const argument& t)
+ {
+ mln_precondition(h_(t) != 0);
+ h_.untake(t);
+ if (h_.sum() == 0)
+ {
+ init();
+ return;
+ }
+ if (t < t_)
+ {
+ mln_invariant(sum_ >= 1);
+ --sum_;
+ valid_ = false;
+ }
+ else
+ if (t == t_ && h_[i_] == 0)
+ valid_ = false;
+ }
+
+ template <typename V>
+ inline
+ void
+ min_h<V>::update_() const
+ {
+ if (sum_ != 0)
+ go_minus_();
+ else
+ if (h_[i_] == 0)
+ go_plus_();
+ valid_ = true;
+ }
+
+ template <typename V>
+ inline
+ void
+ min_h<V>::go_minus_() const
+ {
+ do
+ {
+ --i_;
+ if (h_[i_] != 0)
+ sum_ -= h_[i_];
+ }
+ while (sum_ != 0);
+ t_ = s_[i_];
+ }
+
+ template <typename V>
+ inline
+ void
+ min_h<V>::go_plus_() const
+ {
+ do
+ ++i_;
+ while (h_[i_] == 0);
+ t_ = s_[i_];
+ }
+
+ template <typename V>
+ inline
+ void
+ min_h<V>::init()
+ {
+ h_.init();
+ sum_ = 0;
+ i_ = mln_max(argument);
+ t_ = s_[i_];
+ valid_ = true;
+ }
+
+ template <typename V>
+ inline
+ void
+ min_h<V>::take_as_init_(const argument& t)
+ {
+ h_.take(t);
+ sum_ = 0;
+ i_ = s_.index_of(t);
+ t_ = t;
+ valid_ = true;
+ }
+
+ template <typename V>
+ inline
+ const typename min_h<V>::argument&
+ min_h<V>::to_result() const
+ {
+ if (! valid_)
+ update_();
+ return t_;
+ }
+
+ template <typename V>
+ inline
+ const accu::histo<V>&
+ min_h<V>::histo() const
+ {
+ return h_;
+ }
+
+ template <typename V>
+ inline
+ bool
+ min_h<V>::is_valid() const
+ {
+ return true;
+ }
+
+
+ template <typename V>
+ inline
+ void
+ min_h<V>::debug_print_() const
+ {
+ std::cout << "h={" << h_ << "} ";
+ std::cout << "sum=" << sum_ << ' '
+ << "valid=" << valid_ << ' '
+ << "i=" << i_ << ' '
+ << "t=" << t_ << std::endl;
+ }
+
+ template <typename V>
+ inline
+ std::ostream& operator<<(std::ostream& ostr, const
min_h<V>& m)
+ {
+ return ostr << m.to_result();
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+
+ } // end of namespace mln::accu::stat
+ } // end of namespace mln::accu
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_STAT_MIN_H_HH
Property changes on: trunk/milena/mln/accu/stat/min_h.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/stat/max_h.hh
===================================================================
--- trunk/milena/mln/accu/stat/max_h.hh (revision 0)
+++ trunk/milena/mln/accu/stat/max_h.hh (revision 4007)
@@ -0,0 +1,315 @@
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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_STAT_MAX_H_HH
+# define MLN_ACCU_STAT_MAX_H_HH
+
+/// \file mln/accu/stat/max_h.hh
+///
+/// Define a generic max accumulator class based on histogram.
+
+# include <mln/accu/internal/base.hh>
+# include <mln/core/concept/meta_accumulator.hh>
+# include <mln/accu/histo.hh>
+# include <mln/util/pix.hh>
+
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace stat
+ {
+ // Forward declaration.
+ template <typename V>
+ struct max_h;
+ }
+
+ namespace meta
+ {
+ namespace stat
+ {
+
+ /// Meta accumulator for max.
+ struct max_h : public Meta_Accumulator< max_h >
+ {
+ template <typename T>
+ struct with
+ {
+ typedef accu::stat::max_h<T> ret;
+ };
+ };
+
+ } // end of namespace mln::meta::stat
+ } // end of namespace mln::meta
+
+
+ namespace stat
+ {
+
+ /// \brief Generic max function based on histogram over a value set with
+ /// type \c V.
+ ///
+ /// \ingroup modaccuvalues
+ //
+ template <typename V>
+ struct max_h : public mln::accu::internal::base< const V&, max_h<V>
>
+ {
+ typedef V argument;
+
+ max_h();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take(const argument& t);
+ void take_as_init_(const argument& t);
+ void take(const max_h<V>& other);
+ void untake(const argument& t);
+ /// \}
+
+ unsigned card() const { return h_.sum(); }
+
+ /// Get the value of the accumulator.
+ const argument& to_result() const;
+
+ const accu::histo<V>& histo() const;
+
+ /// Check whether this accu is able to return a result.
+ /// Always true here.
+ bool is_valid() const;
+
+ void debug_print_() const;
+
+ protected:
+
+ mutable accu::histo<V> h_;
+ const value::set<V>& s_; // derived from h_
+
+ mutable unsigned sum_;
+ mutable bool valid_;
+ mutable unsigned i_; // the max index
+ mutable argument t_; // the max argument
+
+ // Auxiliary methods
+ void update_() const;
+ void go_minus_() const;
+ void go_plus_() const;
+ };
+
+
+
+ template <typename I> struct max_h< util::pix<I> >;
+
+
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename V>
+ inline
+ max_h<V>::max_h()
+ : h_(),
+ s_(h_.vset())
+ {
+ init();
+ }
+
+ template <typename V>
+ inline
+ void
+ max_h<V>::take(const argument& t)
+ {
+ if (h_.sum() == 0)
+ {
+ this->take_as_init_(t);
+ return;
+ }
+ h_.take(t);
+ if (t > t_)
+ {
+ ++sum_;
+ valid_ = false;
+ }
+ }
+
+ template <typename V>
+ inline
+ void
+ max_h<V>::take(const max_h<V>& other)
+ {
+ // h_
+ h_.take(other.h_);
+ for (unsigned i = this->card() - 1; i > i_; --i)
+ sum_ += other.h_[i];
+ valid_ = false;
+ // FIXME: Optimize.
+ }
+
+ template <typename V>
+ inline
+ void
+ max_h<V>::untake(const argument& t)
+ {
+ mln_precondition(h_(t) != 0);
+ h_.untake(t);
+ if (h_.sum() == 0)
+ {
+ init();
+ return;
+ }
+ if (t > t_)
+ {
+ mln_invariant(sum_ >= 1);
+ --sum_;
+ valid_ = false;
+ }
+ else
+ if (t == t_ && h_[i_] == 0)
+ valid_ = false;
+ }
+
+ template <typename V>
+ inline
+ void
+ max_h<V>::update_() const
+ {
+ if (sum_ != 0)
+ go_plus_();
+ else
+ if (h_[i_] == 0)
+ go_minus_();
+ valid_ = true;
+ }
+
+ template <typename V>
+ inline
+ void
+ max_h<V>::go_plus_() const
+ {
+ do
+ {
+ ++i_;
+ if (h_[i_] != 0)
+ sum_ -= h_[i_];
+ }
+ while (sum_ != 0);
+ t_ = s_[i_];
+ }
+
+ template <typename V>
+ inline
+ void
+ max_h<V>::go_minus_() const
+ {
+ do
+ --i_;
+ while (h_[i_] == 0);
+ t_ = s_[i_];
+ }
+
+ template <typename V>
+ inline
+ void
+ max_h<V>::init()
+ {
+ h_.init();
+ sum_ = 0;
+ i_ = mln_min(argument);
+ t_ = s_[i_];
+ valid_ = true;
+ }
+
+ template <typename V>
+ inline
+ void
+ max_h<V>::take_as_init_(const argument& t)
+ {
+ h_.take(t);
+ sum_ = 0;
+ i_ = s_.index_of(t);
+ t_ = t;
+ valid_ = true;
+ }
+
+ template <typename V>
+ inline
+ const typename max_h<V>::argument&
+ max_h<V>::to_result() const
+ {
+ if (! valid_)
+ update_();
+ return t_;
+ }
+
+ template <typename V>
+ inline
+ const accu::histo<V>&
+ max_h<V>::histo() const
+ {
+ return h_;
+ }
+
+ template <typename V>
+ inline
+ bool
+ max_h<V>::is_valid() const
+ {
+ return true;
+ }
+
+ template <typename V>
+ inline
+ void
+ max_h<V>::debug_print_() const
+ {
+ std::cout << "h={" << h_ << "} ";
+ std::cout << "sum=" << sum_ << ' '
+ << "valid=" << valid_ << ' '
+ << "i=" << i_ << ' '
+ << "t=" << t_ << std::endl;
+ }
+
+ template <typename V>
+ inline
+ std::ostream& operator<<(std::ostream& ostr, const
max_h<V>& m)
+ {
+ return ostr << m.to_result();
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::accu::stat
+ } // end of namespace mln::accu
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_STAT_MAX_H_HH
Property changes on: trunk/milena/mln/accu/stat/max_h.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/mean.hh
===================================================================
--- trunk/milena/mln/accu/mean.hh (revision 4006)
+++ trunk/milena/mln/accu/mean.hh (revision 4007)
@@ -33,7 +33,7 @@
///
/// Define an accumulator that computes a mean.
///
-/// \todo Use accu::pair just like in accu::min_max.
+/// \todo Use accu::pair just like in accu::stat::min_max.
# include <mln/accu/internal/base.hh>
# include <mln/accu/count.hh>
Index: trunk/milena/mln/estim/min_max.hh
===================================================================
--- trunk/milena/mln/estim/min_max.hh (revision 4006)
+++ trunk/milena/mln/estim/min_max.hh (revision 4007)
@@ -35,7 +35,7 @@
///
/// \todo Overload while returning an std::pair.
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/data/compute.hh>
@@ -65,7 +65,7 @@
{
mln_precondition(exact(input).is_valid());
typedef mln_value(I) V;
- std::pair<V, V> mm = data::compute(accu::meta::min_max(), input);
+ std::pair<V, V> mm = data::compute(accu::meta::stat::min_max(), input);
min = mm.first;
max = mm.second;
}
Index: trunk/milena/mln/morpho/elementary/dilation.hh
===================================================================
--- trunk/milena/mln/morpho/elementary/dilation.hh (revision 4006)
+++ trunk/milena/mln/morpho/elementary/dilation.hh (revision 4007)
@@ -62,7 +62,7 @@
dilation_dispatch(trait::image::kind::any,
const Image<I>& input, const Neighborhood<N>& nbh)
{
- return like_ero_fun(accu::meta::max(), f_accu(), input, nbh);
+ return like_ero_fun(accu::meta::stat::max(), f_accu(), input, nbh);
}
template <typename I, typename N>
Index: trunk/milena/mln/morpho/elementary/gradient_internal.hh
===================================================================
--- trunk/milena/mln/morpho/elementary/gradient_internal.hh (revision 4006)
+++ trunk/milena/mln/morpho/elementary/gradient_internal.hh (revision 4007)
@@ -73,7 +73,7 @@
gradient_internal_dispatch(trait::image::kind::any,
const Image<I>& input, const Neighborhood<N>& nbh)
{
- return like_ero_fun(accu::meta::min(), f_grad_int(), input, nbh);
+ return like_ero_fun(accu::meta::stat::min(), f_grad_int(), input, nbh);
}
template <typename I, typename N>
Index: trunk/milena/mln/morpho/elementary/gradient.hh
===================================================================
--- trunk/milena/mln/morpho/elementary/gradient.hh (revision 4006)
+++ trunk/milena/mln/morpho/elementary/gradient.hh (revision 4007)
@@ -34,7 +34,7 @@
/// \todo Add fastest version for sets.
# include <mln/morpho/includes.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min_max.hh>
namespace mln
@@ -83,7 +83,7 @@
const N& nbh = exact(nbh_);
internal::gradient_tests(input, nbh);
- accu::min_max<mln_value(I)> a;
+ accu::stat::min_max<mln_value(I)> a;
extension::adjust_duplicate(input, nbh);
@@ -157,7 +157,7 @@
const N& nbh = exact(nbh_);
internal::gradient_tests(input, nbh);
- accu::min_max<mln_value(I)> a;
+ accu::stat::min_max<mln_value(I)> a;
extension::adjust_duplicate(input, nbh);
typedef mln_concrete(I) O;
Index: trunk/milena/mln/morpho/elementary/erosion.hh
===================================================================
--- trunk/milena/mln/morpho/elementary/erosion.hh (revision 4006)
+++ trunk/milena/mln/morpho/elementary/erosion.hh (revision 4007)
@@ -61,7 +61,7 @@
erosion_dispatch(trait::image::kind::any,
const Image<I>& input, const Neighborhood<N>& nbh)
{
- return like_ero_fun(accu::meta::min(), f_accu(), input, nbh);
+ return like_ero_fun(accu::meta::stat::min(), f_accu(), input, nbh);
}
template <typename I, typename N>
Index: trunk/milena/mln/morpho/elementary/gradient_external.hh
===================================================================
--- trunk/milena/mln/morpho/elementary/gradient_external.hh (revision 4006)
+++ trunk/milena/mln/morpho/elementary/gradient_external.hh (revision 4007)
@@ -73,7 +73,7 @@
gradient_external_dispatch(trait::image::kind::any,
const Image<I>& input, const Neighborhood<N>& nbh)
{
- return like_ero_fun(accu::meta::max(), f_grad_ext(), input, nbh);
+ return like_ero_fun(accu::meta::stat::max(), f_grad_ext(), input, nbh);
}
template <typename I, typename N>
Index: trunk/milena/mln/morpho/erosion.hh
===================================================================
--- trunk/milena/mln/morpho/erosion.hh (revision 4006)
+++ trunk/milena/mln/morpho/erosion.hh (revision 4007)
@@ -39,8 +39,8 @@
# include <mln/morpho/includes.hh>
# include <mln/accu/land.hh>
# include <mln/accu/land_basic.hh>
-# include <mln/accu/min.hh>
-# include <mln/accu/min_h.hh>
+# include <mln/accu/stat/min.hh>
+# include <mln/accu/stat/min_h.hh>
namespace mln
@@ -61,18 +61,18 @@
{
template <typename I>
- mln_morpho_select_accu(I, land_basic, min)
+ mln_morpho_select_accu(I, land_basic, stat::min)
accu(const Image<I>&) const
{
- mln_morpho_select_accu(I, land_basic, min) tmp;
+ mln_morpho_select_accu(I, land_basic, stat::min) tmp;
return tmp;
}
template <typename I>
- mln_morpho_select_accu(I, land, min_h)
+ mln_morpho_select_accu(I, land, stat::min_h)
accu_incr(const Image<I>&) const
{
- mln_morpho_select_accu(I, land, min_h) tmp;
+ mln_morpho_select_accu(I, land, stat::min_h) tmp;
return tmp;
}
Index: trunk/milena/mln/morpho/general.spe.hh
===================================================================
--- trunk/milena/mln/morpho/general.spe.hh (revision 4006)
+++ trunk/milena/mln/morpho/general.spe.hh (revision 4007)
@@ -45,7 +45,7 @@
# include <mln/accu/transform_stop.hh>
# include <mln/accu/transform_diagonal.hh>
-# include <mln/accu/min_h.hh>
+# include <mln/accu/stat/min_h.hh>
# include <mln/accu/line.hh>
@@ -145,7 +145,7 @@
do
{
- accu::line< accu::meta::min_h, Dir >(input,
+ accu::line< accu::meta::stat::min_h, Dir >(input,
p, len,
win_half_length,
output);
Index: trunk/milena/mln/morpho/dilation.hh
===================================================================
--- trunk/milena/mln/morpho/dilation.hh (revision 4006)
+++ trunk/milena/mln/morpho/dilation.hh (revision 4007)
@@ -39,8 +39,8 @@
# include <mln/morpho/general.hh>
# include <mln/accu/lor.hh>
# include <mln/accu/lor_basic.hh>
-# include <mln/accu/max.hh>
-# include <mln/accu/max_h.hh>
+# include <mln/accu/stat/max.hh>
+# include <mln/accu/stat/max_h.hh>
namespace mln
@@ -62,18 +62,18 @@
{
template <typename I>
- mln_morpho_select_accu(I, lor_basic, max)
+ mln_morpho_select_accu(I, lor_basic, stat::max)
accu(const Image<I>&) const
{
- mln_morpho_select_accu(I, lor_basic, max) tmp;
+ mln_morpho_select_accu(I, lor_basic, stat::max) tmp;
return tmp;
}
template <typename I>
- mln_morpho_select_accu(I, lor, max_h)
+ mln_morpho_select_accu(I, lor, stat::max_h)
accu_incr(const Image<I>&) const
{
- mln_morpho_select_accu(I, lor, max_h) tmp;
+ mln_morpho_select_accu(I, lor, stat::max_h) tmp;
return tmp;
}
Index: trunk/milena/mln/canvas/distance_front.hh
===================================================================
--- trunk/milena/mln/canvas/distance_front.hh (revision 4006)
+++ trunk/milena/mln/canvas/distance_front.hh (revision 4007)
@@ -38,7 +38,7 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/concept/weighted_window.hh>
# include <mln/data/fill.hh>
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/max.hh>
# include <mln/extension/adjust_fill.hh>
@@ -134,7 +134,7 @@
// Mod determination.
unsigned mod;
{
- accu::max<unsigned> m;
+ accu::stat::max<unsigned> m;
for (unsigned i = 0; i < w_win.size(); ++i)
m.take(w_win.w(i));
mod = unsigned(m) + 1;
@@ -246,7 +246,7 @@
// Mod determination.
unsigned mod;
{
- accu::max<unsigned> m;
+ accu::stat::max<unsigned> m;
for (unsigned i = 0; i < w_win.size(); ++i)
m.take(w_win.w(i));
mod = unsigned(m) + 1;
Index: trunk/milena/mln/labeling/colorize.hh
===================================================================
--- trunk/milena/mln/labeling/colorize.hh (revision 4006)
+++ trunk/milena/mln/labeling/colorize.hh (revision 4007)
@@ -39,7 +39,7 @@
# include <mln/literal/black.hh>
# include <mln/data/transform.hh>
# include <mln/data/compute.hh>
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/max.hh>
namespace mln
@@ -153,7 +153,7 @@
trace::entering("labeling::colorize");
mln_precondition(exact(input).is_valid());
- accu::max<mln_value(L)> accu;
+ accu::stat::max<mln_value(L)> accu;
mln_value(L) nlabels = data::compute(accu, input);
mln_ch_value(L,V) output = colorize(value, input, nlabels);
Index: trunk/milena/sandbox/fred/tests/wip.cc
===================================================================
--- trunk/milena/sandbox/fred/tests/wip.cc (revision 4006)
+++ trunk/milena/sandbox/fred/tests/wip.cc (revision 4007)
@@ -1,5 +1,5 @@
// Meta functions test
-#include <mln/accu/min.hh>
+#include <mln/accu/stat/min.hh>
#include <mln/fun/accu_result.hh>
#include <mln/fun/from_accu.hh>
#include <mln/fun/math/cos.hh>
@@ -11,10 +11,10 @@
#define dbg_print(val) std::cout << #val << "\n\t -> \t"
<< (val) << std::endl
int main()
{
- mln::accu::min<int> min;
+ mln::accu::stat::min<int> min;
mln::fun::cos cos;
mln::fun::accu_result result;
- mln::fun::from_accu< mln::accu::min<int> > frommin(&min);
+ mln::fun::from_accu< mln::accu::stat::min<int> > frommin(&min);
mln_VAR(cosfrommin, cos(frommin));
Index: trunk/milena/sandbox/fred/old/overload.cc
===================================================================
--- trunk/milena/sandbox/fred/old/overload.cc (revision 4006)
+++ trunk/milena/sandbox/fred/old/overload.cc (revision 4007)
@@ -101,7 +101,7 @@
}
// The "meta-fun -> fun" code is similar to the one in
- // mln/accu/min.hh
+ // mln/accu/stat/min.hh
template <typename T>
struct with
{
@@ -235,7 +235,7 @@
}
// The "meta-fun -> fun" code is similar to the one in
- // mln/accu/min.hh
+ // mln/accu/stat/min.hh
template <typename L, typename R>
struct with
{
Index: trunk/milena/sandbox/fabien/igr/norm.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/norm.cc (revision 4006)
+++ trunk/milena/sandbox/fabien/igr/norm.cc (revision 4007)
@@ -23,8 +23,8 @@
#include <mln/io/pgm/save.hh>
#include <mln/data/stretch.hh>
#include <mln/value/int_u8.hh>
-/*#include <mln/accu/min.hh>
-#include <mln/accu/max.hh>
+/*#include <mln/accu/stat/min.hh>
+#include <mln/accu/stat/max.hh>
#include <mln/data/compute.hh>*/
using namespace mln;
Index: trunk/milena/sandbox/fabien/igr/seg_vol_irm.hh
===================================================================
--- trunk/milena/sandbox/fabien/igr/seg_vol_irm.hh (revision 4006)
+++ trunk/milena/sandbox/fabien/igr/seg_vol_irm.hh (revision 4007)
@@ -74,7 +74,7 @@
#include <mln/accu/count.hh>
#include <mln/accu/center.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/max.hh>
#include <mln/accu/sum.hh>
#include <mln/accu/mean.hh>
#include <mln/accu/stat/deviation.hh>
@@ -197,7 +197,7 @@
fout << i << " " << ima_histo(point1d(i)) <<
std::endl;
ima_histo(point1d(i)) += ima_histo(point1d(i - 1));
}
- accu::max<unsigned> max_accu;
+ accu::stat::max<unsigned> max_accu;
unsigned max = data::compute(max_accu, ima_histo);
bool low_done = false;
bool high_done = false;
Index: trunk/milena/sandbox/garrigues/level_set.hh
===================================================================
--- trunk/milena/sandbox/garrigues/level_set.hh (revision 4006)
+++ trunk/milena/sandbox/garrigues/level_set.hh (revision 4007)
@@ -62,8 +62,8 @@
# include <mln/data/compute.hh>
# include <mln/data/fill.hh>
-# include <mln/accu/min.hh>
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/min.hh>
+# include <mln/accu/stat/max.hh>
# include <mln/set/uni.hh>
# include <mln/set/diff.hh>
Index: trunk/milena/sandbox/garrigues/fllt/lower.hh
===================================================================
--- trunk/milena/sandbox/garrigues/fllt/lower.hh (revision 4006)
+++ trunk/milena/sandbox/garrigues/fllt/lower.hh (revision 4007)
@@ -38,7 +38,7 @@
# include <mln/core/alias/neighb2d.hh>
# include <mln/core/clock_neighb2d.hh>
# include <mln/labeling/regional_minima.hh>
-# include <mln/accu/min.hh>
+# include <mln/accu/stat/min.hh>
# include "upper.hh"
Index: trunk/milena/sandbox/garrigues/fllt/upper.hh
===================================================================
--- trunk/milena/sandbox/garrigues/fllt/upper.hh (revision 4006)
+++ trunk/milena/sandbox/garrigues/fllt/upper.hh (revision 4007)
@@ -38,7 +38,7 @@
# include <mln/core/alias/neighb2d.hh>
# include <mln/core/clock_neighb2d.hh>
# include <mln/labeling/regional_maxima.hh>
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/max.hh>
# include "lower.hh"
Index: trunk/milena/sandbox/garrigues/fllt/fllt.hh
===================================================================
--- trunk/milena/sandbox/garrigues/fllt/fllt.hh (revision 4006)
+++ trunk/milena/sandbox/garrigues/fllt/fllt.hh (revision 4007)
@@ -53,8 +53,8 @@
# include <mln/data/compute.hh>
# include <mln/data/fill.hh>
-# include <mln/accu/min.hh>
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/min.hh>
+# include <mln/accu/stat/max.hh>
# include <mln/set/uni.hh>
# include <mln/set/diff.hh>
Index: trunk/milena/sandbox/garrigues/lower.hh
===================================================================
--- trunk/milena/sandbox/garrigues/lower.hh (revision 4006)
+++ trunk/milena/sandbox/garrigues/lower.hh (revision 4007)
@@ -37,7 +37,7 @@
# include <mln/core/alias/neighb2d.hh>
-# include <mln/accu/min.hh>
+# include <mln/accu/stat/min.hh>
# include <mln/labeling/regional_minima.hh>
# include "fllt_types.hh"
Index: trunk/milena/sandbox/garrigues/union_find/reconstructions_on_function.hh
===================================================================
--- trunk/milena/sandbox/garrigues/union_find/reconstructions_on_function.hh (revision
4006)
+++ trunk/milena/sandbox/garrigues/union_find/reconstructions_on_function.hh (revision
4007)
@@ -39,7 +39,7 @@
# include <mln/literal/zero.hh>
# include <mln/math/max.hh>
# include <mln/math/min.hh>
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/max.hh>
# include "canvas/reconstruction_on_function.hh"
@@ -202,7 +202,7 @@
O* cur = &output;
O* prev = &output1;
- accu::max<mln_value(O)> max;
+ accu::stat::max<mln_value(O)> max;
mln_piter(I) p(output.domain());
mln_niter(N) n(nbh, p);
Index: trunk/milena/sandbox/garrigues/union_find/self_dual_reconstruction.hh
===================================================================
--- trunk/milena/sandbox/garrigues/union_find/self_dual_reconstruction.hh (revision 4006)
+++ trunk/milena/sandbox/garrigues/union_find/self_dual_reconstruction.hh (revision 4007)
@@ -39,7 +39,7 @@
# include <mln/literal/zero.hh>
# include <mln/math/max.hh>
# include <mln/math/min.hh>
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/max.hh>
# include <tests/timer.hh>
Index: trunk/milena/sandbox/garrigues/upper.hh
===================================================================
--- trunk/milena/sandbox/garrigues/upper.hh (revision 4006)
+++ trunk/milena/sandbox/garrigues/upper.hh (revision 4007)
@@ -37,7 +37,7 @@
# include <mln/core/alias/neighb2d.hh>
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/max.hh>
# include <mln/labeling/regional_maxima.hh>
# include "fllt_types.hh"
Index: trunk/milena/sandbox/abraham/mln/morpho/najman_wst.hh
===================================================================
--- trunk/milena/sandbox/abraham/mln/morpho/najman_wst.hh (revision 4006)
+++ trunk/milena/sandbox/abraham/mln/morpho/najman_wst.hh (revision 4007)
@@ -552,7 +552,7 @@
{
mln::p_priority< mln_value(I), p_queue_fast<site> > L;
- mln_value(I) max = data::compute(accu::meta::max(), pima);
+ mln_value(I) max = data::compute(accu::meta::stat::max(), pima);
// I K(pima.domain(), pima.border());
mln_ch_value(I, unsigned) K(pima.domain(), pima.border());
Index: trunk/milena/sandbox/abraham/mln/morpho/basic_najman.hh
===================================================================
--- trunk/milena/sandbox/abraham/mln/morpho/basic_najman.hh (revision 4006)
+++ trunk/milena/sandbox/abraham/mln/morpho/basic_najman.hh (revision 4007)
@@ -526,7 +526,7 @@
{
mln::p_priority< mln_value(I), p_queue_fast<site> > L;
- mln_value(I) max = data::compute(accu::meta::max(), pima);
+ mln_value(I) max = data::compute(accu::meta::stat::max(), pima);
// I K(pima.domain(), pima.border());
mln_ch_value(I, unsigned) K(pima.domain(), pima.border());
Index: trunk/milena/sandbox/abraham/mln/morpho/vmt.hh
===================================================================
--- trunk/milena/sandbox/abraham/mln/morpho/vmt.hh (revision 4006)
+++ trunk/milena/sandbox/abraham/mln/morpho/vmt.hh (revision 4007)
@@ -39,8 +39,8 @@
# include <mln/morpho/general.hh>
# include <mln/accu/land.hh>
# include <mln/accu/land_basic.hh>
-# include <mln/accu/min.hh>
-# include <mln/accu/min_h.hh>
+# include <mln/accu/stat/min.hh>
+# include <mln/accu/stat/min_h.hh>
# include <mln/norm/l2.hh>
namespace mln
Index: trunk/milena/sandbox/abraham/mln/morpho/vector_median.hh
===================================================================
--- trunk/milena/sandbox/abraham/mln/morpho/vector_median.hh (revision 4006)
+++ trunk/milena/sandbox/abraham/mln/morpho/vector_median.hh (revision 4007)
@@ -39,8 +39,8 @@
# include <mln/morpho/general.hh>
# include <mln/accu/land.hh>
# include <mln/accu/land_basic.hh>
-# include <mln/accu/min.hh>
-# include <mln/accu/min_h.hh>
+# include <mln/accu/stat/min.hh>
+# include <mln/accu/stat/min_h.hh>
# include <mln/norm/l2.hh>
namespace mln
Index: trunk/milena/sandbox/inim/2009/color/min_tree_volume_filter.cc
===================================================================
--- trunk/milena/sandbox/inim/2009/color/min_tree_volume_filter.cc (revision 4006)
+++ trunk/milena/sandbox/inim/2009/color/min_tree_volume_filter.cc (revision 4007)
@@ -22,7 +22,7 @@
# include <mln/io/ppm/load.hh>
# include <mln/io/ppm/save.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/fun/i2v/array.hh>
# include <mln/fun/p2v/iota.hh>
Index: trunk/milena/sandbox/inim/2009/color/reference.cc
===================================================================
--- trunk/milena/sandbox/inim/2009/color/reference.cc (revision 4006)
+++ trunk/milena/sandbox/inim/2009/color/reference.cc (revision 4007)
@@ -22,7 +22,7 @@
# include <mln/io/ppm/load.hh>
# include <mln/io/ppm/save.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/accu/mean.hh>
# include <mln/fun/i2v/array.hh>
@@ -216,7 +216,7 @@
{
mln_concrete(I) output;
initialize(output, input);
- accu::min_max<mln_value(I)> mm;
+ accu::stat::min_max<mln_value(I)> mm;
mln_piter(I) p(input.domain());
mln_niter(N) n(nbh, p);
Index: trunk/milena/sandbox/inim/2009/color/min_tree_area_filter.cc
===================================================================
--- trunk/milena/sandbox/inim/2009/color/min_tree_area_filter.cc (revision 4006)
+++ trunk/milena/sandbox/inim/2009/color/min_tree_area_filter.cc (revision 4007)
@@ -23,7 +23,7 @@
# include <mln/io/ppm/load.hh>
# include <mln/io/ppm/save.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/fun/i2v/array.hh>
# include <mln/fun/p2v/iota.hh>
Index: trunk/milena/sandbox/inim/2009/color/min_tree_height_filter.cc
===================================================================
--- trunk/milena/sandbox/inim/2009/color/min_tree_height_filter.cc (revision 4006)
+++ trunk/milena/sandbox/inim/2009/color/min_tree_height_filter.cc (revision 4007)
@@ -22,7 +22,7 @@
# include <mln/io/ppm/load.hh>
# include <mln/io/ppm/save.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/fun/i2v/array.hh>
# include <mln/fun/p2v/iota.hh>
Index: trunk/milena/sandbox/inim/2009/color/min_tree_color.cc
===================================================================
--- trunk/milena/sandbox/inim/2009/color/min_tree_color.cc (revision 4006)
+++ trunk/milena/sandbox/inim/2009/color/min_tree_color.cc (revision 4007)
@@ -23,7 +23,7 @@
# include <mln/io/ppm/load.hh>
# include <mln/io/ppm/save.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/fun/i2v/array.hh>
# include <mln/fun/p2v/iota.hh>
Index: trunk/milena/sandbox/inim/2009/color/reference2.cc
===================================================================
--- trunk/milena/sandbox/inim/2009/color/reference2.cc (revision 4006)
+++ trunk/milena/sandbox/inim/2009/color/reference2.cc (revision 4007)
@@ -22,7 +22,7 @@
# include <mln/io/ppm/load.hh>
# include <mln/io/ppm/save.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/accu/mean.hh>
# include <mln/fun/i2v/array.hh>
@@ -199,7 +199,7 @@
{
mln_concrete(I) output;
initialize(output, input);
- accu::min_max<mln_value(I)> mm;
+ accu::stat::min_max<mln_value(I)> mm;
mln_piter(I) p(input.domain());
mln_niter(N) n(nbh, p);
Index: trunk/milena/sandbox/inim/2009/color/min_tree_color_v2.cc
===================================================================
--- trunk/milena/sandbox/inim/2009/color/min_tree_color_v2.cc (revision 4006)
+++ trunk/milena/sandbox/inim/2009/color/min_tree_color_v2.cc (revision 4007)
@@ -22,7 +22,7 @@
# include <mln/io/ppm/load.hh>
# include <mln/io/ppm/save.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/fun/i2v/array.hh>
# include <mln/fun/p2v/iota.hh>
Index: trunk/milena/sandbox/theo/exec/color_internal_gradient.cc
===================================================================
--- trunk/milena/sandbox/theo/exec/color_internal_gradient.cc (revision 4006)
+++ trunk/milena/sandbox/theo/exec/color_internal_gradient.cc (revision 4007)
@@ -8,7 +8,7 @@
#include <mln/accu/image/take.hh>
#include <mln/accu/image/to_result.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/max.hh>
@@ -124,7 +124,7 @@
image2d<rgb8> ima;
io::ppm::load(ima, argv[1]);
- typedef accu::max<int_u8> A;
+ typedef accu::stat::max<int_u8> A;
image2d<A> grad(ima.domain());
using morpho::elementary::gradient_internal;
Index: trunk/milena/sandbox/theo/browsing/fwd.cc
===================================================================
--- trunk/milena/sandbox/theo/browsing/fwd.cc (revision 4006)
+++ trunk/milena/sandbox/theo/browsing/fwd.cc (revision 4007)
@@ -1,8 +1,8 @@
# include <mln/core/image/image2d.hh>
# include <mln/core/alias/window2d.hh>
# include <mln/value/int_u8.hh>
-# include <mln/accu/min_h.hh>
-# include <mln/accu/max_h.hh>
+# include <mln/accu/stat/min_h.hh>
+# include <mln/accu/stat/max_h.hh>
# include <mln/opt/at.hh>
# include <mln/debug/println.hh>
@@ -490,7 +490,7 @@
point2d p_start(0, 0);
line_inc(0, // dir
ima, p_start, ima.ncols(),
- accu::min_h<int_u8>(), 4, // half
+ accu::stat::min_h<int_u8>(), 4, // half
out);
debug::println(out);
Index: trunk/milena/sandbox/theo/esiee/slides_2009_may/dilation.hh
===================================================================
--- trunk/milena/sandbox/theo/esiee/slides_2009_may/dilation.hh (revision 4006)
+++ trunk/milena/sandbox/theo/esiee/slides_2009_may/dilation.hh (revision 4007)
@@ -1,7 +1,7 @@
#include <mln/pw/image.hh>
#include <mln/convert/to_fun.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/max.hh>
namespace mln
Index: trunk/milena/sandbox/theo/esiee/laurent/presentation/wst_edge.cc
===================================================================
--- trunk/milena/sandbox/theo/esiee/laurent/presentation/wst_edge.cc (revision 4006)
+++ trunk/milena/sandbox/theo/esiee/laurent/presentation/wst_edge.cc (revision 4007)
@@ -21,7 +21,7 @@
# include <mln/value/rgb8.hh>
# include <mln/io/ppm/save.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/accu/mean.hh>
# include <mln/fun/i2v/array.hh>
@@ -142,7 +142,7 @@
{
mln_concrete(I) output;
initialize(output, input);
- accu::min_max<mln_value(I)> mm;
+ accu::stat::min_max<mln_value(I)> mm;
mln_piter(I) p(input.domain());
mln_niter(N) n(nbh, p);
@@ -165,7 +165,7 @@
mln_concrete(I) output;
initialize(output, input);
- accu::max<V> m;
+ accu::stat::max<V> m;
mln_piter(I) p(input.domain());
mln_niter(N) n(nbh, p);
Index: trunk/milena/sandbox/theo/esiee/laurent/presentation/wst2d.cc
===================================================================
--- trunk/milena/sandbox/theo/esiee/laurent/presentation/wst2d.cc (revision 4006)
+++ trunk/milena/sandbox/theo/esiee/laurent/presentation/wst2d.cc (revision 4007)
@@ -20,7 +20,7 @@
# include <mln/morpho/closing_area.hh>
# include <mln/morpho/gradient.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/morpho/meyer_wst.hh>
@@ -40,7 +40,7 @@
mln_concrete(I) output;
initialize(output, input);
- accu::min_max<mln_value(I)> mm;
+ accu::stat::min_max<mln_value(I)> mm;
mln_piter(I) p(input.domain());
mln_niter(N) n(nbh, p);
Index: trunk/milena/sandbox/theo/esiee/laurent/presentation/classif.cc
===================================================================
--- trunk/milena/sandbox/theo/esiee/laurent/presentation/classif.cc (revision 4006)
+++ trunk/milena/sandbox/theo/esiee/laurent/presentation/classif.cc (revision 4007)
@@ -294,7 +294,7 @@
| Complex-based image iterators. |
`--------------------------------*/
- accu::max<unsigned> dist_max;
+ accu::stat::max<unsigned> dist_max;
// For each edge (1-face), compute the distance between the two
// adjacent vertices (0-faces).
Index: trunk/milena/sandbox/theo/esiee/laurent/ismm09/pseudo_tree.hh
===================================================================
--- trunk/milena/sandbox/theo/esiee/laurent/ismm09/pseudo_tree.hh (revision 4006)
+++ trunk/milena/sandbox/theo/esiee/laurent/ismm09/pseudo_tree.hh (revision 4007)
@@ -19,7 +19,7 @@
#include <mln/io/pgm/save.hh>
#include <mln/data/stretch.hh>
#include <mln/data/compute.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/max.hh>
@@ -554,7 +554,7 @@
// Outputing.
{
- A aa_max = data::compute(accu::max<A>(), aa);
+ A aa_max = data::compute(accu::stat::max<A>(), aa);
using value::int_u8;
if (aa_max < 256)
{
Index: trunk/milena/sandbox/theo/cs2d/cs2d_morpho.hh
===================================================================
--- trunk/milena/sandbox/theo/cs2d/cs2d_morpho.hh (revision 4006)
+++ trunk/milena/sandbox/theo/cs2d/cs2d_morpho.hh (revision 4007)
@@ -1,5 +1,5 @@
-# include <mln/accu/max.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/max.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/labeling/regional_minima.hh>
# include <mln/core/site_set/p_queue_fast.hh>
@@ -45,7 +45,7 @@
mln_concrete(I) output;
initialize(output, input);
- accu::min_max<mln_value(I)> m;
+ accu::stat::min_max<mln_value(I)> m;
mln_piter(I) p(input.domain());
mln_niter(N) n(nbh, p);
Index: trunk/milena/sandbox/theo/dmap.cc
===================================================================
--- trunk/milena/sandbox/theo/dmap.cc (revision 4006)
+++ trunk/milena/sandbox/theo/dmap.cc (revision 4007)
@@ -5,7 +5,7 @@
#include <mln/debug/println.hh>
#include <mln/data/fill.hh>
#include <mln/data/stretch.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/max.hh>
#include <mln/io/pbm/load.hh>
#include <mln/io/pgm/save.hh>
#include <mln/opt/at.hh>
@@ -29,7 +29,7 @@
initialize(distance, input);
// Mod determination.
- accu::max<unsigned> max;
+ accu::stat::max<unsigned> max;
for (unsigned i = 0; i < win.size(); ++i)
max.take(win.w(i));
unsigned mod = unsigned(max) + 1;
Index: trunk/milena/sandbox/theo/csi/fred.cc
===================================================================
--- trunk/milena/sandbox/theo/csi/fred.cc (revision 4006)
+++ trunk/milena/sandbox/theo/csi/fred.cc (revision 4007)
@@ -81,7 +81,7 @@
}
// The "meta-fun -> fun" code is similar to the one in
- // mln/accu/min.hh
+ // mln/accu/stat/min.hh
template <typename T>
struct with
{
Index: trunk/milena/sandbox/edwin/tree/propagation.cc
===================================================================
--- trunk/milena/sandbox/edwin/tree/propagation.cc (revision 4006)
+++ trunk/milena/sandbox/edwin/tree/propagation.cc (revision 4007)
@@ -1,7 +1,7 @@
#include <iostream>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/max.hh>
#include <mln/util/pix.hh>
#include <mln/core/image/image2d.hh>
Index: trunk/milena/sandbox/edwin/exec/color_internal_gradient.hh
===================================================================
--- trunk/milena/sandbox/edwin/exec/color_internal_gradient.hh (revision 4006)
+++ trunk/milena/sandbox/edwin/exec/color_internal_gradient.hh (revision 4007)
@@ -37,7 +37,7 @@
#include <mln/accu/image/take.hh>
#include <mln/accu/image/to_result.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/max.hh>
namespace mln
{
@@ -127,7 +127,7 @@
image2d<value::int_u8>
color_internal_gradient(const image2d<value::rgb8>& input)
{
- typedef accu::max< value::int_u8 > A;
+ typedef accu::stat::max< value::int_u8 > A;
image2d<A> grad(input.domain());
using morpho::elementary::gradient_internal;
Index: trunk/milena/sandbox/folio/test/dt/naive.cc
===================================================================
--- trunk/milena/sandbox/folio/test/dt/naive.cc (revision 4006)
+++ trunk/milena/sandbox/folio/test/dt/naive.cc (revision 4007)
@@ -37,7 +37,7 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/function.hh>
# include <mln/literal/zero.hh>
-# include <mln/accu/min.hh>
+# include <mln/accu/stat/min.hh>
namespace mln
{
Index: trunk/milena/sandbox/folio/mln/dt/canvas_dt.hh
===================================================================
--- trunk/milena/sandbox/folio/mln/dt/canvas_dt.hh (revision 4006)
+++ trunk/milena/sandbox/folio/mln/dt/canvas_dt.hh (revision 4007)
@@ -97,7 +97,7 @@
initialize(distance, f.input);
// Mod determination.
- mln::accu::max<unsigned> accu;
+ mln::accu::stat::max<unsigned> accu;
mln_fwd_piter(I) p(f.input.domain());
mln_qiter(N) n(f.nbh, p);
for_all(n)
Index: trunk/milena/sandbox/folio/mln/dt/raw_path_fast.hh
===================================================================
--- trunk/milena/sandbox/folio/mln/dt/raw_path_fast.hh (revision 4006)
+++ trunk/milena/sandbox/folio/mln/dt/raw_path_fast.hh (revision 4007)
@@ -36,7 +36,7 @@
# include <mln/make/w_window.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/literal/zero.hh>
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/max.hh>
# include <iostream>
Index: trunk/milena/sandbox/folio/mln/dt/dt_old/naive.cc
===================================================================
--- trunk/milena/sandbox/folio/mln/dt/dt_old/naive.cc (revision 4006)
+++ trunk/milena/sandbox/folio/mln/dt/dt_old/naive.cc (revision 4007)
@@ -37,7 +37,7 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/function.hh>
# include <mln/literal/zero.hh>
-# include <mln/accu/min.hh>
+# include <mln/accu/stat/min.hh>
namespace mln
{
Index: trunk/milena/sandbox/folio/mln/dt/dt_old/distance_front_new.hh
===================================================================
--- trunk/milena/sandbox/folio/mln/dt/dt_old/distance_front_new.hh (revision 4006)
+++ trunk/milena/sandbox/folio/mln/dt/dt_old/distance_front_new.hh (revision 4007)
@@ -37,7 +37,7 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/concept/weighted_window.hh>
# include <mln/data/fill.hh>
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/max.hh>
# include <mln/extension/adjust_fill.hh>
@@ -132,7 +132,7 @@
// Mod determination.
unsigned mod;
{
- accu::max<unsigned> m;
+ accu::stat::max<unsigned> m;
for (unsigned i = 0; i < w_win.size(); ++i)
m.take(w_win.w(i));
mod = unsigned(m) + 1;
@@ -244,7 +244,7 @@
// Mod determination.
unsigned mod;
{
- accu::max<unsigned> m;
+ accu::stat::max<unsigned> m;
for (unsigned i = 0; i < w_win.size(); ++i)
m.take(w_win.w(i));
mod = unsigned(m) + 1;
Index: trunk/milena/sandbox/folio/mln/dt/raw_cp_fast.hh
===================================================================
--- trunk/milena/sandbox/folio/mln/dt/raw_cp_fast.hh (revision 4006)
+++ trunk/milena/sandbox/folio/mln/dt/raw_cp_fast.hh (revision 4007)
@@ -36,7 +36,7 @@
# include <mln/make/w_window.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/literal/zero.hh>
-# include <mln/accu/max.hh>
+# include <mln/accu/stat/max.hh>
# include <iostream>
Index: trunk/milena/tests/data/compute_full.cc
===================================================================
--- trunk/milena/tests/data/compute_full.cc (revision 4006)
+++ trunk/milena/tests/data/compute_full.cc (revision 4007)
@@ -43,8 +43,8 @@
#include <mln/core/image/dmorph/image_if.hh>
#include <mln/fun/p2b/chess.hh>
-#include <mln/accu/min.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/min.hh>
+#include <mln/accu/stat/max.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
#include <mln/data/compute.hh>
@@ -113,8 +113,8 @@
{
- accu::min<I> acu_min;
- accu::max<I> acu_max;
+ accu::stat::min<I> acu_min;
+ accu::stat::max<I> acu_max;
I min = data::compute(acu_min, ima);
I max = data::compute(acu_max, ima);
@@ -125,8 +125,8 @@
{
sub_image<image1d<I>, box1d> sub_ima (ima, b1);
- accu::min<I> acu_min;
- accu::max<I> acu_max;
+ accu::stat::min<I> acu_min;
+ accu::stat::max<I> acu_max;
I min = data::compute(acu_min, sub_ima);
I max = data::compute(acu_max, sub_ima);
@@ -138,8 +138,8 @@
f_box1d_t f_b(b1);
image_if<image1d<I>, f_box1d_t> if_ima(ima, f_b);
- accu::min<I> acu_min;
- accu::max<I> acu_max;
+ accu::stat::min<I> acu_min;
+ accu::stat::max<I> acu_max;
I min = data::compute(acu_min, if_ima);
I max = data::compute(acu_max, if_ima);
@@ -173,8 +173,8 @@
}
{
- accu::min<I> acu_min;
- accu::max<I> acu_max;
+ accu::stat::min<I> acu_min;
+ accu::stat::max<I> acu_max;
I min = data::compute(acu_min, ima);
I max = data::compute(acu_max, ima);
@@ -203,8 +203,8 @@
else
real_max = (I)(slis * rows * cols);
{
- accu::min<I> acu_min;
- accu::max<I> acu_max;
+ accu::stat::min<I> acu_min;
+ accu::stat::max<I> acu_max;
I min = data::compute(acu_min, ima);
I max = data::compute(acu_max, ima);
Index: trunk/milena/tests/data/compute.cc
===================================================================
--- trunk/milena/tests/data/compute.cc (revision 4006)
+++ trunk/milena/tests/data/compute.cc (revision 4007)
@@ -33,8 +33,8 @@
#include <mln/core/image/image2d.hh>
#include <mln/data/compute.hh>
#include <mln/debug/iota.hh>
-#include <mln/accu/min.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/min.hh>
+#include <mln/accu/stat/max.hh>
int main()
@@ -45,11 +45,11 @@
image2d<int> ima(size, size);
debug::iota(ima);
- accu::min<int> m;
+ accu::stat::min<int> m;
int min = data::compute(m, ima);
mln_assertion(min == 1);
- accu::max<int> M;
+ accu::stat::max<int> M;
int max = data::compute(M, ima);
mln_assertion(max == 40000);
}
Index: trunk/milena/tests/data/update.cc
===================================================================
--- trunk/milena/tests/data/update.cc (revision 4006)
+++ trunk/milena/tests/data/update.cc (revision 4007)
@@ -34,8 +34,8 @@
#include <mln/data/update.hh>
#include <mln/data/compare.hh>
#include <mln/debug/iota.hh>
-#include <mln/accu/min.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/min.hh>
+#include <mln/accu/stat/max.hh>
int main()
@@ -44,8 +44,8 @@
const unsigned size = 200;
image2d<int> ima(size, size);
- accu::min<int> m;
- accu::max<int> M;
+ accu::stat::min<int> m;
+ accu::stat::max<int> M;
debug::iota(ima);
data::update(m, ima);
Index: trunk/milena/tests/accu/max_h.cc (deleted)
===================================================================
Index: trunk/milena/tests/accu/min.cc (deleted)
===================================================================
Index: trunk/milena/tests/accu/max.cc (deleted)
===================================================================
Index: trunk/milena/tests/accu/min_max.cc (deleted)
===================================================================
Index: trunk/milena/tests/accu/min_h.cc (deleted)
===================================================================
Index: trunk/milena/tests/accu/pair.cc
===================================================================
--- trunk/milena/tests/accu/pair.cc (revision 4006)
+++ trunk/milena/tests/accu/pair.cc (revision 4007)
@@ -34,7 +34,7 @@
#include <mln/value/int_u8.hh>
#include <mln/accu/pair.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/max.hh>
#include <mln/accu/mean.hh>
int main()
@@ -42,7 +42,7 @@
using namespace mln;
{
- accu::pair<accu::mean<int>, accu::max<int> > mean;
+ accu::pair<accu::mean<int>, accu::stat::max<int> > mean;
mean.take(10);
mean.take(9);
Index: trunk/milena/tests/accu/Makefile.am
===================================================================
--- trunk/milena/tests/accu/Makefile.am (revision 4006)
+++ trunk/milena/tests/accu/Makefile.am (revision 4007)
@@ -14,14 +14,9 @@
count \
histo \
line \
- max \
- max_h \
max_site \
mean \
median_h \
- min \
- min_h \
- min_max \
nil \
pair \
rank \
@@ -38,14 +33,9 @@
count_SOURCES = count.cc
histo_SOURCES = histo.cc
line_SOURCES = line.cc
-max_SOURCES = max.cc
-max_h_SOURCES = max_h.cc
max_site_SOURCES = max_site.cc
mean_SOURCES = mean.cc
median_h_SOURCES = median_h.cc
-min_SOURCES = min.cc
-min_h_SOURCES = min_h.cc
-min_max_SOURCES = min_max.cc
nil_SOURCES = nil.cc
pair_SOURCES = pair.cc
rank_SOURCES = rank.cc
Index: trunk/milena/tests/accu/all_accus.cc
===================================================================
--- trunk/milena/tests/accu/all_accus.cc (revision 4006)
+++ trunk/milena/tests/accu/all_accus.cc (revision 4007)
@@ -43,14 +43,14 @@
bbox<point2d> b;
count<int> c;
mln::accu::histo<bool> h;
- max<int> ma;
+ stat::max<int> ma;
mean<int> me;
// median< value::set<bool> > med; // FIXME: bool has no min so
workaround!
- min<int> mi;
+ stat::min<int> mi;
// min_h< value::set<bool> > mh; // OK: do not work since bool has
// no min/max :)
- min_max<int> mm;
+ stat::min_max<int> mm;
nil<int> n;
- pair< min<int>, max<int> > p;
+ pair< stat::min<int>, stat::max<int> > p;
sum<int> s;
}
Index: trunk/milena/tests/accu/stat/max_h.cc
===================================================================
--- trunk/milena/tests/accu/stat/max_h.cc (revision 0)
+++ trunk/milena/tests/accu/stat/max_h.cc (revision 4007)
@@ -0,0 +1,62 @@
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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.
+
+/*! \file tests/accu/max_h.cc
+ *
+ * \brief Tests on mln::accu::max_h.
+ */
+
+#include <mln/value/int_u8.hh>
+#include <mln/accu/stat/max_h.hh>
+
+
+int main()
+{
+ using namespace mln;
+ using namespace mln::value;
+
+ accu::stat::max_h<int_u8> a;
+
+ a.take(1);
+ a.take(1);
+ a.take(1);
+
+ a.take(2);
+ a.take(2);
+ a.take(2);
+ a.take(2);
+ a.take(2);
+ a.take(2);
+
+ a.take(234);
+ a.take(234);
+ a.take(234);
+ a.take(234);
+ a.take(234);
+ a.take(234);
+ mln_assertion(a.to_result() == 234u);
+}
Property changes on: trunk/milena/tests/accu/stat/max_h.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/tests/accu/stat/min.cc
===================================================================
--- trunk/milena/tests/accu/stat/min.cc (revision 0)
+++ trunk/milena/tests/accu/stat/min.cc (revision 4007)
@@ -0,0 +1,54 @@
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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.
+
+/*! \file tests/accu/min.cc
+ *
+ * \brief Tests on mln::accu::min.
+ */
+
+#include <mln/core/image/image2d.hh>
+#include <mln/debug/iota.hh>
+
+#include <mln/accu/nil.hh>
+#include <mln/accu/stat/min.hh>
+#include <mln/accu/p.hh>
+#include <mln/accu/v.hh>
+#include <mln/accu/compute.hh>
+
+#include <mln/data/compute.hh>
+
+
+int main()
+{
+ using namespace mln;
+ image2d<int> ima(3, 3);
+ debug::iota(ima);
+ mln_assertion(data::compute(accu::meta::stat::min(), ima) == 1);
+
+ accu::stat::min<int> m;
+ mln_assertion(data::compute(m, ima) == 1);
+}
Property changes on: trunk/milena/tests/accu/stat/min.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/tests/accu/stat/Makefile.am
===================================================================
--- trunk/milena/tests/accu/stat/Makefile.am (revision 4006)
+++ trunk/milena/tests/accu/stat/Makefile.am (revision 4007)
@@ -3,8 +3,18 @@
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
- var
+ var \
+ min \
+ min_h \
+ min_max \
+ max \
+ max_h
var_SOURCES = var.cc
+min_SOURCES = min.cc
+min_h_SOURCES = min_h.cc
+max_SOURCES = max.cc
+max_h_SOURCES = max_h.cc
+min_max_SOURCES = min_max.cc
TESTS = $(check_PROGRAMS)
Index: trunk/milena/tests/accu/stat/max.cc
===================================================================
--- trunk/milena/tests/accu/stat/max.cc (revision 0)
+++ trunk/milena/tests/accu/stat/max.cc (revision 4007)
@@ -0,0 +1,55 @@
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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.
+
+/// \file tests/accu/max.cc
+///
+/// Tests on mln::accu::max.
+
+#include <mln/core/image/image2d.hh>
+#include <mln/debug/iota.hh>
+
+#include <mln/accu/nil.hh>
+#include <mln/accu/stat/max.hh>
+#include <mln/accu/p.hh>
+#include <mln/accu/v.hh>
+#include <mln/accu/compute.hh>
+
+#include <mln/data/compute.hh>
+
+
+int main()
+{
+ using namespace mln;
+ image2d<int> ima(3, 3);
+ debug::iota(ima);
+ mln_assertion(data::compute(accu::meta::stat::max(), ima) == 9);
+ accu::stat::max<int> M;
+ mln_assertion(data::compute(M, ima) == 9);
+
+ // mln::trait::accumulator::print(M);
+}
Property changes on: trunk/milena/tests/accu/stat/max.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/tests/accu/stat/min_max.cc
===================================================================
--- trunk/milena/tests/accu/stat/min_max.cc (revision 0)
+++ trunk/milena/tests/accu/stat/min_max.cc (revision 4007)
@@ -0,0 +1,71 @@
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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.
+
+/*! \file tests/accu/min_max.cc
+ *
+ * \brief Tests on mln::accu::stat::min_max.
+ */
+
+// FIXME : This test doesn't compile without this include.
+#include <mln/value/builtin/integers.hh>
+
+#include <mln/accu/stat/min_max.hh>
+
+int main()
+{
+ using namespace mln;
+
+ {
+ mln_accu_with_(accu::meta::stat::min_max, int) accu;
+
+ accu.take(7);
+
+ mln_assertion(accu.to_result().first == 7);
+ mln_assertion(accu.to_result().second == 7);
+ }
+
+ {
+ mln_accu_with_(accu::meta::stat::min_max, int) accu;
+
+ accu.take(2);
+ accu.take(1);
+ accu.take(0);
+
+ accu.take(6);
+ accu.take(5);
+ accu.take(4);
+ accu.take(3);
+
+ accu.take(10);
+ accu.take(9);
+ accu.take(8);
+ accu.take(7);
+
+ mln_assertion(accu.first() == 0);
+ mln_assertion(accu.second() == 10);
+ }
+}
Property changes on: trunk/milena/tests/accu/stat/min_max.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/tests/accu/stat/min_h.cc
===================================================================
--- trunk/milena/tests/accu/stat/min_h.cc (revision 0)
+++ trunk/milena/tests/accu/stat/min_h.cc (revision 4007)
@@ -0,0 +1,64 @@
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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.
+
+/*! \file tests/accu/min_h.cc
+ *
+ * \brief Tests on mln::accu::min_h.
+ */
+
+#include <mln/value/int_u8.hh>
+#include <mln/accu/stat/min_h.hh>
+
+
+
+
+int main()
+{
+ using namespace mln;
+ using namespace mln::value;
+
+ accu::stat::min_h<int_u8> a;
+
+ a.take(42);
+ a.take(42);
+ a.take(42);
+
+ a.take(200);
+ a.take(200);
+ a.take(200);
+ a.take(200);
+ a.take(200);
+ a.take(200);
+
+ a.take(234);
+ a.take(234);
+ a.take(234);
+ a.take(234);
+ a.take(234);
+ a.take(234);
+ mln_assertion(a.to_result() == 42u);
+}
Property changes on: trunk/milena/tests/accu/stat/min_h.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/tests/accu/line.cc
===================================================================
--- trunk/milena/tests/accu/line.cc (revision 4006)
+++ trunk/milena/tests/accu/line.cc (revision 4007)
@@ -31,7 +31,7 @@
*/
#include <mln/accu/line.hh>
-#include <mln/accu/min_h.hh>
+#include <mln/accu/stat/min_h.hh>
#include <mln/core/image/image2d.hh>
#include <mln/data/compare.hh>
@@ -50,7 +50,7 @@
I out(ima.domain());
point2d p_start(0, 0);
- accu::line< accu::meta::min_h, 1 >(ima,
+ accu::line< accu::meta::stat::min_h, 1 >(ima,
p_start, ima.ncols(),
0, // half_length
out);
Index: trunk/milena/tests/accu/tuple.cc
===================================================================
--- trunk/milena/tests/accu/tuple.cc (revision 4006)
+++ trunk/milena/tests/accu/tuple.cc (revision 4007)
@@ -37,8 +37,8 @@
#include <mln/accu/tuple.hh>
#include <mln/accu/count.hh>
-#include <mln/accu/max.hh>
-#include <mln/accu/min.hh>
+#include <mln/accu/stat/max.hh>
+#include <mln/accu/stat/min.hh>
#include <mln/accu/mean.hh>
@@ -46,7 +46,7 @@
{
using namespace mln;
- typedef accu::tuple<int, 4, accu::count<int>, accu::max<int>,
accu::min<int>, accu::mean<int> > teratuple;
+ typedef accu::tuple<int, 4, accu::count<int>, accu::stat::max<int>,
accu::stat::min<int>, accu::mean<int> > teratuple;
teratuple tuple1;
teratuple tuple2;
Index: trunk/milena/tests/estim/min_max.cc
===================================================================
--- trunk/milena/tests/estim/min_max.cc (revision 4006)
+++ trunk/milena/tests/estim/min_max.cc (revision 4007)
@@ -33,8 +33,8 @@
#include <mln/core/image/image2d.hh>
#include <mln/estim/min_max.hh>
#include <mln/debug/iota.hh>
-#include <mln/accu/min.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/min.hh>
+#include <mln/accu/stat/max.hh>
int main()
Index: trunk/milena/tests/morpho/closing/area.cc
===================================================================
--- trunk/milena/tests/morpho/closing/area.cc (revision 4006)
+++ trunk/milena/tests/morpho/closing/area.cc (revision 4007)
@@ -36,7 +36,7 @@
#include <mln/value/int_u8.hh>
#include <mln/io/pgm/load.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/max.hh>
#include <mln/data/compute.hh>
#include <mln/data/compare.hh>
#include <mln/pw/cst.hh>
@@ -57,6 +57,6 @@
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
clo = morpho::closing::area(lena, c4(), lena.nrows() * lena.ncols());
- int_u8 m = data::compute(accu::max<int_u8>(), lena);
+ int_u8 m = data::compute(accu::stat::max<int_u8>(), lena);
mln_assertion(clo == (pw::cst(m) | lena.domain()));
}
Index: trunk/milena/apps/statues/mesh-max-curv.cc
===================================================================
--- trunk/milena/apps/statues/mesh-max-curv.cc (revision 4006)
+++ trunk/milena/apps/statues/mesh-max-curv.cc (revision 4007)
@@ -40,7 +40,7 @@
#include <mln/math/max.hh>
#include <mln/math/sqr.hh>
-#include <mln/accu/min_max.hh>
+#include <mln/accu/stat/min_max.hh>
#include <mln/fun/v2v/linear.hh>
#include "io.hh"
@@ -81,7 +81,7 @@
// For each face of the mesh, computean an average curvature value
// from the mean curvature at its vertices.
std::vector<float> face_m(mesh.faces.size(), 0.f);
- mln::accu::min_max<float> acc;
+ mln::accu::stat::min_max<float> acc;
for (unsigned f = 0; f < mesh.faces.size(); ++f)
{
float m = (vertex_m[mesh.faces[f][0]] +
Index: trunk/milena/apps/statues/mesh-complex-max-curv.cc
===================================================================
--- trunk/milena/apps/statues/mesh-complex-max-curv.cc (revision 4006)
+++ trunk/milena/apps/statues/mesh-complex-max-curv.cc (revision 4007)
@@ -44,7 +44,7 @@
#include <mln/math/max.hh>
#include <mln/math/sqr.hh>
-#include <mln/accu/min_max.hh>
+#include <mln/accu/stat/min_max.hh>
#include <mln/fun/v2v/linear.hh>
#include <mln/data/transform.hh>
@@ -114,7 +114,7 @@
/* FIXME: Not really user friendly! The `m' value should pass at
the construction of ADJ_V. */
adj_v.iter().set_m(0);
- mln::accu::min_max<float> acc;
+ mln::accu::stat::min_max<float> acc;
// Iterate on triangles (2-faces).
for_all(t)
{
Index: trunk/milena/doc/examples/trash/tuto_bis.cc
===================================================================
--- trunk/milena/doc/examples/trash/tuto_bis.cc (revision 4006)
+++ trunk/milena/doc/examples/trash/tuto_bis.cc (revision 4007)
@@ -12,7 +12,7 @@
# include <mln/core/site_set/p_centered.hh>
# include <mln/literal/origin.hh>
-# include <mln/accu/min_max.hh>
+# include <mln/accu/stat/min_max.hh>
# include <mln/accu/mean.hh>
# include <mln/fun/i2v/array.hh>
Index: trunk/milena/doc/examples/tuto4_genericity_and_algorithms.cc
===================================================================
--- trunk/milena/doc/examples/tuto4_genericity_and_algorithms.cc (revision 4006)
+++ trunk/milena/doc/examples/tuto4_genericity_and_algorithms.cc (revision 4007)
@@ -9,7 +9,7 @@
#include <mln/extract/green.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/max.hh>
#include <mln/geom/all.hh>
Index: trunk/milena/doc/examples/accu-right-instanciation.cc
===================================================================
--- trunk/milena/doc/examples/accu-right-instanciation.cc (revision 4006)
+++ trunk/milena/doc/examples/accu-right-instanciation.cc (revision 4007)
@@ -4,7 +4,7 @@
#include <mln/data/compute.hh>
-#include <mln/accu/max.hh>
+#include <mln/accu/stat/max.hh>
int main()
{
@@ -13,6 +13,6 @@
image2d<value::int_u8> ima(2, 3);
// \{
- data::compute(accu::meta::max(), ima);
+ data::compute(accu::meta::stat::max(), ima);
// \}
}