* box.ixx,
* box2d.i,
* box2d_piter.i,
* box_piter.ixx,
* ch_value.ixx,
* concat.ixx,
* concrete.ixx,
* coord.ixx,
* dpoint2d.i,
* dynamic_image2d.i,
* fill.ixx,
* image2d.ixx,
* image2d_int.i,
* image2d_int_u8.i,
* int_u.ixx,
* int_u32.i,
* int_u8.i,
* intp.ixx,
* morpho.ixx,
* neighb2d.i,
* pgm.ixx,
* point2d.i,
* println.ixx,
* python-utils.ixx,
* window2d.i,
* python/box2d-misc.py,
* python/data.py,
* python/dynamic-image2d-misc.py,
* python/image2d-misc.py,
* python/morpho-fun.py,
* python/morpho-segm.py,
* python/sps-common.in,
* python/sps.py,
* python/swilena.py:
Remove the special exception (irrelevant for Swilena).
---
swilena/ChangeLog | 40 ++++++++++++++++++++++++++++++++
swilena/box.ixx | 10 --------
swilena/box2d.i | 10 --------
swilena/box2d_piter.i | 10 --------
swilena/box_piter.ixx | 10 --------
swilena/ch_value.ixx | 10 --------
swilena/concat.ixx | 10 --------
swilena/concrete.ixx | 10 --------
swilena/coord.ixx | 10 --------
swilena/dpoint2d.i | 10 --------
swilena/dynamic_image2d.i | 10 --------
swilena/fill.ixx | 10 --------
swilena/image2d.ixx | 10 --------
swilena/image2d_int.i | 10 --------
swilena/image2d_int_u8.i | 10 --------
swilena/int_u.ixx | 10 --------
swilena/int_u32.i | 10 --------
swilena/int_u8.i | 10 --------
swilena/intp.ixx | 10 --------
swilena/morpho.ixx | 10 --------
swilena/neighb2d.i | 10 --------
swilena/pgm.ixx | 10 --------
swilena/point2d.i | 10 --------
swilena/println.ixx | 10 --------
swilena/python-utils.ixx | 10 --------
swilena/python/box2d-misc.py | 10 --------
swilena/python/data.py | 10 --------
swilena/python/dynamic-image2d-misc.py | 11 --------
swilena/python/image2d-misc.py | 10 --------
swilena/python/morpho-fun.py | 10 --------
swilena/python/morpho-segm.py | 10 --------
swilena/python/sps-common.in | 10 --------
swilena/python/sps.py | 10 --------
swilena/python/swilena.py | 10 --------
swilena/window2d.i | 10 --------
35 files changed, 40 insertions(+), 341 deletions(-)
diff --git a/swilena/ChangeLog b/swilena/ChangeLog
index 866e2dc..c2de3c5 100644
--- a/swilena/ChangeLog
+++ b/swilena/ChangeLog
@@ -1,3 +1,43 @@
+2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Fix Swilena's copyright headers.
+
+ * box.ixx,
+ * box2d.i,
+ * box2d_piter.i,
+ * box_piter.ixx,
+ * ch_value.ixx,
+ * concat.ixx,
+ * concrete.ixx,
+ * coord.ixx,
+ * dpoint2d.i,
+ * dynamic_image2d.i,
+ * fill.ixx,
+ * image2d.ixx,
+ * image2d_int.i,
+ * image2d_int_u8.i,
+ * int_u.ixx,
+ * int_u32.i,
+ * int_u8.i,
+ * intp.ixx,
+ * morpho.ixx,
+ * neighb2d.i,
+ * pgm.ixx,
+ * point2d.i,
+ * println.ixx,
+ * python-utils.ixx,
+ * window2d.i,
+ * python/box2d-misc.py,
+ * python/data.py,
+ * python/dynamic-image2d-misc.py,
+ * python/image2d-misc.py,
+ * python/morpho-fun.py,
+ * python/morpho-segm.py,
+ * python/sps-common.in,
+ * python/sps.py,
+ * python/swilena.py:
+ Remove the special exception (irrelevant for Swilena).
+
2009-06-02 Roland Levillain <roland(a)lrde.epita.fr>
Factor box2d.i using box.ixx.
diff --git a/swilena/box.ixx b/swilena/box.ixx
index 98cb9fc..a3af8a1 100644
--- a/swilena/box.ixx
+++ b/swilena/box.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file box.ixx
/// \brief A wrapper of mln::box<P>.
diff --git a/swilena/box2d.i b/swilena/box2d.i
index e36ad03..f491be1 100644
--- a/swilena/box2d.i
+++ b/swilena/box2d.i
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file box2d.i
/// \brief A wrapper of mln::box2d.
diff --git a/swilena/box2d_piter.i b/swilena/box2d_piter.i
index f5ac026..9286342 100644
--- a/swilena/box2d_piter.i
+++ b/swilena/box2d_piter.i
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file box2d_piter.i
/// \brief A wrapper of mln::box_fwd_piter_< mln::point2d >.
diff --git a/swilena/box_piter.ixx b/swilena/box_piter.ixx
index 7b34272..ce81465 100644
--- a/swilena/box_piter.ixx
+++ b/swilena/box_piter.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file box_piter.ixx
/// \brief A wrapper of mln::box_fwd_piter_<P>.
diff --git a/swilena/ch_value.ixx b/swilena/ch_value.ixx
index e48f371..59ac846 100644
--- a/swilena/ch_value.ixx
+++ b/swilena/ch_value.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file ch_value.i
/// \brief A wrapper of mln::trait::ch_value.
diff --git a/swilena/concat.ixx b/swilena/concat.ixx
index bb8c460..93e0bdb 100644
--- a/swilena/concat.ixx
+++ b/swilena/concat.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file concat.ixx
/// \brief Macros concatenating their arguments.
diff --git a/swilena/concrete.ixx b/swilena/concrete.ixx
index 3d78442..c4fc03a 100644
--- a/swilena/concrete.ixx
+++ b/swilena/concrete.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file concrete.i
/// \brief A wrapper of mln::trait::concrete.
diff --git a/swilena/coord.ixx b/swilena/coord.ixx
index 7d45792..2f2d2df 100644
--- a/swilena/coord.ixx
+++ b/swilena/coord.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file coord.ixx
/// \brief A variadic alternative to the macro mln_coord.
diff --git a/swilena/dpoint2d.i b/swilena/dpoint2d.i
index bde8f07..4465bf8 100644
--- a/swilena/dpoint2d.i
+++ b/swilena/dpoint2d.i
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file dpoint2d.i
/// \brief A wrapper of mln::dpoint2d.
diff --git a/swilena/dynamic_image2d.i b/swilena/dynamic_image2d.i
index 2ae3c16..001aac3 100644
--- a/swilena/dynamic_image2d.i
+++ b/swilena/dynamic_image2d.i
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file dynamic_image2d
/// \brief A dynamic version of image2d, extendable in the target language.
diff --git a/swilena/fill.ixx b/swilena/fill.ixx
index 958c5ae..42c8326 100644
--- a/swilena/fill.ixx
+++ b/swilena/fill.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file fill.ixx
/// \brief A wrapper of mln::data::fill.
diff --git a/swilena/image2d.ixx b/swilena/image2d.ixx
index 75f0f3b..f80474d 100644
--- a/swilena/image2d.ixx
+++ b/swilena/image2d.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file image2d.i
/// \brief A wrapper of mln::image2d<T>.
diff --git a/swilena/image2d_int.i b/swilena/image2d_int.i
index 92f3d5e..b86c2b5 100644
--- a/swilena/image2d_int.i
+++ b/swilena/image2d_int.i
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file image2d.i
/// \brief A simple wrapping of mln::image2d<int> along with some
diff --git a/swilena/image2d_int_u8.i b/swilena/image2d_int_u8.i
index b420445..e60587c 100644
--- a/swilena/image2d_int_u8.i
+++ b/swilena/image2d_int_u8.i
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file image2d.i
/// \brief A simple wrapping of mln::image2d<mln::value::int_u8> along
diff --git a/swilena/int_u.ixx b/swilena/int_u.ixx
index 855898f..e69ad2c 100644
--- a/swilena/int_u.ixx
+++ b/swilena/int_u.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file int_u.i
/// \brief A wrapper of mln::value::int_u.
diff --git a/swilena/int_u32.i b/swilena/int_u32.i
index fd88cd2..9fe308a 100644
--- a/swilena/int_u32.i
+++ b/swilena/int_u32.i
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file int_u32.i
/// \brief A wrapper of mln::value::int_u32.
diff --git a/swilena/int_u8.i b/swilena/int_u8.i
index 929af22..a02ff3f 100644
--- a/swilena/int_u8.i
+++ b/swilena/int_u8.i
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file int_u8.i
/// \brief A wrapper of mln::value::int_u8.
diff --git a/swilena/intp.ixx b/swilena/intp.ixx
index add19cf..a4d3449 100644
--- a/swilena/intp.ixx
+++ b/swilena/intp.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file intp.ixx
/// \brief A wrapper of int pointers.
diff --git a/swilena/morpho.ixx b/swilena/morpho.ixx
index 5b90a22..199520b 100644
--- a/swilena/morpho.ixx
+++ b/swilena/morpho.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file morpho.i
/// \brief Wrappers of morphological algorithms from mln::morpho.
diff --git a/swilena/neighb2d.i b/swilena/neighb2d.i
index a5c67b2..3d4461e 100644
--- a/swilena/neighb2d.i
+++ b/swilena/neighb2d.i
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file neighb2d.i
/// \brief A wrapper of mln::neighb2d.
diff --git a/swilena/pgm.ixx b/swilena/pgm.ixx
index a311ad0..2edd6fc 100644
--- a/swilena/pgm.ixx
+++ b/swilena/pgm.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file pgm.ixx
/// \brief A wrapper of mln::io::pgm::load and mln::io::pgm::save
diff --git a/swilena/point2d.i b/swilena/point2d.i
index a07fb50..f181a38 100644
--- a/swilena/point2d.i
+++ b/swilena/point2d.i
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file point2d.i
/// \brief A wrapper of mln::point2d.
diff --git a/swilena/println.ixx b/swilena/println.ixx
index 2765f18..5e2685a 100644
--- a/swilena/println.ixx
+++ b/swilena/println.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file println.ixx
/// \brief A wrapper of mln::debug::println.
diff --git a/swilena/python-utils.ixx b/swilena/python-utils.ixx
index ff11922..a14817b 100644
--- a/swilena/python-utils.ixx
+++ b/swilena/python-utils.ixx
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file python-utils.ixx
/// \brief Utilities for Python wrappers.
diff --git a/swilena/python/box2d-misc.py b/swilena/python/box2d-misc.py
index 7cd3011..afc9f6a 100644
--- a/swilena/python/box2d-misc.py
+++ b/swilena/python/box2d-misc.py
@@ -16,16 +16,6 @@
# 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.
-# reasons why the executable file might be covered by the GNU General
-# Public License.
from swilena import *
diff --git a/swilena/python/data.py b/swilena/python/data.py
index 5fe6136..989bf34 100644
--- a/swilena/python/data.py
+++ b/swilena/python/data.py
@@ -16,16 +16,6 @@
# 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.
-# reasons why the executable file might be covered by the GNU General
-# Public License.
# \file python/data.py
# \brief Access to the data of the distribution (images, meshes, etc.).
diff --git a/swilena/python/dynamic-image2d-misc.py b/swilena/python/dynamic-image2d-misc.py
index 941a929..cc023dc 100644
--- a/swilena/python/dynamic-image2d-misc.py
+++ b/swilena/python/dynamic-image2d-misc.py
@@ -16,21 +16,10 @@
# 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.
-# reasons why the executable file might be covered by the GNU General
-# Public License.
# \file python/dynamic-image2d-misc.py
# \brief Test on C++ ``dynamic'' image2d extended in Python.
-
from swilena import *
import dynamic_image2d
diff --git a/swilena/python/image2d-misc.py b/swilena/python/image2d-misc.py
index e0b2a91..737b39b 100644
--- a/swilena/python/image2d-misc.py
+++ b/swilena/python/image2d-misc.py
@@ -16,16 +16,6 @@
# 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.
-# reasons why the executable file might be covered by the GNU General
-# Public License.
from swilena import *
diff --git a/swilena/python/morpho-fun.py b/swilena/python/morpho-fun.py
index bf96e48..68ba9b6 100644
--- a/swilena/python/morpho-fun.py
+++ b/swilena/python/morpho-fun.py
@@ -16,16 +16,6 @@
# 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.
-# reasons why the executable file might be covered by the GNU General
-# Public License.
# \file python/morpho-fun.py
# \brief Test on mathematical morphology on functions (scalar images).
diff --git a/swilena/python/morpho-segm.py b/swilena/python/morpho-segm.py
index 83af24d..1641b7b 100644
--- a/swilena/python/morpho-segm.py
+++ b/swilena/python/morpho-segm.py
@@ -16,16 +16,6 @@
# 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.
-# reasons why the executable file might be covered by the GNU General
-# Public License.
# \file python/morpho-segm.py
# \brief Test on watershed transform-based segmentation.
diff --git a/swilena/python/sps-common.in b/swilena/python/sps-common.in
index be13cb1..46c3e62 100644
--- a/swilena/python/sps-common.in
+++ b/swilena/python/sps-common.in
@@ -16,16 +16,6 @@
# 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.
-# reasons why the executable file might be covered by the GNU General
-# Public License.
# The Swilena Python Shell.
diff --git a/swilena/python/sps.py b/swilena/python/sps.py
index ef4ab01..9882338 100644
--- a/swilena/python/sps.py
+++ b/swilena/python/sps.py
@@ -16,16 +16,6 @@
# 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.
-# reasons why the executable file might be covered by the GNU General
-# Public License.
from swilena import *
diff --git a/swilena/python/swilena.py b/swilena/python/swilena.py
index 601b6ee..1c7f3e1 100644
--- a/swilena/python/swilena.py
+++ b/swilena/python/swilena.py
@@ -16,16 +16,6 @@
# 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.
-# reasons why the executable file might be covered by the GNU General
-# Public License.
# \file swilena.py
# \brief The whole Swilena suite.
diff --git a/swilena/window2d.i b/swilena/window2d.i
index 68556c6..2642cd0 100644
--- a/swilena/window2d.i
+++ b/swilena/window2d.i
@@ -15,16 +15,6 @@
// 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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
/// \file window2d.i
/// \brief A wrapper of mln::window2d.
--
1.6.2.4
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);
// \}
}
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Add a directory for demos and a 1st demo.
* mln/core/alias/neighb2d.hh (c6_2d): New.
* mln/make/double_neighb2d.hh: Fix sig.
* demos: New directory.
* demos/genericity: New directory.
* demos/genericity/neighborhood.cc: New.
demos/genericity/neighborhood.cc | 99 +++++++++++++++++++++++++++++++++++++++
mln/core/alias/neighb2d.hh | 25 +++++++++
mln/make/double_neighb2d.hh | 9 +--
3 files changed, 127 insertions(+), 6 deletions(-)
Index: mln/core/alias/neighb2d.hh
--- mln/core/alias/neighb2d.hh (revision 4003)
+++ mln/core/alias/neighb2d.hh (working copy)
@@ -31,16 +31,17 @@
/// \file mln/core/alias/neighb2d.hh
///
-/// Definition of the mln::neighb2d alias and of some classical
+/// \brief Definition of the mln::neighb2d alias and of some classical
/// 2D neighborhoods.
///
/// \todo Add symmetry and non-centering tests in conversion.
-
# include <cmath>
# include <mln/core/alias/window2d.hh>
# include <mln/core/neighb.hh>
# include <mln/convert/from_to.hh>
+# include <mln/make/double_neighb2d.hh>
+# include <mln/fun/p2b/chess.hh>
namespace mln
@@ -122,6 +123,8 @@
+
+
namespace convert
{
@@ -199,6 +202,24 @@
}
+ inline
+ neighb< win::multiple<window2d, fun::p2b::chess> >
+ c6_2d()
+ {
+ bool vert[] = { 1, 1, 0,
+ 1, 0, 1,
+ 0, 1, 1 };
+
+ bool hori[] = { 0, 1, 1,
+ 1, 0, 1,
+ 1, 1, 0 };
+
+ return make::double_neighb2d(fun::p2b::chess(),
+ vert,
+ hori);
+ }
+
+
namespace convert
{
Index: mln/make/double_neighb2d.hh
--- mln/make/double_neighb2d.hh (revision 4003)
+++ mln/make/double_neighb2d.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 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
@@ -30,7 +31,7 @@
/// \file mln/make/double_neighb2d.hh
///
-/// Routine to create a double neighborhood.
+/// \brief Routine to create a double neighborhood.
///
/// \todo Add overload with 'when_*' being Neighborhood<N>...
@@ -54,7 +55,7 @@
template <typename F, unsigned St, unsigned Sf>
neighb< win::multiple<window2d, F> >
- double_neighb2d(F test,
+ double_neighb2d(const F& test,
bool const (&when_true) [St],
bool const (&when_false)[Sf]);
@@ -79,7 +80,7 @@
template <typename F, unsigned St, unsigned Sf>
inline
neighb< win::multiple<window2d, F> >
- double_neighb2d(F test,
+ double_neighb2d(const F& test,
bool const (&when_true) [St],
bool const (&when_false)[Sf])
{
Index: demos/genericity/neighborhood.cc
--- demos/genericity/neighborhood.cc (revision 0)
+++ demos/genericity/neighborhood.cc (revision 0)
@@ -0,0 +1,99 @@
+// Copyright (C) 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 demos/genericity/neighborhood.cc
+///
+/// Test on mln::labeling::blobs.
+
+#include <mln/core/image/image2d.hh>
+#include <mln/io/pbm/load.hh>
+#include <mln/labeling/blobs.hh>
+#include <mln/labeling/colorize.hh>
+#include <mln/labeling/flat_zones.hh>
+#include <mln/value/rgb8.hh>
+#include <mln/io/ppm/save.hh>
+
+#include <mln/core/alias/neighb2d.hh>
+#include <mln/make/dual_neighb.hh>
+#include <mln/make/double_neighb2d.hh>
+#include <mln/debug/println.hh>
+
+#include "../../tests/data.hh"
+
+
+template <typename N>
+void run(const mln::image2d<bool>& pic,
+ const N& nbh,
+ const std::string& filename)
+{
+ using namespace mln;
+ using value::rgb8;
+ unsigned n;
+ image2d<unsigned> lab = labeling::blobs(pic, nbh, n);
+ image2d<rgb8> out = labeling::colorize(rgb8(), lab, n);
+ io::ppm::save(out, filename);
+}
+
+
+int main()
+{
+ using namespace mln;
+
+ image2d<bool> pic = io::pbm::load(MLN_IMG_DIR "/small.pbm");
+
+ run(pic, c4(), "c4.ppm");
+ run(pic, c8(), "c8.ppm");
+
+ run(pic, c6_2d(), "c6.ppm");
+
+ {
+ bool vert[] = { 0, 1, 0,
+ 0, 0, 0,
+ 0, 1, 0 };
+
+ bool hori[] = { 0, 0, 0,
+ 1, 0, 1,
+ 0, 0, 0 };
+ run(pic,
+ make::double_neighb2d(fun::p2b::chess(), vert, hori),
+ "cmy.ppm");
+ }
+
+ {
+ using value::rgb8;
+ unsigned n;
+ image2d<unsigned> lab;
+ lab = labeling::flat_zones(pic,
+ make::dual_neighb(pic,
+ c4(), // object
+ c8()), // background
+ n);
+ image2d<rgb8> out = labeling::colorize(rgb8(), lab, n);
+ io::ppm::save(out, "cdual48.ppm");
+ }
+
+}