Please report any problem related to this move. TIA!
URL: https://svn.lrde.epita.fr/svn/oln
Move the Olena-NG components from trunk/ to branches/olena-ng/.
trunk/ChangeLog
Move the Olena-NG components elsewhere.
* dynamic/,
* extended/,
* metalic/,
* olena/,
* static/:
Remove directories.
* configure.ac: Adjust.
* Makefile.am (SUBDIRS): Remove metalic, extended, static, olena
and dynamic.
* TODO: Remove irrelevant entries.
* NEWS: Add information on the 0.11 release.
More on the upcoming 1.0 release.
branches/olena-ng/ChangeLog
Move Milena out of the Olena-NG tree.
* milena/: Remove directory.
* configure.ac: Adjust.
* Makefile.am (SUBDIRS): Remove milena.
* TODO: Remove irrelevant entries.
* NEWS: Add information on the 0.11 release.
Index: /trunk/ChangeLog
===================================================================
--- /trunk/ChangeLog (revision 1526)
+++ /trunk/ChangeLog (revision 1534)
@@ -1,2 +1,19 @@
+2007-11-26 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Move the Olena-NG components elsewhere.
+
+ * dynamic/,
+ * extended/,
+ * metalic/,
+ * olena/,
+ * static/:
+ Remove directories.
+ * configure.ac: Adjust.
+ * Makefile.am (SUBDIRS): Remove metalic, extended, static, olena
+ and dynamic.
+ * TODO: Remove irrelevant entries.
+ * NEWS: Add information on the 0.11 release.
+ More on the upcoming 1.0 release.
+
2007-11-23 Simon Nivault <simon.nivault(a)lrde.epita.fr>
Index: branches/olena-ng/ChangeLog
===================================================================
--- branches/olena-ng/ChangeLog (.../trunk/ChangeLog) (revision 1533)
+++ branches/olena-ng/ChangeLog (.../branches/olena-ng/ChangeLog) (revision 1534)
@@ -1,3 +1,13 @@
+2007-11-26 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Move Milena out of the Olena-NG tree.
+
+ * milena/: Remove directory.
+ * configure.ac: Adjust.
+ * Makefile.am (SUBDIRS): Remove milena.
+ * TODO: Remove irrelevant entries.
+ * NEWS: Add information on the 0.11 release.
+
2007-11-23 Simon Nivault <simon.nivault(a)lrde.epita.fr>
Remove creation of makefile in tests/make.
Index: /trunk/configure.ac
===================================================================
--- /trunk/configure.ac (revision 1526)
+++ /trunk/configure.ac (revision 1534)
@@ -47,12 +47,4 @@
-## ----------------------------- ##
-## Concept C++ compiler set up. ##
-## ----------------------------- ##
-
-AC_ARG_VAR([CONCEPTCXX], [Concept C++ compiler])
-AC_CHECK_PROGS([CONCEPTCXX], [conceptg++ conceptc++])
-
-
## -------------- ##
## Dependencies. ##
@@ -62,16 +54,4 @@
OLN_WITH_FREEIMAGEPLUS
AM_CONDITIONAL([FREEIMAGEPLUS], [test x$oln_have_freeimageplus = xyes])
-
-
-## ------- ##
-## Tests. ##
-## ------- ##
-
-AC_CONFIG_FILES([
- metalic/tests/Makefile
- extended/tests/Makefile
- static/tests/Makefile
- olena/tests/Makefile
-])
@@ -86,24 +66,14 @@
AC_CONFIG_FILES([
Makefile
- metalic/Makefile
- metalic/mlc/Makefile
- extended/Makefile
- extended/xtd/Makefile
- static/Makefile
- static/stc/Makefile
- static/samples/Makefile
- static/samples/mini-oln/Makefile
- static/samples/mini-oln/concept-c++/Makefile
- static/samples/mini-std/Makefile
- static/samples/mini-std/cpp/Makefile
- static/samples/mini-std/cpp2/Makefile
milena/Makefile
milena/doc/Makefile
- olena/Makefile
- olena/oln/Makefile
- olena/img/Makefile
- dynamic/Makefile
])
-# FIXME: Should be performed through oln.m4 macros.
+
+
+## ------- ##
+## Tests. ##
+## ------- ##
+
+# FIXME: Should be performed through oln.m4 macros?
AC_CONFIG_FILES([
milena/tests/Makefile
@@ -162,16 +132,4 @@
milena/tests/labeling/Makefile
])
-AC_CONFIG_FILES([
- olena/tests/algorithms/Makefile
- olena/tests/check/Makefile
- olena/tests/check/defs
- olena/tests/core/Makefile
- olena/tests/io/Makefile
- olena/tests/morphers/Makefile
- olena/tests/sanity/Makefile
- olena/tests/value/Makefile
-])
-AC_CONFIG_FILES([olena/tests/sanity/check],
- [chmod +x olena/tests/sanity/check])
AC_OUTPUT
Index: branches/olena-ng/configure.ac
===================================================================
--- branches/olena-ng/configure.ac (.../trunk/configure.ac) (revision 1533)
+++ branches/olena-ng/configure.ac (.../branches/olena-ng/configure.ac) (revision 1534)
@@ -74,7 +74,21 @@
olena/tests/Makefile
])
+# FIXME: Should be performed through oln.m4 macros.
+AC_CONFIG_FILES([
+ olena/tests/algorithms/Makefile
+ olena/tests/check/Makefile
+ olena/tests/check/defs
+ olena/tests/core/Makefile
+ olena/tests/io/Makefile
+ olena/tests/morphers/Makefile
+ olena/tests/sanity/Makefile
+ olena/tests/value/Makefile
+])
+AC_CONFIG_FILES([olena/tests/sanity/check],
+ [chmod +x olena/tests/sanity/check])
+
## --------------- ##
## Configuration. ##
## --------------- ##
@@ -97,81 +111,10 @@
static/samples/mini-std/Makefile
static/samples/mini-std/cpp/Makefile
static/samples/mini-std/cpp2/Makefile
- milena/Makefile
- milena/doc/Makefile
olena/Makefile
olena/oln/Makefile
olena/img/Makefile
dynamic/Makefile
])
-# FIXME: Should be performed through oln.m4 macros.
-AC_CONFIG_FILES([
- milena/tests/Makefile
- milena/tests/norm/Makefile
- milena/tests/geom/Makefile
- milena/tests/literal/Makefile
- milena/tests/level/Makefile
- milena/tests/level/naive/Makefile
- milena/tests/level/approx/Makefile
- milena/tests/draw/Makefile
- milena/tests/arith/Makefile
- milena/tests/canvas/Makefile
- milena/tests/canvas/browsing/Makefile
- milena/tests/canvas/morpho/Makefile
- milena/tests/math/Makefile
- milena/tests/border/Makefile
- milena/tests/logical/Makefile
- milena/tests/trait/Makefile
- milena/tests/trait/image/Makefile
- milena/tests/trait/value/Makefile
- milena/tests/trait/op/Makefile
- milena/tests/histo/Makefile
- milena/tests/tag/Makefile
- milena/tests/debug/Makefile
- milena/tests/metal/Makefile
- milena/tests/metal/math/Makefile
- milena/tests/metal/make/Makefile
- milena/tests/accu/Makefile
- milena/tests/linear/Makefile
- milena/tests/linear/local/Makefile
- milena/tests/value/Makefile
- milena/tests/value/concept/Makefile
- milena/tests/value/builtin/Makefile
- milena/tests/convert/Makefile
- milena/tests/estim/Makefile
- milena/tests/pw/Makefile
- milena/tests/fun/Makefile
- milena/tests/fun/i2v/Makefile
- milena/tests/fun/x2x/Makefile
- milena/tests/fun/p2b/Makefile
- milena/tests/fun/p2v/Makefile
- milena/tests/fun/v2v/Makefile
- milena/tests/set/Makefile
- milena/tests/win/Makefile
- milena/tests/trace/Makefile
- milena/tests/morpho/Makefile
- milena/tests/io/Makefile
- milena/tests/io/pfm/Makefile
- milena/tests/io/pgm/Makefile
- milena/tests/io/fits/Makefile
- milena/tests/io/pnm/Makefile
- milena/tests/io/ppm/Makefile
- milena/tests/io/pbm/Makefile
- milena/tests/util/Makefile
- milena/tests/display/Makefile
- milena/tests/labeling/Makefile
-])
-AC_CONFIG_FILES([
- olena/tests/algorithms/Makefile
- olena/tests/check/Makefile
- olena/tests/check/defs
- olena/tests/core/Makefile
- olena/tests/io/Makefile
- olena/tests/morphers/Makefile
- olena/tests/sanity/Makefile
- olena/tests/value/Makefile
-])
-AC_CONFIG_FILES([olena/tests/sanity/check],
- [chmod +x olena/tests/sanity/check])
AC_OUTPUT
Index: /trunk/Makefile.am
===================================================================
--- /trunk/Makefile.am (revision 1409)
+++ /trunk/Makefile.am (revision 1534)
@@ -3,3 +3,3 @@
ACLOCAL_AMFLAGS = -I build-aux
-SUBDIRS = build-aux metalic extended static milena olena dynamic
+SUBDIRS = build-aux milena
Index: branches/olena-ng/Makefile.am
===================================================================
--- branches/olena-ng/Makefile.am (.../trunk/Makefile.am) (revision 1533)
+++ branches/olena-ng/Makefile.am (.../branches/olena-ng/Makefile.am) (revision 1534)
@@ -2,4 +2,4 @@
ACLOCAL_AMFLAGS = -I build-aux
-SUBDIRS = build-aux metalic extended static milena olena dynamic
+SUBDIRS = build-aux metalic extended static olena dynamic
Index: /trunk/TODO
===================================================================
--- /trunk/TODO (revision 689)
+++ /trunk/TODO (revision 1534)
@@ -1,3 +1,3 @@
-See also the TODO in oln-proto-1.0 and oln-proto-stl-style.
+See also the TODOs in oln-proto-1.0 and oln-proto-stl-style.
@@ -56,8 +56,6 @@
-** Update the address of the FSF in Copyright notices (write a script)
-
** Check dates for every copyright header
-Use the repository of Olena 0.10 (and previous) and Olena proto-1.0 to
+Use the repository of Olena 0.11 (and previous) and Olena proto-1.0 to
find when files have been created and modified. This task could be a
part of the code review process.
@@ -72,5 +70,8 @@
standard error.
-** Add the UPGRADING file from oln-0.10 and complete it
+** Add the UPGRADING file from Olena 0.11 and complete it
+N.B.: This file is generated.
+We might want to break the pseudo-compatibility with Olena 0.x, and
+get rid of UPGRADING.
Index: branches/olena-ng/TODO
===================================================================
--- branches/olena-ng/TODO (.../trunk/TODO) (revision 1533)
+++ branches/olena-ng/TODO (.../branches/olena-ng/TODO) (revision 1534)
@@ -1,4 +1,4 @@
-See also the TODO in oln-proto-1.0 and oln-proto-stl-style.
+See also the TODOs in oln-proto-1.0 and oln-proto-stl-style.
* Clean up
@@ -58,7 +58,7 @@
** Update the address of the FSF in Copyright notices (write a script)
** Check dates for every copyright header
-Use the repository of Olena 0.10 (and previous) and Olena proto-1.0 to
+Use the repository of Olena 0.11 (and previous) and Olena proto-1.0 to
find when files have been created and modified. This task could be a
part of the code review process.
@@ -71,7 +71,10 @@
The tests should print nothing on the stantard output, nor on the
standard error.
-** Add the UPGRADING file from oln-0.10 and complete it
+** Add the UPGRADING file from Olena 0.11 and complete it
+N.B.: This file is generated.
+We might want to break the pseudo-compatibility with Olena 0.x, and
+get rid of UPGRADING.
Local Variables:
Index: /trunk/NEWS
===================================================================
--- /trunk/NEWS (revision 466)
+++ /trunk/NEWS (revision 1534)
@@ -1,5 +1,33 @@
Olena 1.0
- * SCOOP 2 paradigm.
+ * Rewritten from scratch.
+ * First release of the Olena Platform with Milena as the
+ central library.
+ * Milena uses a simplified version of the SCOOP 2 paradigm, to
+ improve the speed of compilation and the ease of development
+ while still providing very good run-time performances.
+
+
+Olena 0.11 February 21, 2007
+
+ * The whole Olena distribution compiles with the GNU C++
+ Compiler (G++) 4.0 and 4.1. The compatibility with previous
+ versions of the compiler has been broken.
+
+ * Revamp of Swilena.
+ The Swilena wrappers have been repaired, as they had become
+ incompatible with recent versions of SWIG, G++, Python and Ruby.
+ Moreover, a lot of small bugs have been fixed in Swilena.
+ The test suite of Rblena, the Ruby wrappers for Olena, has
+ been completed and is comparable to Pylena's (the Python
+ wrappers for Olena).
+
+ * Libtool.
+ The whole package uses GNU Libtool to handle libraries.
+ Swilena benefits this, and uses Libtool to create shared
+ libraries upon which SWIG wrappers are built.
+
+ * Miscellaneous corrections in Olena and Integre, as well as in
+ their test suites.
Index: branches/olena-ng/NEWS
===================================================================
--- branches/olena-ng/NEWS (.../trunk/NEWS) (revision 1533)
+++ branches/olena-ng/NEWS (.../branches/olena-ng/NEWS) (revision 1534)
@@ -1,8 +1,31 @@
-Olena 1.0
+Olena-NG
- * SCOOP 2 paradigm.
+ * This version of Olena makes use of the SCOOP 2 paradigm.
+Olena 0.11 February 21, 2007
+
+ * The whole Olena distribution compiles with the GNU C++
+ Compiler (G++) 4.0 and 4.1. The compatibility with previous
+ versions of the compiler has been broken.
+
+ * Revamp of Swilena.
+ The Swilena wrappers have been repaired, as they had become
+ incompatible with recent versions of SWIG, G++, Python and Ruby.
+ Moreover, a lot of small bugs have been fixed in Swilena.
+ The test suite of Rblena, the Ruby wrappers for Olena, has
+ been completed and is comparable to Pylena's (the Python
+ wrappers for Olena).
+
+ * Libtool.
+ The whole package uses GNU Libtool to handle libraries.
+ Swilena benefits this, and uses Libtool to create shared
+ libraries upon which SWIG wrappers are built.
+
+ * Miscellaneous corrections in Olena and Integre, as well as in
+ their test suites.
+
+
Olena 0.10 April 15, 2004
* New documentation system.
Lorsque vous créez un répertoire ou que vous en êtes le mainteneur,
merci de penser aux fichier que Subversion doit ignorer paisiblement.
Notamment, les fichiers `Makefile.in' et `Makefile'.
Vcs (et svn-wrapper aussi, probablement) fournissent un raccourci bien
pratique pour ça :
svn ignore path/to/directory/Makefile{.in,}
Ça ajoute lesdits fichiers à la propriété `svn:ignore' de
`path/to/directory'.
Merci d'avance !
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-26 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Move accu's tests into accu directory.
* tests/accu/all.cc: Rename as...
* tests/accu_all.cc: ...this.
* tests/accu/min.cc: Rename as...
* tests/accu_min.cc: ...this.
* tests/accu/nil.cc: Rename as...
* tests/accu_nil.cc: ...this.
---
all.cc | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
min.cc | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
nil.cc | 46 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 164 insertions(+)
Index: trunk/milena/tests/accu_nil.cc (deleted)
===================================================================
Index: trunk/milena/tests/accu_min.cc (deleted)
===================================================================
Index: trunk/milena/tests/accu_all.cc (deleted)
===================================================================
Index: trunk/milena/tests/accu/nil.cc
===================================================================
--- trunk/milena/tests/accu/nil.cc (revision 0)
+++ trunk/milena/tests/accu/nil.cc (revision 1533)
@@ -0,0 +1,46 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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/nil.cc
+ *
+ * \brief Tests on mln::accu::nil.
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/value/int_u8.hh>
+
+#include <mln/accu/nil.hh>
+#include <mln/level/compute.hh>
+
+
+int main()
+{
+ using namespace mln;
+ image2d<value::int_u8> ima(3, 3);
+ accu::nil a;
+ level::compute<accu::nil>(ima);
+}
Index: trunk/milena/tests/accu/min.cc
===================================================================
--- trunk/milena/tests/accu/min.cc (revision 0)
+++ trunk/milena/tests/accu/min.cc (revision 1533)
@@ -0,0 +1,62 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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/image2d.hh>
+#include <mln/debug/iota.hh>
+
+#include <mln/accu/nil.hh>
+#include <mln/accu/min.hh>
+#include <mln/accu/p.hh>
+#include <mln/accu/v.hh>
+#include <mln/accu/compute.hh>
+
+#include <mln/level/compute.hh>
+
+
+int main()
+{
+ using namespace mln;
+ image2d<int> ima(3, 3);
+ debug::iota(ima);
+ mln_assertion(level::compute< accu::min >(ima) == 1);
+ mln_assertion(level::compute< accu::min_<int> >(ima) == 1);
+
+// accu::compute< accu::nil >(ima); // No-op.
+
+// accu::compute< accu::min >(ima);
+
+ std::cout << accu::compute< accu::val<accu::min> >(ima)
+ << std::endl;
+
+// std::cout << accu::compute< accu::min >(ima)
+// << std::endl;
+}
Index: trunk/milena/tests/accu/all.cc
===================================================================
--- trunk/milena/tests/accu/all.cc (revision 0)
+++ trunk/milena/tests/accu/all.cc (revision 1533)
@@ -0,0 +1,56 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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/all.cc
+ *
+ * \brief Tests on all files in mln/accu.
+ */
+
+#include <mln/accu/all.hh>
+#include <mln/core/point2d.hh>
+#include <mln/value/set.hh>
+
+
+int main()
+{
+ using namespace mln;
+ using namespace mln::accu;
+
+
+ bbox<point2d> b;
+ count_<int> c;
+ histo< value::set<bool> > h;
+ max_<int> ma;
+ mean_<int> me;
+ // median< value::set<bool> > med; // FIXME: bool has no min so workaround!
+ min_<int> mi;
+ // min_h< value::set<bool> > mh; // OK: do not work since bool has no min/max :)
+ min_max_<int> mm;
+ nil n;
+ pair_< min_<int>, max_<int> > p;
+ sum_<int> s;
+}
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-23 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Clean util subdirectory tests.
* tests/util/Makefile.am: Update tests file.
* tests/util/branch_iter_ind.cc: New.
* tests/util/eat.cc: New.
* tests/util/graph.cc: New.
* tests/util/ordpair.cc: New.
* tests/util/tree_delete_node.cc: Remove.
* tests/util/util_ordpair.cc: Remove.
---
Makefile.am | 16 +++++++++-
branch_iter_ind.cc | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++
eat.cc | 46 +++++++++++++++++++++++++++++
graph.cc | 58 +++++++++++++++++++++++++++++++++++++
ordpair.cc | 48 ++++++++++++++++++++++++++++++
5 files changed, 250 insertions(+), 1 deletion(-)
Index: trunk/milena/tests/util/util_ordpair.cc (deleted)
===================================================================
Index: trunk/milena/tests/util/tree_delete_node.cc (deleted)
===================================================================
Index: trunk/milena/tests/util/ordpair.cc
===================================================================
--- trunk/milena/tests/util/ordpair.cc (revision 0)
+++ trunk/milena/tests/util/ordpair.cc (revision 1530)
@@ -0,0 +1,48 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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 util/ordpair.cc
+ *
+ * \brief Tests on mln::util::ordpair.
+ */
+
+#include <mln/core/point2d.hh>
+#include <mln/util/ordpair.hh>
+
+
+
+int main()
+{
+ using namespace mln;
+
+ point2d p1(5,6), p2(5,7), p3(4,2);
+
+ mln_assertion(util::ordpair (p2, p1) == util::ordpair (p1, p2));
+ mln_assertion(util::ordpair (p1, p3) < util::ordpair (p1, p2));
+ mln_assertion(util::ordpair (p1, p2) <= util::ordpair (p1, p2));
+ mln_assertion(util::ordpair (p1, p3) <= util::ordpair (p1, p2));
+}
Index: trunk/milena/tests/util/graph.cc
===================================================================
--- trunk/milena/tests/util/graph.cc (revision 0)
+++ trunk/milena/tests/util/graph.cc (revision 1530)
@@ -0,0 +1,58 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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/util/graph.cc
+ *
+ * \brief test of mln::util::graph
+ *
+ */
+
+#include <mln/util/graph.hh>
+
+int main ()
+{
+ using namespace mln;
+
+ util::graph<void> g;
+
+ g.add_node (); // 0
+ g.add_node (); // 1
+ g.add_node (); // 2
+ g.add_node (); // 3
+ g.add_node (); // 4
+ g.add_node (); // 5
+ g.add_edge (0, 1);
+ g.add_edge (0, 2);
+ g.add_edge (3, 4);
+ g.add_edge (4, 5);
+ g.add_edge (5, 4);
+ g.add_edge (1, 0);
+ g.add_edge (5, 3);
+ g.add_edge (2, 1);
+ g.consistency ();
+}
Index: trunk/milena/tests/util/Makefile.am
===================================================================
--- trunk/milena/tests/util/Makefile.am (revision 1529)
+++ trunk/milena/tests/util/Makefile.am (revision 1530)
@@ -1,12 +1,26 @@
## Process this file through Automake to create Makefile.in -*- Makefile -*-
+
check_PROGRAMS = \
branch_iter \
branch_iter_ind \
-graph
+eat \
+graph \
+ordpair \
+tree \
+tree_fast \
+tree_fast_to_image \
+tree_to_image
+
branch_iter_SOURCES = branch_iter.cc
branch_iter_ind_SOURCES = branch_iter_ind.cc
+eat_SOURCES = eat.cc
graph_SOURCES = graph.cc
+ordpair_SOURCES = ordpair.cc
+tree_SOURCES = tree.cc
+tree_fast_SOURCES = tree_fast.cc
+tree_fast_to_image_SOURCES = tree_to_image.cc
+tree_to_image_SOURCES = tree_to_image.cc
TESTS = $(check_PROGRAMS)
Index: trunk/milena/tests/util/eat.cc
===================================================================
--- trunk/milena/tests/util/eat.cc (revision 0)
+++ trunk/milena/tests/util/eat.cc (revision 1530)
@@ -0,0 +1,46 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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/util/eat.cc
+ *
+ * \brief test of mln::util::eat
+ *
+ */
+
+#include <mln/util/eat.hh>
+
+int main ()
+{
+ using namespace mln;
+
+ int a = 42;
+ util::eat e(a);
+
+// // FIXME
+// mln_assertion(false);
+}
Index: trunk/milena/tests/util/branch_iter_ind.cc
===================================================================
--- trunk/milena/tests/util/branch_iter_ind.cc (revision 0)
+++ trunk/milena/tests/util/branch_iter_ind.cc (revision 1530)
@@ -0,0 +1,83 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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/util/branch_iter_ind.cc
+ *
+ * \brief test of mln::util::branch_iter_ind
+ *
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/util/tree.hh>
+#include <mln/util/branch_iter_ind.hh>
+
+int main()
+{
+ using namespace mln;
+
+ util::node<int> n(11);
+ util::tree<int> t(&n);
+ util::node<int>* f = n.add_child(21);
+ util::node<int>* g = f->add_child(31);
+
+ f->add_child(32);
+ g->add_child(41)->add_child(51)->add_child(61)->add_child(71)->add_child(81)->add_child(91);
+ g->add_child(42);
+ f->add_child(33);
+ f->add_child(34);
+ n.add_child(22);
+
+ util::branch<int> b(t, n);
+
+ std::vector< util::node<int>* >::iterator it;
+ util::branch_iter_ind<int> p(b);
+
+ int prev;
+ int current;
+ for(p.start(), prev = util::node<int>(p).elt(), p.next();
+ p.is_valid();
+ prev = util::node<int>(p).elt(), p.next())
+ {
+ current = util::node<int>(p).elt ();
+
+ // children
+ if (prev + 10 == current)
+ continue;
+
+ // brother
+ if (prev + 1 == current)
+ continue;
+
+ // parent
+ if (prev > current)
+ continue;
+
+ mln_assertion (false);
+ }
+
+}
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-23 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Update util tests subdirectory.
* tests/branch_iter.cc: Remove.
* tests/util/branch_iter.cc: New.
* tests/tree.cc: Remove.
* tests/util/tree.cc: New.
* tests/tree_delete_node.cc: Remove.
* tests/util/tree_delete_node.cc: New.
* tests/tree_fast.cc: Remove.
* tests/util/tree_fast.cc: New.
* tests/tree_fast_to_image.cc: Remove.
* tests/util/tree_fast_to_image.cc: New.
* tests/tree_to_image.cc: Remove.
* tests/util/tree_to_image.cc: New.
* tests/util_ordpair.cc: Remove.
* tests/util/util_ordpair.cc: New.
* tests/util/Makefile.am: Update somes tests.
* tests/level/fill.cc: Erase comment header.
---
level/fill.cc | 21 ------
util/Makefile.am | 10 +++
util/branch_iter.cc | 83 ++++++++++++++++++++++++++
util/tree.cc | 62 +++++++++++++++++++
util/tree_delete_node.cc | 69 +++++++++++++++++++++
util/tree_fast.cc | 61 +++++++++++++++++++
util/tree_fast_to_image.cc | 142 +++++++++++++++++++++++++++++++++++++++++++++
util/tree_to_image.cc | 136 +++++++++++++++++++++++++++++++++++++++++++
util/util_ordpair.cc | 48 +++++++++++++++
9 files changed, 611 insertions(+), 21 deletions(-)
Index: trunk/milena/tests/util_ordpair.cc (deleted)
===================================================================
Index: trunk/milena/tests/tree.cc (deleted)
===================================================================
Index: trunk/milena/tests/tree_delete_node.cc (deleted)
===================================================================
Index: trunk/milena/tests/tree_fast.cc (deleted)
===================================================================
Index: trunk/milena/tests/branch_iter.cc (deleted)
===================================================================
Index: trunk/milena/tests/tree_fast_to_image.cc (deleted)
===================================================================
Index: trunk/milena/tests/tree_to_image.cc (deleted)
===================================================================
Index: trunk/milena/tests/level/fill.cc
===================================================================
--- trunk/milena/tests/level/fill.cc (revision 1528)
+++ trunk/milena/tests/level/fill.cc (revision 1529)
@@ -34,10 +34,6 @@
#include <mln/core/sub_image.hh>
#include <mln/level/fill.hh>
-#include <mln/debug/println.hh>
-//#include <mln/value/props.hh>
-
-
int main()
{
using namespace mln;
@@ -54,23 +50,6 @@
box_fwd_piter_<point2d> p(ima.domain());
for_all (p)
mln_assertion (ima(p) == u);
-
}
-// {
-// const unsigned size = 10000;
-// image2d<unsigned char> ima(size, size);
-// for (unsigned i = 0; i < 5; ++i)
-// level::fill(ima, uc);
-// box_fwd_piter_<point2d> p(ima.domain());
-// for_all (p)
-// mln_assertion (ima(p) == uc);
-// }
-
-// {
-// // do *not* compile so that's great since ima is not mutable
-// sub_image< const image2d<int>, box2d > ima;
-// level::fill(ima, 0);
-// }
-
}
Index: trunk/milena/tests/util/tree_fast.cc
===================================================================
--- trunk/milena/tests/util/tree_fast.cc (revision 0)
+++ trunk/milena/tests/util/tree_fast.cc (revision 1529)
@@ -0,0 +1,61 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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/util/tree_fast.cc
+ *
+ * \brief test of mln::util::tree_fast
+ *
+ */
+
+#include <mln/util/tree_fast.hh>
+
+int main ()
+{
+ using namespace mln;
+
+ unsigned elt1 = 1;
+ unsigned elt2 = 2;
+ unsigned elt3 = 3;
+ unsigned elt4 = 4;
+ unsigned elt5 = 5;
+ unsigned elt6= 42;
+
+ util::tree_fast<unsigned> tree_fast(elt1);
+ mln_assertion(tree_fast.has (elt1));
+ tree_fast.add_child(tree_fast.search(elt1), elt2);
+ mln_assertion(tree_fast.has (elt2));
+ tree_fast.add_child(tree_fast.search(elt1), elt3);
+ mln_assertion(tree_fast.has (elt3));
+ tree_fast.add_child(tree_fast.search(elt2), elt4);
+ mln_assertion(tree_fast.has (elt4));
+ tree_fast.add_child(tree_fast.search(elt2), elt5);
+ mln_assertion(tree_fast.has (elt5));
+ tree_fast.add_parent(elt6);
+ mln_assertion(tree_fast.has (elt6));
+ mln_assertion(tree_fast.search(elt6) == tree_fast.root_);
+}
Index: trunk/milena/tests/util/util_ordpair.cc
===================================================================
--- trunk/milena/tests/util/util_ordpair.cc (revision 0)
+++ trunk/milena/tests/util/util_ordpair.cc (revision 1529)
@@ -0,0 +1,48 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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 util/ordpair.cc
+ *
+ * \brief Tests on mln::util::ordpair.
+ */
+
+#include <mln/core/point2d.hh>
+#include <mln/util/ordpair.hh>
+
+
+
+int main()
+{
+ using namespace mln;
+
+ point2d p1(5,6), p2(5,7), p3(4,2);
+
+ mln_assertion(util::ordpair (p2, p1) == util::ordpair (p1, p2));
+ mln_assertion(util::ordpair (p1, p3) < util::ordpair (p1, p2));
+ mln_assertion(util::ordpair (p1, p2) <= util::ordpair (p1, p2));
+ mln_assertion(util::ordpair (p1, p3) <= util::ordpair (p1, p2));
+}
Index: trunk/milena/tests/util/tree.cc
===================================================================
--- trunk/milena/tests/util/tree.cc (revision 0)
+++ trunk/milena/tests/util/tree.cc (revision 1529)
@@ -0,0 +1,62 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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/util/tree.cc
+ *
+ * \brief test of mln::util::tree
+ *
+ */
+
+#include <mln/util/tree.hh>
+
+int main ()
+{
+ using namespace mln;
+
+ unsigned elt1 = 1;
+ unsigned elt2 = 2;
+ unsigned elt3 = 3;
+ unsigned elt4 = 4;
+ unsigned elt5 = 5;
+ unsigned elt6= 42;
+
+ util::node<unsigned> node(elt1);
+ util::node<unsigned>* node2 = node.add_child(elt2);
+ node.add_child(elt3);
+ mln_assertion(node2);
+ node2->add_child(elt4);
+ node2->add_child(elt5);
+ util::node<unsigned>* node3 = node.search(elt4);
+ mln_assertion(node3);
+ node3 = node2->search(elt1);
+ mln_assertion(!node3);
+ util::tree<unsigned>* tre = new util::tree<unsigned>(&node);
+ mln_assertion(tre);
+ tre->add_tree_up(elt6);
+ mln_assertion (tre->check_consistency());
+}
Index: trunk/milena/tests/util/branch_iter.cc
===================================================================
--- trunk/milena/tests/util/branch_iter.cc (revision 0)
+++ trunk/milena/tests/util/branch_iter.cc (revision 1529)
@@ -0,0 +1,83 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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/util/branch_iter.cc
+ *
+ * \brief test of mln::util::branch_iter
+ *
+ */
+
+#include <mln/core/image2d.hh>
+#include <mln/util/tree.hh>
+#include <mln/util/branch_iter.hh>
+
+int main()
+{
+ using namespace mln;
+
+ util::node<int> n(11);
+ util::tree<int> t(&n);
+ util::node<int>* f = n.add_child(21);
+ util::node<int>* g = f->add_child(31);
+
+ f->add_child(32);
+ g->add_child(41)->add_child(51)->add_child(61)->add_child(71)->add_child(81)->add_child(91);
+ g->add_child(42);
+ f->add_child(33);
+ f->add_child(34);
+ n.add_child(22);
+
+ util::branch<int> b(t, n);
+
+ std::vector< util::node<int>* >::iterator it;
+ util::branch_iter<int> p(b);
+
+ int prev;
+ int current;
+ for(p.start(), prev = util::node<int>(p).elt(), p.next();
+ p.is_valid();
+ prev = util::node<int>(p).elt(), p.next())
+ {
+ current = util::node<int>(p).elt ();
+
+ // children
+ if (prev + 10 == current)
+ continue;
+
+ // brother
+ if (prev + 1 == current)
+ continue;
+
+ // parent
+ if (prev > current)
+ continue;
+
+ mln_assertion (false);
+ }
+
+}
Index: trunk/milena/tests/util/tree_fast_to_image.cc
===================================================================
--- trunk/milena/tests/util/tree_fast_to_image.cc (revision 0)
+++ trunk/milena/tests/util/tree_fast_to_image.cc (revision 1529)
@@ -0,0 +1,142 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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/tree_fast_to_image.cc
+ *
+ * \brief test of mln::util::tree_fast_to_image
+ *
+ */
+
+#include <mln/core/contract.hh>
+#include <mln/core/image2d.hh>
+#include <mln/core/p_set.hh>
+#include <mln/value/int_u8.hh>
+#include <mln/level/stretch.hh>
+#include <mln/io/pgm/save.hh>
+#include <vector>
+#include <mln/util/tree_fast_to_image.hh>
+#include <mln/util/tree_fast.hh>
+
+template <typename P, typename V>
+struct fllt_node
+{
+ V value;
+ mln::p_set<P> points;
+ mln::p_set<P> holes;
+};
+
+
+template <typename P, typename V>
+bool operator==(const mln::p_set<P>& lhs, const mln::p_set<P>& rhs)
+{
+ std::size_t n = lhs.npoints ();
+ mln::p_set<P> tmp;
+
+ if (n != rhs.npoints ())
+ return false;
+
+// for (std::size_t i = 0; i < n; ++i)
+// if ()
+
+}
+
+template <typename P, typename V>
+bool operator==(const struct fllt_node<P,V>& lhs, const struct fllt_node<P,V>& rhs)
+{
+ if (lhs.value != rhs.value)
+ return false;
+
+ /// FIXME
+
+ if (!(lhs.points == rhs.points))
+ return false;
+
+ if (!(lhs.holes == rhs.holes))
+ return false;
+
+ return true;
+}
+
+int main (void)
+{
+ using namespace mln;
+ using value::int_u8;
+
+ typedef p_set<point2d > I;
+ typedef fllt_node<point2d, int_u8> T;
+
+ T s1;
+ T s2;
+ T s3;
+ T s4;
+ T s5;
+ T s6;
+ T s7;
+
+ for (int i = 0; i < 100; ++i)
+ for (int j = 0; j < 100; ++j)
+ s1.points.insert(point2d(i, j));
+ s1.value = 60;
+ for (int i = 200; i < 300; ++i)
+ for (int j = 0; j < 100; ++j)
+ s2.points.insert(point2d(i, j));
+ s2.value = 100;
+ for (int i = 0; i < 100; ++i)
+ for (int j = 0; j < 100; ++j)
+ s3.points.insert(point2d(i, j));
+ s3.value = 110;
+ for (int i = 260; i < 290; ++i)
+ for (int j = 0; j < 50; ++j)
+ s4.points.insert(point2d(i, j));
+ s4.value = 170;
+ for (int i = 200; i < 210; ++i)
+ for (int j = 0; j < 50; ++j)
+ s5.points.insert(point2d(i, j));
+ s5.value = 180;
+ for (int i = 270; i < 280; ++i)
+ for (int j = 50; j < 60; ++j)
+ s6.points.insert(point2d(i, j));
+ s6.value = 210;
+ for (int i = 0; i < 300; ++i)
+ for (int j = 0; j < 200; ++j)
+ s7.points.insert(point2d(i, j));
+ s7.value = 10;
+
+ util::tree_fast<T> tree(s1);
+ tree.add_child(tree.root_, s2);
+ tree.add_child(tree.search(s1), s3);
+ tree.add_child(tree.search(s2), s4);
+ tree.add_child(tree.search(s2), s5);
+ tree.add_child(tree.search(s4), s6);
+ tree.add_parent(s7);
+ image2d<int_u8> out (300,300);
+ util::tree_fast_to_image(tree, out);
+ io::pgm::save(out, "out.pgm");
+ std::cout << "out.pgm generate"
+ << std::endl;
+}
Index: trunk/milena/tests/util/tree_to_image.cc
===================================================================
--- trunk/milena/tests/util/tree_to_image.cc (revision 0)
+++ trunk/milena/tests/util/tree_to_image.cc (revision 1529)
@@ -0,0 +1,136 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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/tree_to_image.cc
+ *
+ * \brief test of mln::util::tree_to_image
+ *
+ */
+
+#include <mln/util/tree.hh>
+#include <mln/core/contract.hh>
+#include <mln/core/image2d.hh>
+#include <mln/core/p_set.hh>
+#include <mln/value/int_u8.hh>
+#include <mln/level/stretch.hh>
+#include <mln/level/fill.hh>
+#include <mln/level/compare.hh>
+#include <mln/io/pgm/save.hh>
+#include <vector>
+#include <mln/util/tree_to_image.hh>
+#include <mln/debug/println.hh>
+
+template <typename P, typename V>
+struct fllt_node
+{
+ V value;
+ mln::p_set<P> points;
+ mln::p_set<P> holes;
+};
+
+
+int main (void)
+{
+ using namespace mln;
+ using value::int_u8;
+
+ typedef fllt_node<point2d , int_u8> I;
+
+ image2d<int_u8> output (16, 16);
+
+ I s1;
+ I s2;
+ I s3;
+ I s4;
+ I s5;
+ I s6;
+ I s7;
+
+ for (int i = 0; i < 4; ++i)
+ for (int j = 0; j < 4; ++j)
+ s1.points.insert(point2d(i, j));
+ s1.value = 60;
+ for (int i = 8; i < 16; ++i)
+ for (int j = 0; j < 4; ++j)
+ s2.points.insert(point2d(i, j));
+ s1.value = 100;
+ for (int i = 0; i < 4; ++i)
+ for (int j = 0; j < 4; ++j)
+ s3.points.insert(point2d(i, j));
+ s3.value = 110;
+ for (int i = 10; i < 12; ++i)
+ for (int j = 0; j < 2; ++j)
+ s4.points.insert(point2d(i, j));
+ s4.value = 170;
+ for (int i = 8; i < 14; ++i)
+ for (int j = 0; j < 2; ++j)
+ s5.points.insert(point2d(i, j));
+ s5.value = 180;
+ for (int i = 13; i < 15; ++i)
+ for (int j = 2; j < 4; ++j)
+ s6.points.insert(point2d(i, j));
+ s6.value = 210;
+ for (int i = 0; i < 16; ++i)
+ for (int j = 0; j < 8; ++j)
+ s7.points.insert(point2d(i, j));
+ s7.value = 10;
+
+ util::node<I> node(s1);
+ node.add_child(s2);
+ node.add_child(s3);
+ node.add_child(s4);
+ node.add_child(s5);
+ node.add_child(s6);
+ util::tree<I> tree (&node);
+ tree.add_tree_up(s7);
+ util::tree_to_image(tree, output);
+
+ int_u8 vs[16][16] = {
+
+ {110, 110, 110, 110, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ {110, 110, 110, 110, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ {110, 110, 110, 110, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ {110, 110, 110, 110, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ { 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ { 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ { 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ { 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ {180, 180, 16, 16, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ {180, 180, 16, 16, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ {180, 180, 16, 16, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ {180, 180, 16, 16, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ {180, 180, 16, 16, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ {180, 180, 210, 210, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ { 16, 16, 210, 210, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0},
+ { 16, 16, 16, 16, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0}
+
+ };
+
+ image2d<int_u8> ref (make::image2d(vs));
+ mln_assertion(ref == output);
+}
Index: trunk/milena/tests/util/Makefile.am
===================================================================
--- trunk/milena/tests/util/Makefile.am (revision 1528)
+++ trunk/milena/tests/util/Makefile.am (revision 1529)
@@ -1,3 +1,13 @@
## Process this file through Automake to create Makefile.in -*- Makefile -*-
+check_PROGRAMS = \
+branch_iter \
+branch_iter_ind \
+graph
+
+branch_iter_SOURCES = branch_iter.cc
+branch_iter_ind_SOURCES = branch_iter_ind.cc
+graph_SOURCES = graph.cc
+
+TESTS = $(check_PROGRAMS)
include $(top_srcdir)/milena/tests/tests.mk
Index: trunk/milena/tests/util/tree_delete_node.cc
===================================================================
--- trunk/milena/tests/util/tree_delete_node.cc (revision 0)
+++ trunk/milena/tests/util/tree_delete_node.cc (revision 1529)
@@ -0,0 +1,69 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena 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/tree_delete_node.cc
+ *
+ * \brief test of mln::util::tree
+ *
+ */
+
+#include <mln/util/tree.hh>
+#include <mln/core/contract.hh>
+
+int main (void)
+{
+ using namespace mln;
+
+ unsigned elt1 = 1;
+ unsigned elt2 = 2;
+ unsigned elt3 = 3;
+ unsigned elt4 = 4;
+ unsigned elt5 = 5;
+ unsigned elt6= 42;
+
+ util::node<unsigned> node(elt1);
+ util::node<unsigned>* node2 = node.add_child(elt2);
+ node.add_child(elt3);
+// util::node<unsigned>* node2 = node.search(elt2);
+ mln_assertion(node2);
+ node2->add_child(elt4);
+ node2->add_child(elt5);
+ util::node<unsigned>* node3 = node.search(elt4);
+ mln_assertion(node3);
+ node3 = node2->search(elt1);
+ mln_assertion(!node3);
+ util::tree<unsigned>* tre = new util::tree<unsigned>(&node);
+ mln_assertion(tre);
+ tre->add_tree_up(elt6);
+ mln_assertion (tre->check_consistency());
+ std::cout << "before delete" << std::endl;
+ node.print (0);
+ std::cout << "after delete" << std::endl;
+ node2->delete_node();
+ node.print (0);
+}