
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena ChangeLog: 2007-11-22 Simon Nivault <simon.nivault@lrde.epita.fr> Review the set directory and add tests. * mln/set/all.hh, * mln/set/diff.hh, * mln/set/inter.hh, * mln/set/is_subset_of.hh, * mln/set/sym_diff.hh, * mln/set/uni.hh: Review. * tests/Makefile.am, * tests/set/Makefile.am, * tests/set/diff.cc, * tests/set/inter.cc, * tests/set/is_subset_of.cc, * tests/set/sym_diff.cc, * tests/set/uni.cc: Add tests. * mln/make/pix.hh: Doc. --- mln/make/pix.hh | 8 +++ mln/set/all.hh | 1 mln/set/diff.hh | 15 +++++-- mln/set/inter.hh | 4 + mln/set/is_subset_of.hh | 13 ++++++ mln/set/sym_diff.hh | 14 +++++- mln/set/uni.hh | 4 + tests/Makefile.am | 3 - tests/set/Makefile.am | 15 +++++++ tests/set/diff.cc | 93 +++++++++++++++++++++++++++++++++++++++++++++ tests/set/inter.cc | 94 ++++++++++++++++++++++++++++++++++++++++++++++ tests/set/is_subset_of.cc | 79 ++++++++++++++++++++++++++++++++++++++ tests/set/sym_diff.cc | 93 +++++++++++++++++++++++++++++++++++++++++++++ tests/set/uni.cc | 93 +++++++++++++++++++++++++++++++++++++++++++++ 14 files changed, 522 insertions(+), 7 deletions(-) Index: trunk/milena/tests/Makefile.am =================================================================== --- trunk/milena/tests/Makefile.am (revision 1510) +++ trunk/milena/tests/Makefile.am (revision 1511) @@ -9,7 +9,8 @@ draw \ border \ canvas \ - win + win \ + set check_PROGRAMS = \ accu_all \ Index: trunk/milena/tests/set/uni.cc =================================================================== --- trunk/milena/tests/set/uni.cc (revision 0) +++ trunk/milena/tests/set/uni.cc (revision 1511) @@ -0,0 +1,93 @@ +// 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/set/uni.cc + * + * \brief Tests on mln::set::uni. + */ + +#include <mln/set/uni.hh> +#include <mln/core/dpoint2d.hh> + +int main() +{ + using namespace mln; + + { + window<dpoint2d> win1; + win1 + .insert( 2, 7) + .insert( 2, 1) + .insert(-4, 0) + .insert( 0, 0) + .insert( 1, 1) + .insert( 6, 5); + window<dpoint2d> win2; + win2 + .insert( 2, 7) + .insert(-2, 1) + .insert(-4, 0) + .insert( 1,-1) + .insert( 6, 5); + window<dpoint2d> win3 = set::uni(win1, win2); + mln_assertion(win3.has(dpoint2d( 2, 1))); + mln_assertion(win3.has(dpoint2d( 0, 0))); + mln_assertion(win3.has(dpoint2d( 1, 1))); + mln_assertion(win3.has(dpoint2d( 2, 7))); + mln_assertion(win3.has(dpoint2d(-2, 1))); + mln_assertion(win3.has(dpoint2d(-4, 0))); + mln_assertion(win3.has(dpoint2d( 1,-1))); + mln_assertion(win3.has(dpoint2d( 6, 5))); + } + + { + p_set<point2d> pst1; + pst1 + .insert(point2d( 2, 7)) + .insert(point2d( 2, 1)) + .insert(point2d(-4, 0)) + .insert(point2d( 0, 0)) + .insert(point2d( 1, 1)) + .insert(point2d( 6, 5)); + p_set<point2d> pst2; + pst2 + .insert(point2d( 2, 7)) + .insert(point2d(-2, 1)) + .insert(point2d(-4, 0)) + .insert(point2d( 1,-1)) + .insert(point2d( 6, 5)); + p_set<point2d> pst3 = set::uni(pst1, pst2); + mln_assertion(pst3.has(point2d( 2, 1))); + mln_assertion(pst3.has(point2d( 0, 0))); + mln_assertion(pst3.has(point2d( 1, 1))); + mln_assertion(pst3.has(point2d( 2, 7))); + mln_assertion(pst3.has(point2d(-2, 1))); + mln_assertion(pst3.has(point2d(-4, 0))); + mln_assertion(pst3.has(point2d( 1,-1))); + mln_assertion(pst3.has(point2d( 6, 5))); + } +} Index: trunk/milena/tests/set/sym_diff.cc =================================================================== --- trunk/milena/tests/set/sym_diff.cc (revision 0) +++ trunk/milena/tests/set/sym_diff.cc (revision 1511) @@ -0,0 +1,93 @@ +// 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/set/sym_diff.cc + * + * \brief Tests on mln::set::sym_diff. + */ + +#include <mln/set/sym_diff.hh> +#include <mln/core/dpoint2d.hh> + +int main() +{ + using namespace mln; + + { + window<dpoint2d> win1; + win1 + .insert( 2, 7) + .insert( 2, 1) + .insert(-4, 0) + .insert( 0, 0) + .insert( 1, 1) + .insert( 6, 5); + window<dpoint2d> win2; + win2 + .insert( 2, 7) + .insert(-2, 1) + .insert(-4, 0) + .insert( 1,-1) + .insert( 6, 5); + window<dpoint2d> win3 = set::sym_diff(win1, win2); + mln_assertion(win3.has(dpoint2d( 2, 1))); + mln_assertion(win3.has(dpoint2d( 0, 0))); + mln_assertion(win3.has(dpoint2d( 1, 1))); + mln_assertion(!win3.has(dpoint2d( 2, 7))); + mln_assertion(win3.has(dpoint2d(-2, 1))); + mln_assertion(!win3.has(dpoint2d(-4, 0))); + mln_assertion(win3.has(dpoint2d( 1,-1))); + mln_assertion(!win3.has(dpoint2d( 6, 5))); + } + + { + p_set<point2d> pst1; + pst1 + .insert(point2d( 2, 7)) + .insert(point2d( 2, 1)) + .insert(point2d(-4, 0)) + .insert(point2d( 0, 0)) + .insert(point2d( 1, 1)) + .insert(point2d( 6, 5)); + p_set<point2d> pst2; + pst2 + .insert(point2d( 2, 7)) + .insert(point2d(-2, 1)) + .insert(point2d(-4, 0)) + .insert(point2d( 1,-1)) + .insert(point2d( 6, 5)); + p_set<point2d> pst3 = set::sym_diff(pst1, pst2); + mln_assertion(pst3.has(point2d( 2, 1))); + mln_assertion(pst3.has(point2d( 0, 0))); + mln_assertion(pst3.has(point2d( 1, 1))); + mln_assertion(!pst3.has(point2d( 2, 7))); + mln_assertion(pst3.has(point2d(-2, 1))); + mln_assertion(!pst3.has(point2d(-4, 0))); + mln_assertion(pst3.has(point2d( 1,-1))); + mln_assertion(!pst3.has(point2d( 6, 5))); + } +} Index: trunk/milena/tests/set/inter.cc =================================================================== --- trunk/milena/tests/set/inter.cc (revision 0) +++ trunk/milena/tests/set/inter.cc (revision 1511) @@ -0,0 +1,94 @@ +// 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/set/inter.cc + * + * \brief Tests on mln::set::inter. + */ + +#include <mln/set/inter.hh> +#include <mln/core/dpoint2d.hh> + + +int main() +{ + using namespace mln; + + { + window<dpoint2d> win1; + win1 + .insert( 2, 7) + .insert( 2, 1) + .insert(-4, 0) + .insert( 0, 0) + .insert( 1, 1) + .insert( 6, 5); + window<dpoint2d> win2; + win2 + .insert( 2, 7) + .insert(-2, 1) + .insert(-4, 0) + .insert( 1,-1) + .insert( 6, 5); + window<dpoint2d> win3 = set::inter(win1, win2); + mln_assertion(!win3.has(dpoint2d( 2, 1))); + mln_assertion(!win3.has(dpoint2d( 0, 0))); + mln_assertion(!win3.has(dpoint2d( 1, 1))); + mln_assertion(win3.has(dpoint2d( 2, 7))); + mln_assertion(!win3.has(dpoint2d(-2, 1))); + mln_assertion(win3.has(dpoint2d(-4, 0))); + mln_assertion(!win3.has(dpoint2d( 1,-1))); + mln_assertion(win3.has(dpoint2d( 6, 5))); + } + + { + p_set<point2d> pst1; + pst1 + .insert(point2d( 2, 7)) + .insert(point2d( 2, 1)) + .insert(point2d(-4, 0)) + .insert(point2d( 0, 0)) + .insert(point2d( 1, 1)) + .insert(point2d( 6, 5)); + p_set<point2d> pst2; + pst2 + .insert(point2d( 2, 7)) + .insert(point2d(-2, 1)) + .insert(point2d(-4, 0)) + .insert(point2d( 1,-1)) + .insert(point2d( 6, 5)); + p_set<point2d> pst3 = set::inter(pst1, pst2); + mln_assertion(!pst3.has(point2d( 2, 1))); + mln_assertion(!pst3.has(point2d( 0, 0))); + mln_assertion(!pst3.has(point2d( 1, 1))); + mln_assertion(pst3.has(point2d( 2, 7))); + mln_assertion(!pst3.has(point2d(-2, 1))); + mln_assertion(pst3.has(point2d(-4, 0))); + mln_assertion(!pst3.has(point2d( 1,-1))); + mln_assertion(pst3.has(point2d( 6, 5))); + } +} Index: trunk/milena/tests/set/is_subset_of.cc =================================================================== --- trunk/milena/tests/set/is_subset_of.cc (revision 0) +++ trunk/milena/tests/set/is_subset_of.cc (revision 1511) @@ -0,0 +1,79 @@ +// 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/set/is_subset_of.cc + * + * \brief Tests on mln::set::is_subset_of. + */ + +#include <mln/set/is_subset_of.hh> +#include <mln/core/p_set.hh> +#include <mln/core/point2d.hh> + +int main() +{ + using namespace mln; + + { + p_set<point2d> pst1; + p_set<point2d> pst2; + p_set<point2d> pst3; + p_set<point2d> pst4; + pst1 + .insert(point2d( 2, 7)) + .insert(point2d( 2, 1)) + .insert(point2d(-4, 0)) + .insert(point2d( 0, 0)) + .insert(point2d( 1, 1)) + .insert(point2d( 6, 5)); + pst2 + .insert(point2d( 2, 7)) + .insert(point2d(-2, 1)) + .insert(point2d(-4, 0)) + .insert(point2d( 1,-1)) + .insert(point2d( 6, 5)); + pst3 + .insert(point2d( 2, 7)) + .insert(point2d( 2, 1)) + .insert(point2d(-4, 0)) + .insert(point2d( 0, 0)) + .insert(point2d( 1, 1)) + .insert(point2d( 6, 5)) + .insert(point2d(-2, 1)) + .insert(point2d( 1,-1)); + + mln_assertion(set::is_subset_of(pst1, pst3)); + mln_assertion(set::is_subset_of(pst2, pst3)); + mln_assertion(!set::is_subset_of(pst3, pst1)); + mln_assertion(!set::is_subset_of(pst3, pst2)); + mln_assertion(set::is_subset_of(pst3, pst3)); + mln_assertion(set::is_subset_of(pst4, pst1)); + mln_assertion(set::is_subset_of(pst4, pst2)); + mln_assertion(set::is_subset_of(pst4, pst3)); + mln_assertion(set::is_subset_of(pst4, pst4)); + } +} Index: trunk/milena/tests/set/Makefile.am =================================================================== --- trunk/milena/tests/set/Makefile.am (revision 1510) +++ trunk/milena/tests/set/Makefile.am (revision 1511) @@ -1,3 +1,18 @@ ## Process this file through Automake to create Makefile.in -*- Makefile -*- include $(top_srcdir)/milena/tests/tests.mk + +check_PROGRAMS = \ + diff \ + inter \ + is_subset_of \ + sym_diff \ + uni + +diff_SOURCES = diff.cc +inter_SOURCES = inter.cc +is_subset_SOURCES = is_subset.cc +sym_diff_SOURCES = sym_diff.cc +uni_SOURCES = uni.cc + +TESTS = $(check_PROGRAMS) Index: trunk/milena/tests/set/diff.cc =================================================================== --- trunk/milena/tests/set/diff.cc (revision 0) +++ trunk/milena/tests/set/diff.cc (revision 1511) @@ -0,0 +1,93 @@ +// 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/set/diff.cc + * + * \brief Tests on mln::set::diff. + */ + +#include <mln/set/diff.hh> +#include <mln/core/dpoint2d.hh> + +int main() +{ + using namespace mln; + + { + window<dpoint2d> win1; + win1 + .insert( 2, 7) + .insert( 2, 1) + .insert(-4, 0) + .insert( 0, 0) + .insert( 1, 1) + .insert( 6, 5); + window<dpoint2d> win2; + win2 + .insert( 2, 7) + .insert(-2, 1) + .insert(-4, 0) + .insert( 1,-1) + .insert( 6, 5); + window<dpoint2d> win3 = set::diff(win1, win2); + mln_assertion(win3.has(dpoint2d( 2, 1))); + mln_assertion(win3.has(dpoint2d( 0, 0))); + mln_assertion(win3.has(dpoint2d( 1, 1))); + mln_assertion(!win3.has(dpoint2d( 2, 7))); + mln_assertion(!win3.has(dpoint2d(-2, 1))); + mln_assertion(!win3.has(dpoint2d(-4, 0))); + mln_assertion(!win3.has(dpoint2d( 1,-1))); + mln_assertion(!win3.has(dpoint2d( 6, 5))); + } + + { + p_set<point2d> pst1; + pst1 + .insert(point2d( 2, 7)) + .insert(point2d( 2, 1)) + .insert(point2d(-4, 0)) + .insert(point2d( 0, 0)) + .insert(point2d( 1, 1)) + .insert(point2d( 6, 5)); + p_set<point2d> pst2; + pst2 + .insert(point2d( 2, 7)) + .insert(point2d(-2, 1)) + .insert(point2d(-4, 0)) + .insert(point2d( 1,-1)) + .insert(point2d( 6, 5)); + p_set<point2d> pst3 = set::diff(pst1, pst2); + mln_assertion(pst3.has(point2d( 2, 1))); + mln_assertion(pst3.has(point2d( 0, 0))); + mln_assertion(pst3.has(point2d( 1, 1))); + mln_assertion(!pst3.has(point2d( 2, 7))); + mln_assertion(!pst3.has(point2d(-2, 1))); + mln_assertion(!pst3.has(point2d(-4, 0))); + mln_assertion(!pst3.has(point2d( 1,-1))); + mln_assertion(!pst3.has(point2d( 6, 5))); + } +} Index: trunk/milena/mln/make/pix.hh =================================================================== --- trunk/milena/mln/make/pix.hh (revision 1510) +++ trunk/milena/mln/make/pix.hh (revision 1511) @@ -42,7 +42,13 @@ namespace make { - /// Create an mln::pix from an image \p ima and a psite \p p. + /*! \brief Create an mln::util::pix from an image \p ima and a psite \p p. + * + * \param[in] ima The input image. + * \param[in] p The point site. + * + * \return An mln::util::pix. + */ template <typename I> mln::util::pix<I> pix(const Image<I>& ima, const mln_psite(I)& p); Index: trunk/milena/mln/set/inter.hh =================================================================== --- trunk/milena/mln/set/inter.hh (revision 1510) +++ trunk/milena/mln/set/inter.hh (revision 1511) @@ -69,6 +69,7 @@ window<mln_dpoint(Wl)> inter(const Window<Wl>& lhs, const Window<Wr>& rhs) { + trace::entering("set::inter"); mln::metal::equal<mln_dpoint(Wl), mln_dpoint(Wr)>::check(); typedef mln_dpoint(Wl) D; std::set<D> @@ -79,12 +80,14 @@ sr.begin(), sr.end(), std::inserter(s, s.begin())); return convert::to_window(s); + trace::exiting("set::inter"); } template <typename Wl, typename Wr> p_set<mln_point(Wl)> inter(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs) { + trace::entering("set::inter"); mln::metal::equal<mln_point(Wl), mln_point(Wr)>::check(); typedef mln_point(Wl) P; std::set<P> @@ -95,6 +98,7 @@ sr.begin(), sr.end(), std::inserter(s, s.begin())); return convert::to_p_set(s); + trace::exiting("set::inter"); } # endif // ! MLN_INCLUDE_ONLY Index: trunk/milena/mln/set/is_subset_of.hh =================================================================== --- trunk/milena/mln/set/is_subset_of.hh (revision 1510) +++ trunk/milena/mln/set/is_subset_of.hh (revision 1511) @@ -28,6 +28,11 @@ #ifndef MLN_SET_IS_SUBSET_OF_HH # define MLN_SET_IS_SUBSET_OF_HH +/*! \file mln/set/is_subset_of.hh + * + * \brief Routine to test if a set is a subset of another. + */ + # include <mln/core/concept/point_set.hh> namespace mln @@ -49,18 +54,26 @@ bool is_subset_of(const Point_Set<Pl>& lhs_, const Point_Set<Pr>& rhs_) { + trace::entering("set::is_subset_of"); Pl lhs = exact(lhs_); Pr rhs = exact(rhs_); if (lhs.npoints() > rhs.npoints()) + { + trace::exiting("set::is_subset_of"); return false; + } mln_piter(Pl) p(lhs); for_all(p) { if (!rhs.has(p)) + { + trace::exiting("set::is_subset_of"); return false; } + } + trace::exiting("set::is_subset_of"); return true; } Index: trunk/milena/mln/set/all.hh =================================================================== --- trunk/milena/mln/set/all.hh (revision 1510) +++ trunk/milena/mln/set/all.hh (revision 1511) @@ -44,6 +44,7 @@ # include <mln/set/diff.hh> # include <mln/set/inter.hh> +# include <mln/set/is_subset_of.hh> # include <mln/set/sym_diff.hh> # include <mln/set/union.hh> Index: trunk/milena/mln/set/diff.hh =================================================================== --- trunk/milena/mln/set/diff.hh (revision 1510) +++ trunk/milena/mln/set/diff.hh (revision 1511) @@ -49,12 +49,18 @@ namespace set { - /// Set theoretic difference of \p lhs and \p rhs. + /*! \brief Set theoretic difference of \p lhs and \p rhs. + * + * \relates mln::Window + */ template <typename Wl, typename Wr> window<mln_dpoint(Wl)> diff(const Window<Wl>& lhs, const Window<Wr>& rhs); - /// Set theoretic difference of \p lhs and \p rhs. + /*! \brief Set theoretic difference of \p lhs and \p rhs. + * + * \relates mln::Point_Set + */ template <typename Wl, typename Wr> p_set<mln_point(Wl)> diff(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs); @@ -66,6 +72,7 @@ window<mln_dpoint(Wl)> diff(const Window<Wl>& lhs, const Window<Wr>& rhs) { + trace::entering("set::diff"); mln::metal::equal<mln_dpoint(Wl), mln_dpoint(Wr)>::check(); typedef mln_dpoint(Wl) D; std::set<D> @@ -75,14 +82,15 @@ std::set_difference(sl.begin(), sl.end(), sr.begin(), sr.end(), std::inserter(s, s.begin())); + trace::exiting("set::diff"); return convert::to_window(s); } - /// Set theoretic difference of \p lhs and \p rhs. template <typename Wl, typename Wr> p_set<mln_point(Wl)> diff(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs) { + trace::entering("set::diff"); mln::metal::equal<mln_point(Wl), mln_point(Wr)>::check(); typedef mln_point(Wl) P; std::set<P> @@ -92,6 +100,7 @@ std::set_difference(sl.begin(), sl.end(), sr.begin(), sr.end(), std::inserter(s, s.begin())); + trace::exiting("set::diff"); return convert::to_p_set(s); } Index: trunk/milena/mln/set/uni.hh =================================================================== --- trunk/milena/mln/set/uni.hh (revision 1510) +++ trunk/milena/mln/set/uni.hh (revision 1511) @@ -69,6 +69,7 @@ window<mln_dpoint(Wl)> uni(const Window<Wl>& lhs, const Window<Wr>& rhs) { + trace::entering("set::uni"); mln::metal::equal<mln_dpoint(Wl), mln_dpoint(Wr)>::check(); typedef mln_dpoint(Wl) D; std::set<D> @@ -78,6 +79,7 @@ std::set_union(sl.begin(), sl.end(), sr.begin(), sr.end(), std::inserter(s, s.begin())); + trace::exiting("set::uni"); return convert::to_window(s); } @@ -85,6 +87,7 @@ p_set<mln_point(Wl)> uni(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs) { + trace::entering("set::uni"); mln::metal::equal<mln_point(Wl), mln_point(Wr)>::check(); typedef mln_point(Wl) P; std::set<P> @@ -94,6 +97,7 @@ std::set_union(sl.begin(), sl.end(), sr.begin(), sr.end(), std::inserter(s, s.begin())); + trace::exiting("set::uni"); return convert::to_p_set(s); } Index: trunk/milena/mln/set/sym_diff.hh =================================================================== --- trunk/milena/mln/set/sym_diff.hh (revision 1510) +++ trunk/milena/mln/set/sym_diff.hh (revision 1511) @@ -46,12 +46,18 @@ namespace set { - /// Set theoretic symmetrical difference of \p lhs and \p rhs. + /*! \brief Set theoretic symmetrical difference of \p lhs and \p rhs. + * + * \relates mln::Window + */ template <typename Wl, typename Wr> window<mln_dpoint(Wl)> sym_diff(const Window<Wl>& lhs, const Window<Wr>& rhs); - /// Set theoretic symmetrical difference of \p lhs and \p rhs. + /*! \brief Set theoretic symmetrical difference of \p lhs and \p rhs. + * + * \relates mln::Point_Set + */ template <typename Wl, typename Wr> p_set<mln_point(Wl)> sym_diff(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs); @@ -62,6 +68,7 @@ window<mln_dpoint(Wl)> sym_diff(const Window<Wl>& lhs, const Window<Wr>& rhs) { + trace::entering("set::sym_diff"); mln::metal::equal<mln_dpoint(Wl), mln_dpoint(Wr)>::check(); typedef mln_dpoint(Wl) D; std::set<D> @@ -71,6 +78,7 @@ std::set_symmetric_difference(sl.begin(), sl.end(), sr.begin(), sr.end(), std::inserter(s, s.begin())); + trace::exiting("set::sym_diff"); return convert::to_window(s); } @@ -78,6 +86,7 @@ p_set<mln_point(Wl)> sym_diff(const Point_Set<Wl>& lhs, const Point_Set<Wr>& rhs) { + trace::entering("set::sym_diff"); mln::metal::equal<mln_point(Wl), mln_point(Wr)>::check(); typedef mln_point(Wl) P; std::set<P> @@ -87,6 +96,7 @@ std::set_symmetric_difference(sl.begin(), sl.end(), sr.begin(), sr.end(), std::inserter(s, s.begin())); + trace::exiting("set::sym_diff"); return convert::to_p_set(s); }