Olena-patches
Threads by month
- ----- 2025 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
April 2009
- 11 participants
- 187 discussions
#159: Distribute SWIG wrappers
-------------------------+--------------------------------------------------
Reporter: levill_r | Owner: Olena Team
Type: enhancement | Status: new
Priority: minor | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Keywords: |
-------------------------+--------------------------------------------------
According to Alexandre Hamez, files generated by `swig` (e.g., `*.py` and
`*-wrap.cc`) are portable. We should distribute them, as
* it would save users wanting to use Swilena some time;
* it would free them to have SWIG to compile Swilena.
To do:
* distribute these files (remove `nodist_` prefixes);
* ensure they're available at distribution time (use `dist-hook` in
`Makefile.am`);
* add generated files to `MAINTAINERCLEANFILES`;
* adjust `configure.ac`? (see what Alexandre uses).
--
Ticket URL: <https://trac.lrde.org/olena/ticket/159>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
2
2
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Cleanup accu::image and add take_n_times.
* mln/accu/image/take.hh: Copy to...
* mln/accu/image/take_n_times.hh: ...this new file.
Update.
* mln/accu/image/all.hh: Update.
* mln/accu/image/init.hh,
* mln/accu/image/set_value.hh,
* mln/accu/image/to_result.hh: Fix missing static checks.
* mln/accu/image/take.hh (todo): New.
(take_tests): New.
(generic::take, take_fastest): Update.
Fix missing static checks.
* tests/accu/image/to_result.cc,
* tests/accu/image/init.cc,
* tests/accu/image/take.cc,
* tests/accu/image/set_value.cc,
* tests/accu/image/take_as_init.cc:
Change debug log into quiet test.
* tests/accu/image/take_n_times.cc: New.
* tests/accu/image/Makefile.am: Update.
* mln/border/resize_equal.hh: New.
* mln/border/all.hh: Update.
* tests/border/resize_equal.cc: New.
* tests/border/resize.cc: Cleanup.
* tests/border/Makefile.am: Update.
mln/accu/image/all.hh | 1
mln/accu/image/init.hh | 4 +
mln/accu/image/set_value.hh | 7 +
mln/accu/image/take.hh | 55 +++++++++++--
mln/accu/image/take_n_times.hh | 154 +++++++++++++++++++++++++--------------
mln/accu/image/to_result.hh | 4 +
mln/border/all.hh | 11 +-
mln/border/resize_equal.hh | 96 ++++++++++++++++++++++++
tests/accu/image/Makefile.am | 2
tests/accu/image/init.cc | 5 +
tests/accu/image/set_value.cc | 6 +
tests/accu/image/take.cc | 13 +--
tests/accu/image/take_as_init.cc | 12 +--
tests/accu/image/take_n_times.cc | 22 ++---
tests/accu/image/to_result.cc | 7 +
tests/border/Makefile.am | 2
tests/border/resize.cc | 34 ++++----
tests/border/resize_equal.cc | 43 ++++++++++
18 files changed, 365 insertions(+), 113 deletions(-)
Index: mln/accu/image/take_n_times.hh
--- mln/accu/image/take_n_times.hh (revision 3738)
+++ mln/accu/image/take_n_times.hh (working copy)
@@ -25,16 +25,19 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_ACCU_IMAGE_TAKE_HH
-# define MLN_ACCU_IMAGE_TAKE_HH
+#ifndef MLN_ACCU_IMAGE_TAKE_N_TIMES_HH
+# define MLN_ACCU_IMAGE_TAKE_N_TIMES_HH
-/// \file mln/accu/image/take.hh
+/// \file mln/accu/image/take_n_times.hh
///
/// Update an image of accumulators by taking the contents of another
-/// image.
+/// image with a multiplicity.
+///
+/// \todo Add "take(input, n, arg_value)".
# include <mln/core/concept/accumulator.hh>
# include <mln/core/concept/image.hh>
+# include <mln/border/resize.hh>
namespace mln
@@ -46,14 +49,45 @@
namespace image
{
- template <typename I, typename J>
+ template <typename I, typename J, typename K>
void
- take(Image<I>& input, const Image<J>& arg);
+ take_n_times(Image<I>& input, const Image<J>& n_times, const Image<K>& arg);
# ifndef MLN_INCLUDE_ONLY
+
+ // Tests.
+
+ namespace internal
+ {
+
+ template <typename I, typename J, typename K>
+ void
+ take_n_times_tests(Image<I>& input_, const Image<J>& n_times_, const Image<K>& arg_)
+ {
+ I& input = exact(input_);
+ const J& n_times = exact(n_times_);
+ const K& arg = exact(arg_);
+
+ mln_precondition(input.is_valid());
+ mln_precondition(n_times.is_valid());
+ mln_precondition(arg.is_valid());
+
+ mln_precondition(arg.domain() <= input.domain());
+ mln_precondition(arg.domain() <= n_times.domain());
+
+ (void) input;
+ (void) n_times;
+ (void) arg;
+ }
+
+ } // end of namespace mln::accu::image::internal
+
+
+ // Implementations.
+
namespace impl
{
@@ -62,24 +96,27 @@
namespace generic
{
- template <typename I, typename J>
+ template <typename I, typename J, typename K>
void
- take(Image<I>& input_, const Image<J>& arg_)
+ take_n_times(Image<I>& input_, const Image<J>& n_times_, const Image<K>& arg_)
{
- trace::entering("accu::impl::image::generic::take");
+ trace::entering("accu::impl::image::generic::take_n_times");
+
+ mlc_is_a(mln_value(I), Accumulator)::check();
+ mlc_converts_to(mln_value(J), unsigned)::check();
+ mlc_converts_to(mln_value(K), mln_deduce(I, value, argument))::check();
I& input = exact(input_);
- const J& arg = exact(arg_);
+ const J& n_times = exact(n_times_);
+ const K& arg = exact(arg_);
- mln_precondition(input.is_valid());
- mln_precondition(arg.is_valid());
- mln_precondition(arg.domain() <= input.domain());
+ internal::take_n_times_tests(input, n_times, arg);
mln_piter(J) p(arg.domain());
for_all(p)
- input(p).take(arg(p));
+ input(p).take_n_times(n_times(p), arg(p));
- trace::exiting("accu::impl::image::generic::take");
+ trace::exiting("accu::impl::image::generic::take_n_times");
}
} // end of namespace mln::accu::image::impl::generic
@@ -87,25 +124,36 @@
// Fastest version.
- template <typename I, typename J>
+ template <typename I, typename J, typename K>
void
- take_fastest(Image<I>& input_, const Image<J>& arg_)
+ take_n_times_fastest(Image<I>& input_, const Image<J>& n_times_, const Image<K>& arg_)
{
- trace::entering("accu::impl::image::take_fastest");
+ trace::entering("accu::impl::image::take_n_times_fastest");
+
+ mlc_is_a(mln_value(I), Accumulator)::check();
+ mlc_converts_to(mln_value(J), unsigned)::check();
+ mlc_converts_to(mln_value(K), mln_deduce(I, value, argument))::check();
I& input = exact(input_);
- const J& arg = exact(arg_);
+ const J& n_times = exact(n_times_);
+ const K& arg = exact(arg_);
- mln_precondition(input.is_valid());
- mln_precondition(arg.is_valid());
+ internal::take_n_times_tests(input, n_times, arg);
+
+ // Extra (stronger) tests.
mln_precondition(arg.domain() == input.domain());
+ mln_precondition(arg.domain() == n_times.domain());
+
+ border::resize(n_times, input.border());
+ border::resize(arg, input.border());
mln_pixter(I) p_in(input);
- mln_pixter(const J) p_arg(arg);
- for_all_2(p_in, p_arg)
- p_in.val().take( p_arg.val() );
+ mln_pixter(const J) p_ntm(n_times);
+ mln_pixter(const K) p_arg(arg);
+ for_all_3(p_in, p_ntm, p_arg)
+ p_in.val().take_n_times( p_ntm.val(), p_arg.val() );
- trace::exiting("accu::impl::image::take_fastest");
+ trace::exiting("accu::impl::image::take_n_times_fastest");
}
} // end of namespace mln::accu::image::impl
@@ -117,34 +165,38 @@
namespace internal
{
- template <typename I, typename J>
+ template <typename I, typename J, typename K>
void
- take_dispatch(trait::image::speed::any,
+ take_n_times_dispatch(trait::image::speed::any,
trait::image::speed::any,
- Image<I>& input, const Image<J>& arg)
+ trait::image::speed::any,
+ Image<I>& input, const Image<J>& n_times, const Image<K>& arg)
{
- impl::generic::take(input, arg);
+ impl::generic::take_n_times(input, n_times, arg);
}
- template <typename I, typename J>
+ template <typename I, typename J, typename K>
void
- take_dispatch(trait::image::speed::fastest,
+ take_n_times_dispatch(trait::image::speed::fastest,
+ trait::image::speed::fastest,
trait::image::speed::fastest,
- Image<I>& input, const Image<J>& arg)
+ Image<I>& input, const Image<J>& n_times, const Image<K>& arg)
{
- if (exact(arg).domain() == exact(input).domain())
- impl::take_fastest(input, arg);
+ if (exact(n_times).domain() == exact(input).domain() &&
+ exact(arg) .domain() == exact(input).domain())
+ impl::take_n_times_fastest(input, n_times, arg);
else
- impl::generic::take(input, arg);
+ impl::generic::take_n_times(input, n_times, arg);
}
- template <typename I, typename J>
+ template <typename I, typename J, typename K>
void
- take_dispatch(Image<I>& input, const Image<J>& arg)
+ take_n_times_dispatch(Image<I>& input, const Image<J>& n_times, const Image<K>& arg)
{
- take_dispatch(mln_trait_image_speed(I)(),
+ take_n_times_dispatch(mln_trait_image_speed(I)(),
mln_trait_image_speed(J)(),
- input, arg);
+ mln_trait_image_speed(K)(),
+ input, n_times, arg);
}
} // end of namespace mln::accu::image::internal
@@ -152,26 +204,24 @@
// Facade.
- template <typename I, typename J>
+ template <typename I, typename J, typename K>
void
- take(Image<I>& input_, const Image<J>& arg_)
+ take_n_times(Image<I>& input_, const Image<J>& n_times_, const Image<K>& arg_)
{
- trace::entering("accu::image::take");
+ trace::entering("accu::image::take_n_times");
mlc_is_a(mln_value(I), Accumulator)::check();
- mlc_converts_to(mln_value(J),
- mln_deduce(I, value, argument))::check();
+ mlc_converts_to(mln_value(J), unsigned)::check();
+ mlc_converts_to(mln_value(K), mln_deduce(I, value, argument))::check();
I& input = exact(input_);
- const J& arg = exact(arg_);
-
- mln_precondition(input.is_valid());
- mln_precondition(arg.is_valid());
- mln_precondition(arg.domain() <= input.domain());
+ const J& n_times = exact(n_times_);
+ const K& arg = exact(arg_);
- internal::take_dispatch(input, arg);
+ internal::take_n_times_tests(input, n_times, arg);
+ internal::take_n_times_dispatch(input, n_times, arg);
- trace::exiting("accu::image::take");
+ trace::exiting("accu::image::take_n_times");
}
# endif // ! MLN_INCLUDE_ONLY
@@ -183,4 +233,4 @@
} // end of namespace mln
-#endif // ! MLN_ACCU_IMAGE_TAKE_HH
+#endif // ! MLN_ACCU_IMAGE_TAKE_N_TIMES_HH
Property changes on: mln/accu/image/take_n_times.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: mln/accu/image/init.hh
--- mln/accu/image/init.hh (revision 3738)
+++ mln/accu/image/init.hh (working copy)
@@ -67,6 +67,8 @@
{
trace::entering("accu::impl::image::generic::init");
+ mlc_is_a(mln_value(I), Accumulator)::check();
+
I& input = exact(input_);
mln_precondition(input.is_valid());
@@ -88,6 +90,8 @@
{
trace::entering("accu::impl::image::init_fastest");
+ mlc_is_a(mln_value(I), Accumulator)::check();
+
I& input = exact(input_);
mln_precondition(input.is_valid());
Index: mln/accu/image/take.hh
--- mln/accu/image/take.hh (revision 3738)
+++ mln/accu/image/take.hh (working copy)
@@ -32,9 +32,12 @@
///
/// Update an image of accumulators by taking the contents of another
/// image.
+///
+/// \todo Add "take(input, arg_value)".
# include <mln/core/concept/accumulator.hh>
# include <mln/core/concept/image.hh>
+# include <mln/border/resize_equal.hh>
namespace mln
@@ -54,6 +57,34 @@
# ifndef MLN_INCLUDE_ONLY
+
+ // Tests.
+
+ namespace internal
+ {
+
+ template <typename I, typename J>
+ void
+ take_tests(Image<I>& input_, const Image<J>& arg_)
+ {
+ I& input = exact(input_);
+ const J& arg = exact(arg_);
+
+ mln_precondition(input.is_valid());
+ mln_precondition(arg.is_valid());
+
+ mln_precondition(arg.domain() <= input.domain());
+
+ (void) input;
+ (void) arg;
+ }
+
+ } // end of namespace mln::accu::image::internal
+
+
+
+ // Implementations.
+
namespace impl
{
@@ -68,12 +99,13 @@
{
trace::entering("accu::impl::image::generic::take");
+ mlc_is_a(mln_value(I), Accumulator)::check();
+ mlc_converts_to(mln_value(J), mln_deduce(I, value, argument))::check();
+
I& input = exact(input_);
const J& arg = exact(arg_);
- mln_precondition(input.is_valid());
- mln_precondition(arg.is_valid());
- mln_precondition(arg.domain() <= input.domain());
+ internal::take_tests(input, arg);
mln_piter(J) p(arg.domain());
for_all(p)
@@ -93,13 +125,18 @@
{
trace::entering("accu::impl::image::take_fastest");
+ mlc_is_a(mln_value(I), Accumulator)::check();
+ mlc_converts_to(mln_value(J), mln_deduce(I, value, argument))::check();
+
I& input = exact(input_);
const J& arg = exact(arg_);
- mln_precondition(input.is_valid());
- mln_precondition(arg.is_valid());
+ internal::take_tests(input, arg);
+ // Extra (stronger) test.
mln_precondition(arg.domain() == input.domain());
+ border::resize_equal(input, arg);
+
mln_pixter(I) p_in(input);
mln_pixter(const J) p_arg(arg);
for_all_2(p_in, p_arg)
@@ -159,16 +196,12 @@
trace::entering("accu::image::take");
mlc_is_a(mln_value(I), Accumulator)::check();
- mlc_converts_to(mln_value(J),
- mln_deduce(I, value, argument))::check();
+ mlc_converts_to(mln_value(J), mln_deduce(I, value, argument))::check();
I& input = exact(input_);
const J& arg = exact(arg_);
- mln_precondition(input.is_valid());
- mln_precondition(arg.is_valid());
- mln_precondition(arg.domain() <= input.domain());
-
+ internal::take_tests(input, arg);
internal::take_dispatch(input, arg);
trace::exiting("accu::image::take");
Index: mln/accu/image/set_value.hh
--- mln/accu/image/set_value.hh (revision 3738)
+++ mln/accu/image/set_value.hh (working copy)
@@ -31,6 +31,8 @@
/// \file mln/accu/image/set_value.hh
///
/// Set the values of an image of accumulators.
+///
+/// \todo Add "set_value(Image<I>& input, const Image<J>& values)".
# include <mln/core/concept/accumulator.hh>
# include <mln/core/concept/image.hh>
@@ -51,7 +53,6 @@
const mln_deduce(I, value, result)& res);
-
# ifndef MLN_INCLUDE_ONLY
namespace impl
@@ -69,6 +70,8 @@
{
trace::entering("accu::impl::image::generic::set_value");
+ mlc_is_a(mln_value(I), Accumulator)::check();
+
I& input = exact(input_);
mln_precondition(input.is_valid());
@@ -91,6 +94,8 @@
{
trace::entering("accu::impl::image::set_value_fastest");
+ mlc_is_a(mln_value(I), Accumulator)::check();
+
I& input = exact(input_);
mln_precondition(input.is_valid());
Index: mln/accu/image/all.hh
--- mln/accu/image/all.hh (revision 3738)
+++ mln/accu/image/all.hh (working copy)
@@ -50,6 +50,7 @@
# include <mln/accu/image/set_value.hh>
# include <mln/accu/image/take_as_init.hh>
# include <mln/accu/image/take.hh>
+# include <mln/accu/image/take_n_times.hh>
# include <mln/accu/image/to_result.hh>
Index: mln/accu/image/to_result.hh
--- mln/accu/image/to_result.hh (revision 3738)
+++ mln/accu/image/to_result.hh (working copy)
@@ -67,6 +67,8 @@
{
trace::entering("accu::impl::image::generic::to_result");
+ mlc_is_a(mln_value(I), Accumulator)::check();
+
const I& input = exact(input_);
mln_precondition(input.is_valid());
@@ -93,6 +95,8 @@
{
trace::entering("accu::impl::image::to_result_fastest");
+ mlc_is_a(mln_value(I), Accumulator)::check();
+
const I& input = exact(input_);
mln_precondition(input.is_valid());
Index: mln/border/all.hh
--- mln/border/all.hh (revision 3738)
+++ mln/border/all.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_BORDER_ALL_HH
# define MLN_BORDER_ALL_HH
-/*! \file mln/border/all.hh
- *
- * \brief File that includes all border-related routines.
- */
+/// \file mln/border/all.hh
+///
+/// File that includes all border-related routines.
namespace mln
@@ -60,6 +60,7 @@
# include <mln/border/get.hh>
# include <mln/border/mirror.hh>
# include <mln/border/resize.hh>
+# include <mln/border/resize_equal.hh>
# include <mln/border/thickness.hh>
Index: mln/border/resize_equal.hh
--- mln/border/resize_equal.hh (revision 0)
+++ mln/border/resize_equal.hh (revision 0)
@@ -0,0 +1,96 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// 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.
+
+#ifndef MLN_BORDER_RESIZE_EQUAL_HH
+# define MLN_BORDER_RESIZE_EQUAL_HH
+
+/// \file mln/border/resize_equal.hh
+///
+/// Define a function that resizes the virtual border of a couple of
+/// images so that they eventually have the same border thickness.
+
+# include <mln/border/resize.hh>
+
+
+namespace mln
+{
+
+ namespace border
+ {
+
+ // FIXEM: Doc!
+ template <typename I, typename J>
+ void
+ resize_equal(const Image<I>& ima1, const Image<J>& ima2);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename I, typename J>
+ inline
+ void
+ resize_equal(const Image<I>& ima1_, const Image<J>& ima2_)
+ {
+ trace::entering("border::resize_equal");
+
+ // Static checks.
+ mlc_equal(mln_trait_image_ext_domain(I),
+ trait::image::ext_domain::extendable)::check();
+ mlc_equal(mln_trait_image_ext_domain(J),
+ trait::image::ext_domain::extendable)::check();
+
+ const I& ima1 = exact(ima1_);
+ const J& ima2 = exact(ima2_);
+
+ // Dynamic tests.
+ mln_precondition(ima1.is_valid());
+ mln_precondition(ima2.is_valid());
+ mln_precondition(ima2.domain() == ima1.domain());
+
+ unsigned
+ b1 = border::get(ima1),
+ b2 = border::get(ima2);
+
+ if (b2 > b1)
+ border::resize(ima1, b2);
+ else
+ if (b1 > b2)
+ border::resize(ima2, b1);
+ // else no-op when b2 == b1.
+
+ trace::exiting("border::resize_equal");
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::border
+
+} // end of namespace mln
+
+
+#endif // ! MLN_BORDER_RESIZE_EQUAL_HH
Index: tests/accu/image/to_result.cc
--- tests/accu/image/to_result.cc (revision 3738)
+++ tests/accu/image/to_result.cc (working copy)
@@ -33,7 +33,10 @@
#include <mln/accu/count.hh>
#include <mln/accu/image/init.hh>
#include <mln/accu/image/to_result.hh>
-#include <mln/debug/println.hh>
+
+#include <mln/level/compare.hh>
+#include <mln/pw/cst.hh>
+#include <mln/pw/image.hh>
int main()
@@ -45,5 +48,5 @@
accu::image::init(ima);
image2d<unsigned> res = accu::image::to_result(ima);
- debug::println(res);
+ mln_assertion(res == (pw::cst(0u) | res.domain()));
}
Index: tests/accu/image/take_n_times.cc
--- tests/accu/image/take_n_times.cc (revision 3738)
+++ tests/accu/image/take_n_times.cc (working copy)
@@ -25,34 +25,32 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/accu/image/take.cc
+/// \file tests/accu/image/take_n_times.cc
///
-/// Tests on mln::accu::image::take.
+/// Tests on mln::accu::image::take_n_times.
#include <mln/core/image/image2d.hh>
#include <mln/data/fill.hh>
+#include <mln/level/compare.hh>
+#include <mln/pw/cst.hh>
+#include <mln/pw/image.hh>
+
#include <mln/accu/sum.hh>
#include <mln/accu/image/init.hh>
-#include <mln/accu/image/take.hh>
-
-#include <mln/debug/println.hh>
+#include <mln/accu/image/take_n_times.hh>
int main()
{
using namespace mln;
- typedef accu::sum<int> A;
+ typedef accu::sum<int,int> A;
image2d<A> ima(2, 2);
accu::image::init(ima);
- debug::println(ima);
image2d<int> dta(2, 2);
data::fill(dta, 7);
- accu::image::take(ima, dta);
- debug::println(ima);
-
- accu::image::take(ima, ima);
- debug::println(ima);
+ accu::image::take_n_times(ima, dta, dta);
+ mln_assertion(ima == (pw::cst(49) | ima.domain()));
}
Property changes on: tests/accu/image/take_n_times.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: tests/accu/image/init.cc
--- tests/accu/image/init.cc (revision 3738)
+++ tests/accu/image/init.cc (working copy)
@@ -30,6 +30,10 @@
/// Tests on mln::accu::image::init.
#include <mln/core/image/image2d.hh>
+#include <mln/level/compare.hh>
+#include <mln/pw/cst.hh>
+#include <mln/pw/image.hh>
+
#include <mln/accu/count.hh>
#include <mln/accu/image/init.hh>
@@ -42,4 +46,5 @@
image2d<A> ima(2, 2);
accu::image::init(ima);
+ mln_assertion(ima == (pw::cst(0u) | ima.domain()));
}
Index: tests/accu/image/take.cc
--- tests/accu/image/take.cc (revision 3738)
+++ tests/accu/image/take.cc (working copy)
@@ -31,28 +31,29 @@
#include <mln/core/image/image2d.hh>
#include <mln/data/fill.hh>
+#include <mln/level/compare.hh>
+#include <mln/pw/cst.hh>
+#include <mln/pw/image.hh>
+
#include <mln/accu/sum.hh>
#include <mln/accu/image/init.hh>
#include <mln/accu/image/take.hh>
-#include <mln/debug/println.hh>
-
int main()
{
using namespace mln;
- typedef accu::sum<int> A;
+ typedef accu::sum<int,int> A;
image2d<A> ima(2, 2);
accu::image::init(ima);
- debug::println(ima);
image2d<int> dta(2, 2);
data::fill(dta, 7);
accu::image::take(ima, dta);
- debug::println(ima);
+ mln_assertion(ima == (pw::cst(7) | ima.domain()));
accu::image::take(ima, ima);
- debug::println(ima);
+ mln_assertion(ima == (pw::cst(14) | ima.domain()));
}
Index: tests/accu/image/Makefile.am
--- tests/accu/image/Makefile.am (revision 3738)
+++ tests/accu/image/Makefile.am (working copy)
@@ -7,12 +7,14 @@
set_value \
take \
take_as_init \
+ take_n_times \
to_result
init_SOURCES = init.cc
set_value_SOURCES = set_value.cc
take_SOURCES = take.cc
take_as_init_SOURCES = take_as_init.cc
+take_n_times_SOURCES = take_n_times.cc
to_result_SOURCES = to_result.cc
TESTS = $(check_PROGRAMS)
Index: tests/accu/image/set_value.cc
--- tests/accu/image/set_value.cc (revision 3738)
+++ tests/accu/image/set_value.cc (working copy)
@@ -33,7 +33,9 @@
#include <mln/accu/count.hh>
#include <mln/accu/image/set_value.hh>
-#include <mln/debug/println.hh>
+#include <mln/level/compare.hh>
+#include <mln/pw/cst.hh>
+#include <mln/pw/image.hh>
int main()
@@ -44,5 +46,5 @@
image2d<A> ima(2, 2);
accu::image::set_value(ima, 3);
- debug::println(ima);
+ mln_assertion(ima == (pw::cst(3u) | ima.domain()));
}
Index: tests/accu/image/take_as_init.cc
--- tests/accu/image/take_as_init.cc (revision 3738)
+++ tests/accu/image/take_as_init.cc (working copy)
@@ -30,22 +30,24 @@
/// Tests on mln::accu::image::take_as_init.
#include <mln/core/image/image2d.hh>
+#include <mln/level/compare.hh>
+#include <mln/pw/cst.hh>
+#include <mln/pw/image.hh>
+
#include <mln/accu/sum.hh>
#include <mln/accu/image/take_as_init.hh>
-#include <mln/debug/println.hh>
-
int main()
{
using namespace mln;
- typedef accu::sum<int> A;
+ typedef accu::sum<int,int> A;
image2d<A> ima(2, 2);
accu::image::take_as_init(ima, 3);
- debug::println(ima);
+ mln_assertion(ima == (pw::cst(3) | ima.domain()));
accu::image::take_as_init(ima, ima);
- debug::println(ima);
+ mln_assertion(ima == (pw::cst(3) | ima.domain()));
}
Index: tests/border/resize.cc
--- tests/border/resize.cc (revision 3738)
+++ tests/border/resize.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,29 +26,28 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/border/resize.cc
- *
- * \brief Tests on mln::border::resize.
- */
-
+/// \file tests/border/resize.cc
+///
+/// Tests on mln::border::resize.
#include <mln/core/image/image2d.hh>
-#include <mln/value/int_u8.hh>
#include <mln/border/resize.hh>
-#include <mln/border/get.hh>
-using namespace mln;
-int
-main (void)
+int main()
{
- unsigned border = 1;
- unsigned new_border = 3;
+ using namespace mln;
+
+ const unsigned
+ border = 1,
+ new_border = 3;
+
+ image2d<int> ima(3, 2, border);
+ mln_assertion(ima.border() == border);
- image2d<value::int_u8> ima(3, 2, border);
- mln_assertion(border::get(ima) == border);
border::resize (ima, new_border);
- mln_assertion(border::get(ima) == new_border);
+ mln_assertion(ima.border() == new_border);
+
border::resize (ima, border);
- mln_assertion(border::get(ima) == border);
+ mln_assertion(ima.border() == border);
}
Index: tests/border/Makefile.am
--- tests/border/Makefile.am (revision 3738)
+++ tests/border/Makefile.am (working copy)
@@ -11,6 +11,7 @@
find \
get \
mirror \
+ resize_equal \
resize_image1d_1 \
resize_image1d_2 \
resize_image1d_3 \
@@ -32,6 +33,7 @@
find_SOURCES = find.cc
get_SOURCES = get.cc
mirror_SOURCES = mirror.cc
+resize_equal_SOURCES = resize_equal.cc
resize_image1d_1_SOURCES = resize_image1d_1.cc
resize_image1d_2_SOURCES = resize_image1d_2.cc
resize_image1d_3_SOURCES = resize_image1d_3.cc
Index: tests/border/resize_equal.cc
--- tests/border/resize_equal.cc (revision 0)
+++ tests/border/resize_equal.cc (revision 0)
@@ -0,0 +1,43 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// 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/border/resize_equal.cc
+///
+/// Tests on mln::border::resize_equal.
+
+#include <mln/core/image/image2d.hh>
+#include <mln/border/resize_equal.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ image2d<int> ima1(1,1, 1), ima2(1,1, 2);
+ border::resize_equal(ima1, ima2);
+ mln_assertion(ima1.border() == 2);
+}
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix wrong update in morpho attribute card.
* mln/morpho/attribute/card.hh: Fix wrong update.
* mln/canvas/morpho/attribute_filter.hh: Layout.
* tests/morpho/closing/area.cc: Make it quiet.
* tests/morpho/closing/algebraic.cc: Likewise.
mln/morpho/attribute/card.hh | 15 +++++++++------
tests/morpho/closing/algebraic.cc | 2 +-
tests/morpho/closing/area.cc | 16 ++++++++++++----
3 files changed, 22 insertions(+), 11 deletions(-)
Index: mln/morpho/attribute/card.hh
--- mln/morpho/attribute/card.hh (revision 3737)
+++ mln/morpho/attribute/card.hh (working copy)
@@ -32,6 +32,9 @@
///
/// Define an accumulator that computes the cardinality of a
/// component.
+///
+/// \todo Add a static check in the accumulator concept so that
+/// when_pix::use_none => take_as_init() is provided.
# include <mln/accu/internal/base.hh>
# include <mln/util/pix.hh>
@@ -94,9 +97,9 @@
void take(const util::pix<I>& px);
void take(const card<I>& other);
- void take_as_init_();
- void take_as_init_(const util::pix<I>& px);
- using super_::take_as_init_;
+ using super_::take_as_init;
+ void take_as_init(); // Extra version.
+ void take_as_init_(const util::pix<I>& px); // Overload.
/// \}
/// Get the value of the accumulator.
@@ -164,12 +167,12 @@
c_ += other.c_;
}
- // take_as_init_.
+ // take_as_init.
template <typename I>
inline
void
- card<I>::take_as_init_()
+ card<I>::take_as_init()
{
init();
take();
@@ -180,7 +183,7 @@
void
card<I>::take_as_init_(const util::pix<I>&)
{
- take_as_init_();
+ take_as_init();
}
template <typename I>
Index: mln/canvas/morpho/attribute_filter.hh
Index: tests/morpho/closing/area.cc
--- tests/morpho/closing/area.cc (revision 3737)
+++ tests/morpho/closing/area.cc (working copy)
@@ -31,11 +31,16 @@
/// Test on mln::morpho::closing::area.
#include <mln/core/image/image2d.hh>
-#include <mln/value/int_u8.hh>
#include <mln/core/alias/neighb2d.hh>
+#include <mln/value/int_u8.hh>
#include <mln/io/pgm/load.hh>
-#include <mln/io/pgm/save.hh>
+
+#include <mln/accu/max.hh>
+#include <mln/level/compute.hh>
+#include <mln/level/compare.hh>
+#include <mln/pw/cst.hh>
+#include <mln/pw/image.hh>
#include <mln/morpho/closing/area.hh>
@@ -48,7 +53,10 @@
using namespace mln;
using value::int_u8;
- image2d<int_u8> lena;
+ image2d<int_u8> lena, clo;
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
- io::pgm::save(morpho::closing::area(lena, c4(), 510), "out.pgm");
+ clo = morpho::closing::area(lena, c4(), lena.nrows() * lena.ncols());
+
+ int_u8 m = level::compute(accu::max<int_u8>(), lena);
+ mln_assertion(clo == (pw::cst(m) | lena.domain()));
}
Index: tests/morpho/closing/algebraic.cc
--- tests/morpho/closing/algebraic.cc (revision 3737)
+++ tests/morpho/closing/algebraic.cc (working copy)
@@ -48,7 +48,7 @@
using namespace mln;
using value::int_u8;
- trace::quiet = false;
+ trace::quiet = true;
typedef image2d<int_u8> I;
I lena;
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-04-30 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Fixed display_edge() function.
* mln/world/inter_pixel/display_edge.hh: Create an image
displaying edges values (int_u8).
---
display_edge.hh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: trunk/milena/mln/world/inter_pixel/display_edge.hh
===================================================================
--- trunk/milena/mln/world/inter_pixel/display_edge.hh (revision 3736)
+++ trunk/milena/mln/world/inter_pixel/display_edge.hh (revision 3737)
@@ -48,12 +48,12 @@
{
template <typename I>
+ inline
I display_edge(const I& ima, mln_value(I) bg, unsigned zoom)
{
- unsigned nrows = ima.nrows() / 2 + 1;
- unsigned ncols = ima.ncols() / 2 + 1;
- I output(nrows * (zoom + 1) - 1,
- ncols * (zoom + 1) - 1);
+ box2d b = ima.bbox();
+ I output(make::box2d((b.pmin()[0] / 2) * (zoom + 1) + 1, (b.pmin()[1] / 2) * (zoom + 1) + 1,
+ (b.pmax()[0] / 2) * (zoom + 1) - 1, (b.pmax()[1] / 2) * (zoom + 1) - 1));
data::fill(output, bg);
typedef image_if<const I, dim2::is_edge> edge_t;
edge_t edge = ima | dim2::is_edge();
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
ChangeLog:
2009-04-30 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Update fixed segmentation, edges seems ok.
* fabien/igr/Makefile.rules: Update CXX to g++.
* fabien/igr/seg_fixed.cc: Update, edges appear to work.
---
Makefile.rules | 4 ++--
seg_fixed.cc | 41 +++++++++++++++++++++++------------------
2 files changed, 25 insertions(+), 20 deletions(-)
Index: trunk/milena/sandbox/fabien/igr/seg_fixed.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/seg_fixed.cc (revision 3735)
+++ trunk/milena/sandbox/fabien/igr/seg_fixed.cc (revision 3736)
@@ -56,16 +56,12 @@
template <typename I>
inline
float
-compute_dist(image2d<util::array<I> > ima_arr,
- image2d<float> ima_sum,
+compute_dist(image2d<util::array<I> >& ima_arr,
+ image2d<float>& ima_sum,
point2d p, point2d n)
{
float res = 0.f;
- std::cout << "computing..." << std::endl;
- std::cout << "ima_arr.bbox(): " << ima_arr.bbox() << std::endl;
- std::cout << "ima_arr(p).nelements(): " << ima_arr(p).nelements() << std::endl;
- std::cout << "ima_arr(n).nelements(): " << ima_arr(n).nelements() << std::endl;
for (unsigned i = 0; i < ima_arr(p).nelements(); ++i)
res += std::min(ima_arr(p)[i], ima_arr(n)[i]);
@@ -75,14 +71,15 @@
else
res = 0.f;
- //std::cout << "\t" << res << std::endl;
+ //std::cout << "dist: " << res << std::endl;
+
return res;
}
template <typename I>
inline
void
-compute_sum_arrays(image2d<float> ima_sum, image2d<util::array<I> > ima_arr)
+compute_sum_arrays(image2d<float>& ima_sum, image2d<util::array<I> >& ima_arr)
{
mln_piter(image2d<float>) p(ima_sum.domain());
for_all(p)
@@ -95,8 +92,9 @@
}
template <typename I>
+inline
image2d<float>
-dist_on_edges(image2d<util::array<I> > ima_arr)
+dist_on_edges(image2d<util::array<I> >& ima_arr)
{
box2d b = ima_arr.bbox();
image2d<float> edges(make::box2d(2 * b.pmin()[0], 2 * b.pmin()[1],
@@ -111,20 +109,16 @@
mln_niter(neighb2d) n(c4(), p);
for_all(p)
{
+ //std::cout << "can i has a loop?" << std::endl;
for_all(n)
{
point2d location = get_edge_location(p, n);
+ //std::cout << "p: " << p << " | n: " << n << " | location: " << location << std::endl;
if (b.has(n) && edge_b.has(location) && edges(location) == -1.f)
{
- std::cout << "p: " << p << " | n: " << n << " | e: " << location << std::endl;
- std::cout << "will compute..." << std::endl;
- float res = compute_dist(ima_arr, ima_sum, p, n);
- std::cout << "has computed" << std::endl << std::endl;
- std::cout << "\t" << res << std::endl;
- edges(location) = res;
+ //std::cout << "\\o/" << std::endl;
+ edges(location) = compute_dist(ima_arr, ima_sum, p, n);
}
- else
- std::cout << "." << std::endl;
}
}
@@ -162,8 +156,19 @@
// Edges computation.
image2d<float> edges = dist_on_edges(ima_arr);
+ /*mln_piter_(image2d<float>) p_iter(edges.domain());
+ for_all(p_iter)
+ {
+ std::cout << "<main> " << edges(p_iter);
+ if (p_iter.row() % 2 + p_iter.col() % 2 == 1)
+ std::cout << " OK";
+ std::cout << std::endl;
+ }*/
+
// Display.
- io::pgm::save(level::stretch(int_u8(), world::inter_pixel::display_edge(edges, 0.0, 3)), "edges.pgm");
+ image2d<float> display_ima = world::inter_pixel::display_edge(edges, 0.0, 3);
+ //std::cout << "display_ima box: " << display_ima.bbox() << std::endl;
+ io::pgm::save(level::stretch(int_u8(), display_ima), "edges.pgm");
return 0;
}
Index: trunk/milena/sandbox/fabien/igr/Makefile.rules
===================================================================
--- trunk/milena/sandbox/fabien/igr/Makefile.rules (revision 3735)
+++ trunk/milena/sandbox/fabien/igr/Makefile.rules (revision 3736)
@@ -1,5 +1,5 @@
-CXX = llvm-g++
-CXXFLAGS = -Wall -Wextra -DNDEBUG -O4
+CXX = g++
+CXXFLAGS = -Wall -Wextra -DNDEBUG -O3
DICOM_INC = -I/usr/local/include/gdcm-2.0
DICOM_LIBS = -lgdcmCommon -lgdcmDICT -lgdcmDSED -lgdcmIOD -lgdcmMSFF -lgdcmexpat -lgdcmjpeg12 -lgdcmjpeg16 -lgdcmjpeg8 -lgdcmopenjpeg -lgdcmuuid -lgdcmzlib \
1
0

30 Apr '09
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix missing definitions and bugs in algebra vec and mat.
* mln/literal/identity.hh: New.
* mln/accu/stat/variance.hh: Copy to...
* mln/accu/stat/var.hh: ...this new file.
Update to compute the variance matrix.
* mln/value/ops.hh: Layout.
* mln/algebra/mat.hh (mat): New overloaded ctor for identity.
(_1, set_id_): New methods.
(make): New couple of procedures.
(trait): Fix missing definitions.
(set_precise_binary_): Duplicate explicitly for op::times
and op::div.
(operator==): Fix missing const in signature.
(tr): Fix return type.
Use literal instead of 0.
(det): New procedures.
(internal::inverse): New.
* mln/algebra/vec.hh (trait): Fix missing definitions.
(set_precise_binary_): Duplicate explicitly for op::times
and op::div.
(operator-): New unary operator.
* tests/algebra/mat.cc: Copy to...
* tests/algebra/h_mat.cc: ...this new file.
* tests/algebra/mat.cc: Revamp so that there is no h_mat.
* tests/algebra/Makefile.am: Update.
mln/accu/stat/var.hh | 192 ++++++++++++---------------
mln/algebra/mat.hh | 320 ++++++++++++++++++++++++++++++++++++++--------
mln/algebra/vec.hh | 115 +++++++++++++---
mln/literal/identity.hh | 63 +++++++++
mln/value/ops.hh | 6
tests/algebra/Makefile.am | 2
tests/algebra/h_mat.cc | 17 +-
tests/algebra/mat.cc | 49 +++----
8 files changed, 553 insertions(+), 211 deletions(-)
Index: mln/literal/identity.hh
--- mln/literal/identity.hh (revision 0)
+++ mln/literal/identity.hh (revision 0)
@@ -0,0 +1,63 @@
+// Copyright (C) 2009 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.
+
+#ifndef MLN_LITERAL_IDENTITY_HH
+# define MLN_LITERAL_IDENTITY_HH
+
+/// \file mln/literal/identity.hh
+///
+/// Definition of the literal of mln::identity.
+
+# include <mln/core/concept/literal.hh>
+
+
+namespace mln
+{
+
+ namespace literal
+ {
+
+ /// Type of literal identity.
+ struct identity_t : public Literal<identity_t>
+ {
+ };
+
+ /// Literal identity.
+ extern const identity_t& identity;
+
+# ifndef MLN_INCLUDE_ONLY
+
+ const identity_t& identity = identity_t();
+
+# endif
+
+ } // end of namespace mln::literal
+
+} // end of namespace mln
+
+
+#endif // ! MLN_LITERAL_IDENTITY_HH
Index: mln/accu/stat/var.hh
--- mln/accu/stat/var.hh (revision 3733)
+++ mln/accu/stat/var.hh (working copy)
@@ -25,18 +25,21 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_ACCU_STAT_VARIANCE_HH
-# define MLN_ACCU_STAT_VARIANCE_HH
+#ifndef MLN_ACCU_STAT_VAR_HH
+# define MLN_ACCU_STAT_VAR_HH
-/// \file mln/accu/stat/variance.hh
+/// \file mln/accu/stat/var.hh
///
-/// Define an accumulator that computes the variance of a set of values.
+/// Define an accumulator that computes the variance matrix of a set
+/// of vectors.
# include <cmath>
# include <mln/accu/internal/base.hh>
+# include <mln/algebra/vec.hh>
+# include <mln/algebra/mat.hh>
+# include <mln/fun/i2v/all_to.hh>
# include <mln/util/pix.hh>
-
namespace mln
{
@@ -46,189 +49,164 @@
namespace stat
{
- /// \brief Variance accumulator class.
- /*!
- * Parameter \c T is the type of values that we sum. Parameter
- * \c S is the type to store the value sum and the sum of value
- * * value; the default type of \c S is the summation type
- * (property) of \c T. Parameter \c R is the type of the mean
- * and variance values; the default type of \c R is \c S.
- *
- * \ingroup modaccuvalues
- *
- */
- template <typename T,
- typename S = mln_sum(T),
- typename R = S>
- struct variance : public mln::accu::internal::base< R , variance<T,S,R> >
+ /// \brief Var accumulator class.
+ ///
+ /// Parameter \c T is the type of vectors
+ ///
+ /// \ingroup modaccuvalues
+ //
+ template <typename T>
+ struct var : public mln::accu::internal::base< algebra::mat< T::dim, T::dim, float >,
+ var<T> >
{
+ enum { dim = T::dim };
typedef T argument;
- typedef R result;
+ typedef algebra::mat<dim,dim,float> result;
- variance();
+ var();
/// Manipulators.
/// \{
void init();
- void take_as_init(const argument& t);
- void take(const argument& t);
- void take(const variance<T,S,R>& other);
+ void take(const argument& v);
+ void take(const var<T>& other);
- void take(unsigned n_times, const argument& t); // Extra.
+ void take_as_init_(const argument& v);
+ void take_n_times_(unsigned n_times, const argument& v);
/// \}
- /// Get the accumulator result (the variance value).
- R to_result() const;
-
- /// Get the variance value.
- R var() const;
+ /// Get the accumulator result (the var value).
+ result to_result() const;
- /// Get the standard deviation value.
- R standard_deviation() const;
-
- /// Get the mean value.
- R mean() const;
-
- /// Get the sum value.
- S sum() const;
+ /// Get the variance matrix.
+ result variance() const;
/// Get the number of items.
unsigned n_items() const;
- /// Check whether this accu is able to return a result.
- /// Always true here.
+ /// Get the mean vector.
+ algebra::vec<dim,float> mean() const;
+
+ /// Check whether this accu returns a valid result.
bool is_valid() const;
protected:
unsigned n_;
- S sum_, sum2_;
+ algebra::vec<dim,float> sum_;
+ algebra::mat<dim,dim,float> cov_;
};
- template <typename I, typename S, typename R>
- struct variance< util::pix<I>, S,R >;
-
-
-
# ifndef MLN_INCLUDE_ONLY
- template <typename T, typename S, typename R>
+ template <typename T>
inline
- variance<T,S,R>::variance()
+ var<T>::var()
{
init();
}
- template <typename T, typename S, typename R>
+ template <typename T>
inline
void
- variance<T,S,R>::init()
+ var<T>::init()
{
n_ = 0;
- sum_ = sum2_ = 0;
+ sum_.set_all(0);
+ cov_ .set_all(0);
}
- template <typename T, typename S, typename R>
+ template <typename T>
inline
void
- variance<T,S,R>::take(const argument& t)
+ var<T>::take(const argument& v)
{
++n_;
- sum_ += t;
- sum2_ += t * t;
+ sum_ += v;
+ cov_ += v * v.t();
}
- template <typename T, typename S, typename R>
+ template <typename T>
inline
void
- variance<T,S,R>::take(unsigned n_times, const argument& t)
+ var<T>::take(const var<T>& other)
{
- if (n_times == 0u)
- return;
- n_ += n_times;
- sum_ += n_times * t;
- sum2_ += n_times * t * t;
+ n_ += other.n_;
+ cov_ += other.cov_;
}
- template <typename T, typename S, typename R>
+ template <typename T>
inline
void
- variance<T,S,R>::take_as_init(const argument& t)
+ var<T>::take_as_init_(const argument& v)
{
n_ = 1;
- sum_ = t;
- sum2_ = t * t;
+ sum_ = v;
+ cov_ = v * v.t();
}
- template <typename T, typename S, typename R>
+ template <typename T>
inline
void
- variance<T,S,R>::take(const variance<T,S,R>& other)
+ var<T>::take_n_times_(unsigned n_times, const argument& v)
{
- n_ += other.n_;
- sum_ += other.sum_;
- sum2_ += other.sum2_;
+ n_ += n_times;
+ sum_ += n_times * v;
+ cov_ += n_times * v * v.t();
}
- template <typename T, typename S, typename R>
- inline
- R
- variance<T,S,R>::to_result() const
- {
- if (n_ == 0u)
- return 0; // Safety.
- S m_ = sum_ / n_;
- return sum2_ / n_ - m_ * m_;
- }
- template <typename T, typename S, typename R>
+ template <typename T>
inline
- R
- variance<T,S,R>::mean() const
+ mln_result(var<T>)
+ var<T>::to_result() const
{
+ static result null_(fun::i2v::all_to(0));
+
if (n_ == 0u)
- return 0; // Safety.
- return sum_ / n_;
+ return null_; // Safety.
+
+ return (cov_ - sum_ * sum_.t() / n_) / n_;
+ // Shorter than:
+ // mean_ = sum_ / n_
+ // var_ = cov_ / n_ - mean_ * mean_.t()
}
- template <typename T, typename S, typename R>
+ template <typename T>
inline
- S
- variance<T,S,R>::sum() const
+ mln_result(var<T>)
+ var<T>::variance() const
{
- return sum_;
+ return to_result();
}
- template <typename T, typename S, typename R>
+ template <typename T>
inline
unsigned
- variance<T,S,R>::n_items() const
+ var<T>::n_items() const
{
return n_;
}
- template <typename T, typename S, typename R>
+ template <typename T>
inline
- R
- variance<T,S,R>::var() const
+ algebra::vec<dim,float>
+ var<T>::mean() const
{
- return to_result();
- }
+ static algebra::vec<dim,float> null_(fun::i2v::all_to(0));
- template <typename T, typename S, typename R>
- inline
- R
- variance<T,S,R>::standard_deviation() const
- {
- return std::sqrt(to_result());
+ if (n_ == 0u)
+ return null_; // Safety.
+
+ return sum_ / n_;
}
- template <typename T, typename S, typename R>
+ template <typename T>
inline
bool
- variance<T,S,R>::is_valid() const
+ var<T>::is_valid() const
{
return n_ != 0;
}
@@ -242,4 +220,4 @@
} // end of namespace mln
-#endif // ! MLN_ACCU_STAT_VARIANCE_HH
+#endif // ! MLN_ACCU_STAT_VAR_HH
Index: mln/value/ops.hh
--- mln/value/ops.hh (revision 3734)
+++ mln/value/ops.hh (working copy)
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -43,10 +43,12 @@
# include <mln/literal/ops.hh>
# include <mln/metal/ret.hh>
+
/// Type trait for value sum.
# define mln_trait_value_sum_product(T, U) \
typename mln::trait::value_< mln_trait_op_times(T,U) >::sum
+
/// Shortcut for type trait for value sum.
# define mln_sum_product(T, U) mln_trait_value_sum_product(T, U)
Index: mln/algebra/mat.hh
--- mln/algebra/mat.hh (revision 3734)
+++ mln/algebra/mat.hh (working copy)
@@ -1,5 +1,5 @@
-// Copyright (C) 2006, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2006, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -41,6 +41,7 @@
# include <mln/trait/all.hh>
# include <mln/trait/value_.hh>
# include <mln/algebra/vec.hh>
+# include <mln/literal/identity.hh>
// FIXME: Document.
@@ -51,7 +52,7 @@
{
- // Fwd decl.
+ // Forward declaration.
namespace algebra {
template <unsigned n, unsigned m, typename T> class mat;
}
@@ -98,6 +99,8 @@
mat();
mat(const literal::zero_t&);
+ mat(const literal::one_t&);
+ mat(const literal::identity_t&);
template <typename U>
mat(const mat<n,m,U>& rhs);
@@ -122,76 +125,138 @@
/// Return the transpose of the matrix.
mat<m,n,T> t() const;
+ /// Return the inverse of the matrix.
+ /// Only compile on square matrix.
+ mat<n,m,T> _1() const;
+
private:
+
T data_[n][m];
+
+ void set_id_();
};
- }
+
+ template <typename T>
+ mat<2,2,T>
+ make(const T& t00, const T& t01,
+ const T& t10, const T& t11);
+
+ template <typename T>
+ mat<3,3,T>
+ make(const T& t00, const T& t01, const T& t02,
+ const T& t10, const T& t11, const T& t12,
+ const T& t20, const T& t21, const T& t22);
+
+
+ } // end of namespace algebra
+
namespace trait
{
- // Unarys.
+ // - mat
- template < template<class> class Name,
- unsigned n, unsigned m, typename T >
- struct set_precise_unary_< Name, algebra::mat<n,m,T> >
+ template < unsigned n, unsigned m, typename T >
+ struct set_precise_unary_< op::uminus,
+ algebra::mat<n,m,T> >
+ {
+ typedef algebra::mat<n, m, mln_trait_op_uminus(T)> ret;
+ };
+
+ // mat + mat
+
+ template < unsigned n, unsigned m, typename T, typename U >
+ struct set_precise_binary_< op::plus,
+ algebra::mat<n,m,T>, algebra::mat<n,m,U> >
{
- typedef algebra::mat<n, m, mln_trait_unary(Name, T)> ret;
+ typedef algebra::mat<n, m, mln_trait_op_plus(T, U)> ret;
};
- // Default for binarys; works for (+), (-), comparisons, and promote.
+ // mat - mat
- template < template<class, class> class Name,
- unsigned n, unsigned m, typename T, typename U>
- struct set_precise_binary_< Name, algebra::mat<n,m,T>, algebra::mat<n,m,U> >
+ template < unsigned n, unsigned m, typename T, typename U >
+ struct set_precise_binary_< op::minus,
+ algebra::mat<n,m,T>, algebra::mat<n,m,U> >
{
- typedef algebra::mat<n, m, mln_trait_binary(Name, T, U)> ret;
+ typedef algebra::mat<n, m, mln_trait_op_minus(T, U)> ret;
};
// mat * mat
template < unsigned n, unsigned o, typename T,
unsigned m, typename U >
- struct set_precise_binary_< op::times, algebra::mat<n,o,T>, algebra::mat<o,m,U> >
+ struct set_precise_binary_< op::times,
+ algebra::mat<n,o,T>, algebra::mat<o,m,U> >
{
typedef algebra::mat<n, m, mln_sum_product(T, U)> ret;
};
- template < unsigned n, typename T, typename U >
- struct set_precise_binary_< op::times, algebra::mat<n,n,T>, algebra::mat<n,n,U> >
- { // Disambiguate between both previous defs.
- typedef algebra::mat<n, n, mln_sum_product(T, U)> ret;
+ template < unsigned o, typename T,
+ typename U >
+ struct set_precise_binary_< op::times,
+ algebra::mat<1,o,T>, algebra::mat<o,1,U> >
+ {
+ typedef mln_sum_product(T, U) ret;
};
// mat * vec
template < unsigned n, unsigned m, typename T,
typename U >
- struct set_precise_binary_< op::times, algebra::mat<n,m,T>, algebra::vec<m,U> >
+ struct set_precise_binary_< op::times,
+ algebra::mat<n,m,T>, algebra::vec<m,U> >
{
typedef algebra::vec<n, mln_sum_product(T, U)> ret;
};
+ template < unsigned m, typename T,
+ typename U >
+ struct set_precise_binary_< op::times,
+ algebra::mat<1,m,T>, algebra::vec<m,U> >
+ {
+ typedef mln_sum_product(T, U) ret; // a scalar
+ };
+
+ // vec * mat
+
+ template < unsigned m, typename T,
+ typename U >
+ struct set_precise_binary_< op::times,
+ algebra::vec<m,T>, algebra::mat<1,m,U> >
+ {
+ typedef algebra::mat<m, m, mln_trait_op_times(T, U)> ret;
+ };
+
// mat * s
- template < template<class, class> class Name,
- unsigned n, unsigned m, typename T,
+ template < unsigned n, unsigned m, typename T,
typename S >
- struct set_precise_binary_< Name, algebra::mat<n,m,T>, mln::value::scalar_<S> >
+ struct set_precise_binary_< op::times,
+ algebra::mat<n,m,T>, mln::value::scalar_<S> >
{
- typedef algebra::mat<n, m, mln_trait_binary(Name, T, S)> ret;
+ typedef algebra::mat<n, m, mln_trait_op_times(T, S)> ret;
};
- template < template<class, class> class Name,
- unsigned n, unsigned m, typename T,
+// template < template<class, class> class Name,
+// unsigned n, unsigned m, typename T,
+// typename S >
+// struct set_binary_< Name,
+// mln::Object, algebra::mat<n,m,T>,
+// mln::value::Scalar, S >
+// {
+// typedef algebra::mat<n, m, mln_trait_binary(Name, T, S)> ret;
+// };
+
+ // mat / s
+
+ template < unsigned n, unsigned m, typename T,
typename S >
- struct set_binary_< Name,
- mln::Object, algebra::mat<n,m,T>,
- mln::value::Scalar, S >
+ struct set_precise_binary_< op::div,
+ algebra::mat<n,m,T>, mln::value::scalar_<S> >
{
- typedef algebra::mat<n, m, mln_trait_binary(Name, T, S)> ret;
+ typedef algebra::mat<n, m, mln_trait_op_div(T, S)> ret;
};
} // end of namespace mln::trait
@@ -205,27 +270,26 @@
template <unsigned n, unsigned m, typename T, typename U>
bool
- operator==(mat<n,m,T>& lhs, const mat<n,m,U>& rhs);
+ operator==(const mat<n,m,T>& lhs, const mat<n,m,U>& rhs);
- // +
+ // - mat
+
+ template <unsigned n, unsigned m, typename T>
+ mat<n, m, mln_trait_op_uminus(T)>
+ operator-(const mat<n,m,T>& lhs);
+
+ // mat + mat
template <unsigned n, unsigned m, typename T, typename U>
- inline
mat<n, m, mln_trait_op_plus(T,U)>
operator+(const mat<n,m,T>& lhs, const mat<n,m,U>& rhs);
- // -
+ // mat - mat
template <unsigned n, unsigned m, typename T, typename U>
mat<n, m, mln_trait_op_minus(T,U)>
operator-(const mat<n,m,T>& lhs, const mat<n,m,U>& rhs);
- // - (unary)
-
- template <unsigned n, unsigned m, typename T>
- mat<n, m, mln_trait_op_uminus(T)>
- operator-(const mat<n,m,T>& lhs);
-
// mat * mat
template <unsigned n, unsigned o, typename T,
@@ -276,10 +340,23 @@
operator<<(std::ostream& ostr, const mat<n,m,T>& v);
- // trace
- template<unsigned n, typename T> inline
- float tr(const mat<n,n,T>& m);
+ // Trace.
+
+ template<unsigned n, typename T>
+ mln_sum(T)
+ tr(const mat<n,n,T>& m);
+
+
+ // Determinant.
+
+ template<typename T>
+ mln_sum_product(T,T)
+ det(const mat<2,2,T>& m);
+
+ template<typename T>
+ mln_sum_product(T,T)
+ det(const mat<3,3,T>& m);
@@ -364,6 +441,33 @@
}
template <unsigned n, unsigned m, typename T>
+ inline
+ void
+ mat<n,m,T>::set_id_()
+ {
+ for (unsigned i = 0; i < n; ++i)
+ for (unsigned j = 0; j < m; ++j)
+ if (i == j)
+ data_[i][j] = literal::one;
+ else
+ data_[i][j] = literal::zero;
+ }
+
+ template <unsigned n, unsigned m, typename T>
+ inline
+ mat<n,m,T>::mat(const literal::one_t&)
+ {
+ this->set_id_();
+ }
+
+ template <unsigned n, unsigned m, typename T>
+ inline
+ mat<n,m,T>::mat(const literal::identity_t&)
+ {
+ this->set_id_();
+ }
+
+ template <unsigned n, unsigned m, typename T>
template <typename U>
inline
mat<n,m,T>::mat(const mat<n,m,U>& rhs)
@@ -443,9 +547,100 @@
return tmp;
}
+ namespace internal
+ {
- // Operators.
+ template <typename T>
+ inline
+ mat<2,2,T>
+ inverse(const mat<2,2,T>& m)
+ {
+ T d = det(m);
+ mln_precondition(d != 0);
+ return make<T>( + m(1,1) / d, - m(0,1) / d,
+ - m(1,0) / d, + m(0,0) / d );
+ }
+ template <typename T>
+ inline
+ mat<3,3,T>
+ inverse(const mat<3,3,T>& m)
+ {
+ T d = det(m);
+ mln_precondition(d != 0);
+ return make<T>( det(make(m(1,1), m(1,2),
+ m(2,1), m(2,2))),
+
+ det(make(m(0,2), m(0,1),
+ m(2,2), m(2,1))),
+
+ det(make(m(0,1), m(0,2),
+ m(1,1), m(1,2))),
+
+
+ det(make(m(1,2), m(1,0),
+ m(2,2), m(2,0))),
+
+ det(make(m(0,0), m(0,2),
+ m(2,0), m(2,2))),
+
+ det(make(m(0,2), m(0,0),
+ m(1,2), m(1,0))),
+
+ det(make(m(1,0), m(1,1),
+ m(2,0), m(2,1))),
+
+ det(make(m(0,1), m(0,0),
+ m(2,1), m(2,0))),
+
+ det(make(m(0,0), m(0,1),
+ m(1,0), m(1,1)))
+ ) / d;
+ }
+
+ } // end of namespace algebra::inverse
+
+ template <unsigned n, unsigned m, typename T>
+ inline
+ mat<n,m,T>
+ mat<n,m,T>::_1() const
+ {
+ mlc_bool(m == n)::check();
+ return internal::inverse(*this);
+ }
+
+
+ // "Make" routines.
+
+ template <typename T>
+ inline
+ mat<2,2,T>
+ make(const T& t00, const T& t01,
+ const T& t10, const T& t11)
+ {
+ mat<2,2,T> tmp;
+ tmp(0, 0) = t00; tmp(0, 1) = t01;
+ tmp(1, 0) = t10; tmp(1, 1) = t11;
+ return tmp;
+ }
+
+ template <typename T>
+ inline
+ mat<3,3,T>
+ make(const T& t00, const T& t01, const T& t02,
+ const T& t10, const T& t11, const T& t12,
+ const T& t20, const T& t21, const T& t22)
+ {
+ mat<3,3,T> tmp;
+ tmp(0, 0) = t00; tmp(0, 1) = t01; tmp(0, 2) = t02;
+ tmp(1, 0) = t10; tmp(1, 1) = t11; tmp(1, 2) = t12;
+ tmp(2, 0) = t20; tmp(2, 1) = t21; tmp(2, 2) = t22;
+ return tmp;
+ }
+
+
+
+ // Operators.
template <unsigned n, unsigned m, typename T, typename U>
inline
@@ -620,13 +815,40 @@
// Trace.
- template<unsigned n, typename T> inline
- float tr(const mat<n,n,T>& m)
+ template<unsigned n, typename T>
+ inline
+ mln_sum(T)
+ tr(const mat<n,n,T>& m)
{
- float f = 0.f;
+ mln_sum(T) tr_ = literal::zero;
for (unsigned i = 0; i < n; ++i)
- f += m(i,i);
- return f;
+ tr_ += m(i,i);
+ return tr_;
+ }
+
+
+ // Determinant.
+
+ template<typename T>
+ inline
+ mln_sum_product(T,T)
+ det(const mat<2,2,T>& m)
+ {
+ return m(0,0) * m(1,1) - m(0,1) * m(1,0);
+ }
+
+ template<typename T>
+ inline
+ mln_sum_product(T,T)
+ det(const mat<3,3,T>& m)
+ {
+ return
+ + m(0,0) * m(1,1) * m(2,2)
+ - m(0,0) * m(1,2) * m(2,1)
+ - m(0,1) * m(1,0) * m(2,2)
+ + m(0,1) * m(1,2) * m(2,0)
+ + m(0,2) * m(1,0) * m(2,1)
+ - m(0,2) * m(1,1) * m(2,0);
}
Index: mln/algebra/vec.hh
--- mln/algebra/vec.hh (revision 3734)
+++ mln/algebra/vec.hh (working copy)
@@ -266,11 +266,13 @@
} // end of namespace mln::algebra
+
namespace trait
{
// For unary traits.
+
template < template <class> class Name,
unsigned n, typename T >
struct set_precise_unary_< Name, algebra::vec<n, T> >
@@ -279,18 +281,44 @@
typedef algebra::vec<n, V> ret;
};
+
// For binary traits.
- template < template <class, class> class Name,
- unsigned n, typename T,
+
+ // vec + vec
+
+ template < unsigned n, typename T,
+ typename U >
+ struct set_precise_binary_< op::plus,
+ algebra::vec<n, T>, algebra::vec<n, U> >
+ {
+ typedef mln_trait_op_plus(T, U) V;
+ typedef algebra::vec<n, V> ret;
+ };
+
+ // - vec
+
+ template < unsigned n, typename T >
+ struct set_precise_unary_< op::uminus,
+ algebra::vec<n, T> >
+ {
+ typedef mln_trait_op_uminus(T) V;
+ typedef algebra::vec<n, V> ret;
+ };
+
+ // vec - vec
+
+ template < unsigned n, typename T,
typename U >
- struct set_precise_binary_< Name,
+ struct set_precise_binary_< op::minus,
algebra::vec<n, T>, algebra::vec<n, U> >
{
- typedef mln_trait_binary(Name, T, U) V;
+ typedef mln_trait_op_minus(T, U) V;
typedef algebra::vec<n, V> ret;
};
+ // vec * vec
+
template < unsigned n, typename T,
typename U >
struct set_precise_binary_< op::times,
@@ -299,27 +327,39 @@
typedef mln_sum_product(T,U) ret;
};
- template < template <class, class> class Name,
- unsigned n, typename T,
+ // vec * s
+
+ template < unsigned n, typename T,
typename S >
- struct set_precise_binary_< Name,
+ struct set_precise_binary_< op::times,
algebra::vec<n, T>, mln::value::scalar_<S> >
{
- typedef mln_trait_binary(Name, T, S) V;
+ typedef mln_trait_op_times(T, S) V;
typedef algebra::vec<n, V> ret;
};
- template < template<class, class> class Name,
- unsigned n, typename T,
+ // vec / s
+
+ template < unsigned n, typename T,
typename S >
- struct set_binary_< Name,
- mln::Object, algebra::vec<n, T>,
- mln::value::Scalar, S >
+ struct set_precise_binary_< op::div,
+ algebra::vec<n, T>, mln::value::scalar_<S> >
{
- typedef mln_trait_binary(Name, T, S) V;
+ typedef mln_trait_op_div(T, S) V;
typedef algebra::vec<n, V> ret;
};
+// template < template<class, class> class Name,
+// unsigned n, typename T,
+// typename S >
+// struct set_binary_< Name,
+// mln::Object, algebra::vec<n, T>,
+// mln::value::Scalar, S >
+// {
+// typedef mln_trait_binary(Name, T, S) V;
+// typedef algebra::vec<n, V> ret;
+// };
+
} // end of namespace mln::trait
@@ -327,18 +367,25 @@
namespace algebra
{
- // eq
+ // vec == vec
template <unsigned n, typename T, typename U>
- bool operator==(const vec<n,T>& lhs, const vec<n,U>& rhs);
+ bool
+ operator==(const vec<n,T>& lhs, const vec<n,U>& rhs);
- // +
+ // vec + vec
template <unsigned n, typename T, typename U>
vec<n, mln_trait_op_plus(T,U)>
operator+(const vec<n,T>& lhs, const vec<n,U>& rhs);
- // -
+ // - vec
+
+ template <unsigned n, typename T>
+ vec<n, mln_trait_op_uminus(T)>
+ operator-(const vec<n,T>& rhs);
+
+ // vec - vec
template <unsigned n, typename T, typename U>
vec<n, mln_trait_op_minus(T,U)>
@@ -522,9 +569,12 @@
const vec<n, T> vec<n, T>::origin = all_to(0);
+
// Operators.
+ // vec == vec
+
template <unsigned n, typename T, typename U>
inline
bool operator==(const vec<n,T>& lhs, const vec<n,U>& rhs)
@@ -535,6 +585,7 @@
return true;
}
+ // vec + vec
template <unsigned n, typename T, typename U>
inline
@@ -548,6 +599,22 @@
return tmp;
}
+ // - vec
+
+ template <unsigned n, typename T>
+ inline
+ vec<n, mln_trait_op_uminus(T)>
+ operator-(const vec<n,T>& rhs)
+ {
+ typedef mln_trait_op_uminus(T) R;
+ vec<n, R> tmp;
+ for (unsigned i = 0; i < n; ++i)
+ tmp[i] = - rhs[i];
+ return tmp;
+ }
+
+ // vec - vec
+
template <unsigned n, typename T, typename U>
inline
vec<n, mln_trait_op_minus(T,U)>
@@ -560,6 +627,8 @@
return tmp;
}
+ // vec * vec
+
template <unsigned n, typename T, typename U>
inline
mln_sum_product(T,U)
@@ -572,6 +641,8 @@
return tmp;
}
+ // vec * s
+
template <unsigned n, typename T, typename S>
inline
vec<n, mln_trait_op_times(T, S)>
@@ -594,6 +665,8 @@
return tmp;
}
+ // vec / s
+
template <unsigned n, typename T, typename S>
inline
vec<n, mln_trait_op_div(T, S)>
@@ -608,6 +681,8 @@
}
+ // << v
+
template <unsigned n, typename T>
inline
std::ostream&
@@ -619,6 +694,9 @@
return ostr;
}
+
+ // >> v
+
template <unsigned n, typename T>
inline
std::istream&
@@ -629,6 +707,7 @@
return istr;
}
+
// vprod
template <typename T, typename U>
Index: tests/algebra/mat.cc
--- tests/algebra/mat.cc (revision 3734)
+++ tests/algebra/mat.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,16 +26,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/algebra/mat.cc
- *
- * \brief Tests on mln::algebra::mat.
- */
+/// \file tests/algebra/mat.cc
+///
+/// Tests on mln::algebra::mat.
-
-#include <iostream>
#include <mln/fun/i2v/all_to.hh>
#include <mln/algebra/mat.hh>
-#include <mln/algebra/h_mat.hh>
@@ -42,26 +39,26 @@
{
using namespace mln;
- algebra::mat<1,3,float> m1(all_to(4.));
- algebra::mat<2,2,float> m2 = algebra::mat<2,2,float>::Id;
-
- algebra::h_mat<1,float> hm1(m2);
- algebra::h_mat<2,float> hm2;
- algebra::h_mat<3,float> hm3(all_to(1.5));
-
- algebra::mat<4,4,float> m4 = hm3;
-
- std::cout << "m1 = " << m1 << ";" << std::endl;
- std::cout << "m2 = " << m2 << ";" << std::endl;
- std::cout << "m4 = " << m4 << ";" << std::endl;
- std::cout << "hm1 = " << hm1 << ";" << std::endl;
- std::cout << "hm2 = " << hm2 << ";" << std::endl;
- std::cout << "hm3 = " << hm3 << ";" << std::endl;
+ {
+ using namespace algebra;
+ mat<3,3,int>
+ m = algebra::make(1, 2, 3,
+ 0, 1, 4,
+ 5, 6, 0),
+ m_1 = algebra::make(-24, +18, +05,
+ +20, -15, -04,
+ -05, +04, +01);
+ mln_assertion(m._1() == m_1);
+ mln_assertion(m * m._1() == literal::identity);
+ }
{
- algebra::h_mat<2,float> m, m2;
- m = m2;
- // FIXME: Test *many* => runs ok...
+ using namespace algebra;
+ mat<2,2,int> m = algebra::make(1, 0,
+ 0, 1);
+ mln_assertion(tr(m) == 2);
+ mln_assertion(det(m) == 1);
+ mln_assertion(m._1() == m);
}
}
Index: tests/algebra/Makefile.am
--- tests/algebra/Makefile.am (revision 3734)
+++ tests/algebra/Makefile.am (working copy)
@@ -3,6 +3,7 @@
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
+ h_mat \
h_vec \
mat \
mat2 \
@@ -10,6 +11,7 @@
vec \
vec2
+h_mat_SOURCES = h_mat.cc
h_vec_SOURCES = h_vec.cc
mat_SOURCES = mat.cc
mat2_SOURCES = mat2.cc
Index: tests/algebra/h_mat.cc
--- tests/algebra/h_mat.cc (revision 3733)
+++ tests/algebra/h_mat.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,13 +26,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/algebra/mat.cc
- *
- * \brief Tests on mln::algebra::mat.
- */
+/// \file tests/algebra/h_mat.cc
+///
+/// Tests on mln::algebra::h_mat.
-
-#include <iostream>
#include <mln/fun/i2v/all_to.hh>
#include <mln/algebra/mat.hh>
#include <mln/algebra/h_mat.hh>
@@ -42,8 +40,9 @@
{
using namespace mln;
- algebra::mat<1,3,float> m1(all_to(4.));
- algebra::mat<2,2,float> m2 = algebra::mat<2,2,float>::Id;
+ algebra::mat<1,3,float> m1;
+ m1.set_all(4);
+ algebra::mat<2,2,float> m2 = literal::identity;
algebra::h_mat<1,float> hm1(m2);
algebra::h_mat<2,float> hm2;
Property changes on: tests/algebra/h_mat.cc
___________________________________________________________________
Added: svn:mergeinfo
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Remove a bug file.
* bugs/algebra_vec_ne_op.cc: Remove. Bug fixed.
algebra_vec_ne_op.cc | 19 -------------------
1 file changed, 19 deletions(-)
Index: bugs/algebra_vec_ne_op.cc
--- bugs/algebra_vec_ne_op.cc (revision 3733)
+++ bugs/algebra_vec_ne_op.cc (working copy)
@@ -1,19 +0,0 @@
-/// Do not compile
-
-
-# include <mln/algebra/vec.hh>
-int main()
-{
- using namespace mln::algebra;
- vec<3, float> a, b;
-
- // Do NOT work
- bool c = (a != b);
-
- // Work
- c = !(a == b);
-
- // Work
- c = (a == b);
-}
-
1
0

milena r3733: Modification to parametrized functions, functions tutorial WIP
by Frederic Bour 29 Apr '09
by Frederic Bour 29 Apr '09
29 Apr '09
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-04-29 Frederic Bour <bour(a)lrde.epita.fr>
Modification to parametrized functions, functions tutorial WIP.
* mln/fun/binary.hh,
* mln/fun/unary.hh: Modified parameters system. Now distinguish
Exact type from Flag type.
* mln/fun/binary_param.hh: New.
* mln/fun/from_accu.hh: Updated to latest functions syntax.
* mln/fun/unary.hh: Modified parameters system.
* mln/fun/unary_param.hh: New.
* sandbox/fred/functions.html,
* sandbox/fred/functions.mkdown: New. Tutorial
* sandbox/fred/tests/Makefile: Added one test.
* sandbox/fred/tests/wip.cc: New.
---
mln/fun/binary.hh | 4
mln/fun/binary_param.hh | 99 ++++++++
mln/fun/from_accu.hh | 36 ---
mln/fun/unary.hh | 4
mln/fun/unary_param.hh | 97 ++++++++
sandbox/fred/functions.html | 478 ++++++++++++++++++++++++++++++++++++++++++
sandbox/fred/functions.mkdown | 441 ++++++++++++++++++++++++++++++++++++++
sandbox/fred/tests/Makefile | 2
sandbox/fred/tests/wip.cc | 25 ++
9 files changed, 1155 insertions(+), 31 deletions(-)
Index: trunk/milena/mln/fun/unary.hh
===================================================================
--- trunk/milena/mln/fun/unary.hh (revision 3732)
+++ trunk/milena/mln/fun/unary.hh (revision 3733)
@@ -49,8 +49,8 @@
}
- template <typename F>
- struct unary: mln::Meta_Function_v2v< F >
+ template <typename F, typename E = F>
+ struct unary: mln::Meta_Function_v2v< E >
{
typedef F flag;
typedef mln_trait_fun_param(flag) param;
Index: trunk/milena/mln/fun/unary_param.hh
===================================================================
--- trunk/milena/mln/fun/unary_param.hh (revision 0)
+++ trunk/milena/mln/fun/unary_param.hh (revision 3733)
@@ -0,0 +1,97 @@
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// 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 F 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.
+#include "unary.hh"
+
+#ifndef MLN_FUN_UNARY_PARAM_HH
+# define MLN_FUN_UNARY_PARAM_HH
+
+# include <mln/fun/unary.hh>
+# include <mln/fun/param.hh>
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ template <typename F, typename Param, typename Storage = void, typename E = F>
+ struct unary_param: unary< unary_param<F,Param,Storage,E>, E>
+ {
+ unary_param()
+ {
+ }
+
+ template <typename U>
+ unary_param(const U& param)
+ {
+ this->init(param);
+ }
+
+ };
+
+ template <typename F, typename Param, typename E>
+ struct parameter< unary_param<F,Param,void,E> >
+ {
+ typedef Param param;
+ typedef void storage;
+ };
+
+ template <typename F, typename Param, typename Storage, typename E>
+ struct parameter< unary_param<F,Param,Storage,E> >
+ {
+ typedef Param param;
+ typedef Storage storage;
+
+ template <typename U>
+ storage compute(const U& u)
+ {
+ return F::compute_param(u);
+ }
+ };
+
+ }
+
+ namespace trait
+ {
+
+ namespace next
+ {
+
+ template <typename F, typename Param, typename Storage, typename E, typename T>
+ struct set_precise_unary_<mln::fun::unary_param<F,Param,Storage,E>, T>
+ {
+ typedef mln_trait_nunary(F, T) ret;
+ };
+
+ } // end of namespace mln::trait::next
+
+ } // end of namespace mln::trait
+
+
+} // end of namespace mln
+
+#endif /* ! MLN_FUN_UNARY_PARAM_HH */
Index: trunk/milena/mln/fun/binary.hh
===================================================================
--- trunk/milena/mln/fun/binary.hh (revision 3732)
+++ trunk/milena/mln/fun/binary.hh (revision 3733)
@@ -39,8 +39,8 @@
namespace fun
{
- template <typename F>
- struct binary : mln::Meta_Function_vv2v< binary<F> >
+ template <typename F, typename E = F>
+ struct binary : mln::Meta_Function_vv2v< E >
{
typedef F flag;
typedef mln_trait_fun_storage(flag) storage;
Index: trunk/milena/mln/fun/from_accu.hh
===================================================================
--- trunk/milena/mln/fun/from_accu.hh (revision 3732)
+++ trunk/milena/mln/fun/from_accu.hh (revision 3733)
@@ -28,10 +28,8 @@
#ifndef MLN_FUN_FROM_ACCU_HH
# define MLN_FUN_FROM_ACCU_HH
-# include <mln/fun/unary.hh>
+# include <mln/fun/unary_param.hh>
# include <mln/core/concept/accumulator.hh>
-# include <mln/math/acos.hh>
-# include <mln/math/cos.hh>
namespace mln
{
@@ -39,13 +37,15 @@
// from_accu: wrap an accumulator into a function
namespace fun
{
+
template <typename A>
struct from_accu : unary_param<from_accu<A>, A*>
{
from_accu() : unary_param<from_accu<A>, A*>() {};
from_accu(A* a) : unary_param<from_accu<A>, A*>(a) {};
};
- }
+
+ } // end of namespace mln::fun
namespace trait
{
@@ -58,38 +58,22 @@
typedef set_unary_ ret;
typedef typename A::result result;
typedef typename A::argument argument;
- typedef A* param;
-
- set_unary_()
- {
- }
-
- set_unary_(const param& accu)
- : accu_(accu)
- {
- }
+ typedef A* param_t;
- result read(const argument& x) const
+ static inline
+ result read(const param_t& accu_, const argument& x)
{
mln_precondition(accu_ != 0);
accu_->take(x);
return accu_->to_result ();
}
-
- void init(const param& accu)
- {
- accu_ = accu;
- }
-
- protected:
- A* accu_;
};
- }
+ } // end of namespace mln::trait::next
- }
+ } // end of namespace mln::trait
-}
+} // end of namespace mln
#endif /* ! MLN_FUN_FROM_ACCU_HH */
\ No newline at end of file
Index: trunk/milena/mln/fun/binary_param.hh
===================================================================
--- trunk/milena/mln/fun/binary_param.hh (revision 0)
+++ trunk/milena/mln/fun/binary_param.hh (revision 3733)
@@ -0,0 +1,99 @@
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// 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 F 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.
+#include "unary.hh"
+
+#ifndef MLN_FUN_BINARY_PARAM_HH
+# define MLN_FUN_BINARY_PARAM_HH
+
+# include <mln/fun/binary.hh>
+# include <mln/fun/param.hh>
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ template <typename F, typename Param, typename Storage = void, typename E = F>
+ struct binary_param: binary<binary_param<F,Param,Storage>, E>
+ {
+ typedef F flag;
+
+ binary_param()
+ {
+ }
+
+ template <typename U>
+ binary_param(const U& param)
+ {
+ this->init(param);
+ }
+
+ };
+
+ template <typename F, typename Param, typename E>
+ struct parameter< binary_param<F,Param,void,E> >
+ {
+ typedef Param param;
+ typedef void storage;
+ };
+
+ template <typename F, typename Param, typename Storage, typename E>
+ struct parameter< binary_param<F,Param,Storage,E> >
+ {
+ typedef Param param;
+ typedef Storage storage;
+
+ template <typename U>
+ storage compute(const U& u)
+ {
+ return F::compute_param(u);
+ }
+ };
+
+ }
+
+ namespace trait
+ {
+
+ namespace next
+ {
+
+ template <typename F, typename Param, typename Storage, typename E, typename T1, typename T2>
+ struct set_precise_binary_<mln::fun::binary_param<F,Param,Storage,E>, T1, T2>
+ {
+ typedef mln_trait_nbinary(F, T1, T2) ret;
+ };
+
+ } // end of namespace mln::trait::next
+
+ } // end of namespace mln::trait
+
+
+} // end of namespace mln
+
+#endif /* ! MLN_FUN_BINARY_PARAM_HH */
Index: trunk/milena/sandbox/fred/tests/wip.cc
===================================================================
--- trunk/milena/sandbox/fred/tests/wip.cc (revision 0)
+++ trunk/milena/sandbox/fred/tests/wip.cc (revision 3733)
@@ -0,0 +1,25 @@
+// Meta functions test
+#include <mln/accu/min.hh>
+#include <mln/fun/accu_result.hh>
+#include <mln/fun/from_accu.hh>
+#include <mln/fun/math/cos.hh>
+#include <mln/fun/compose.hh>
+#include <mln/core/var.hh>
+
+#include <iostream>
+
+#define dbg_print(val) std::cout << #val << "\n\t -> \t" << (val) << std::endl
+int main()
+{
+ mln::accu::min<int> min;
+ mln::fun::cos cos;
+ mln::fun::accu_result result;
+ mln::fun::from_accu< mln::accu::min<int> > frommin(&min);
+
+ mln_VAR(cosfrommin, cos(frommin));
+
+ for (int i = 5; i > 0; i--)
+ std::cout << cosfrommin(i) << std::endl;
+ for (int i = 1; i <= 5; i++)
+ std::cout << cosfrommin(i) << std::endl;
+}
\ No newline at end of file
Index: trunk/milena/sandbox/fred/tests/Makefile
===================================================================
--- trunk/milena/sandbox/fred/tests/Makefile (revision 3732)
+++ trunk/milena/sandbox/fred/tests/Makefile (revision 3733)
@@ -1,4 +1,4 @@
-TARGETS=fun.bin thru.bin cos.bin
+TARGETS=fun.bin thru.bin cos.bin wip.bin
OLENADIR=../../../..
MILENADIR=$(OLENADIR)/milena
Index: trunk/milena/sandbox/fred/functions.mkdown
===================================================================
--- trunk/milena/sandbox/fred/functions.mkdown (revision 0)
+++ trunk/milena/sandbox/fred/functions.mkdown (revision 3733)
@@ -0,0 +1,441 @@
+Ecriture de fonctions
+=====================
+
+# Fichiers
+
+## Fonctions unaires et binaires
+* *mln/fun/unary.hh*
+* *mln/fun/binary.hh*
+
+Définitions des meta-fonctions unaires et binaires
+
+* *mln/fun/spe/binary.hh*
+* *mln/fun/spe/unary.hh*
+
+Modèles des fonctions unaires et binaires, instantiés par les meta-fonctions
+
+## Fonctions paramétrées
+* *mln/fun/param.hh*
+
+Définitions concernant les fonctions paramétrées.
+
+* *mln/fun/unary\_param.hh*
+* *mln/fun/binary\_param.hh*
+
+Raccourcis d'écritures pour les fonctions paramétrées
+
+## Composition
+* *mln/fun/compose.hh*
+
+Fonction permettant de composer deux autres fonctions.
+
+* *mln/fun/composition.hh*
+
+Modèle du résultat de la composition de deux fonctions
+
+## Traits
+* *mln/trait/fun.hh*
+
+Accès à diverses propriétés de la fonction.
+
+mln\_trait\_fun\_is\_assignable, mln\_trait\_fun\_is\_parametrable: de type metal::bool\_
+
+mln\_trait\_fun\_lvalue, mln\_trait\_fun\_param, mln\_trait\_fun\_storage: typedef si la fonction répond à cette propriété, void sinon
+
+
+# Pure
+
+L'ajout d'une nouvelle fonction s'effectue en deux étapes:
+- la création d'un «flag», en général une structure vide héritant d'un modèle de meta-fonction.
+
+ struct succ : mln::fun::unary<succ> {};
+
+- la définition de la fonction sur un ou plusieurs types d'argument. Détaillée ci-après.
+
+## Unaire
+
+ #include <mln/fun/unary.hh>
+
+Création du «flag» (on suppose que l'on se trouve dans le namespace mln::fun) :
+
+ struct succ : unary<succ> {};
+
+Définition sur les entiers, dans le namespace mln::trait::next :
+
+ namespace mln
+ {
+ namespace trait
+ {
+ namespace next
+ {
+ template <typename T>
+ struct set_unary_<mln::fun::succ, Integer, T>
+ {
+ typedef set_unary_ ret;
+
+ typedef T argument;
+ typedef T result;
+
+ static result read(const argument& a)
+ {
+ return a + 1;
+ }
+ };
+ }
+ }
+ }
+
+Ou, pour uniquement travailler sur les entiers non signés:
+
+ namespace mln
+ {
+ namespace trait
+ {
+ namespace next
+ {
+ template <typename T>
+ struct set_precise_unary_<mln::fun::succ, unsigned int>
+ {
+ typedef set_precise_unary_ ret;
+
+ typedef unsigned int argument;
+ typedef unsigned int result;
+
+ static result read(const argument& a)
+ {
+ return a + 1;
+ }
+ };
+ }
+ }
+ }
+
+Définitions attendues:
+
+- typedef **ret**: la classe résultat. On peut ainsi renvoyer vers une autre classe, c'est alors dans celle-ci que devront se trouver les autres définitions.
+
+- typedef **argument**: type de l'argument (unique) que prend la fonction.
+
+- typedef **result**: type du résultat de la fonction
+
+- méthode **read**: méthode donnant le résultat de l'application de la fonction.
+
+ Elle doit répondre au prototype suivant:
+ static result read(const argument&);
+
+Le modèle mln::fun::unary prend deux paramètres:
+ template \<typename F, typename E = F\>
+
+Le premier est le drapeau, le second est le type exact (dans l'utilisation courante, les deux sont égaux).
+
+
+## Binaire
+
+ #include <mln/fun/binary.hh>
+
+Création du «flag» (on suppose que l'on se trouve dans le namespace mln::fun) :
+
+ struct plus : binary<plus> {};
+
+Définition sur les scalaires, dans le namespace mln::trait::next :
+
+ namespace mln
+ {
+ namespace trait
+ {
+ namespace next
+ {
+ template <typename T1, typename T2>
+ struct set_binary_<mln::fun::plus, Scalar, T1, Scalar, T2>
+ {
+ typedef set_binary_ ret;
+
+ typedef T1 argument1;
+ typedef T2 argument2;
+ typedef mln_sum(T1, T2) result;
+
+ static result read(const argument1& a1, const argument2& a2)
+ {
+ return a1 + a2;
+ }
+ };
+ }
+ }
+ }
+
+Ou, pour uniquement travailler entre entier non signé et flottant:
+
+ namespace mln
+ {
+ namespace trait
+ {
+ namespace next
+ {
+ template <typename T>
+ struct set_precise_binary_<mln::fun::plus, unsigned int, float>
+ {
+ typedef set_precise_binary_ ret;
+
+ typedef unsigned int argument1;
+ typedef float argument2;
+ typedef float result;
+
+ static result read(const argument1& a, const argument2& b)
+ {
+ return a + b;
+ }
+ };
+ }
+ }
+ }
+
+Définitions attendues:
+
+- typedef **ret**: la classe résultat. On peut ainsi renvoyer vers une autre classe, c'est alors dans celle-ci que devront se trouver les autres définitions.
+
+- typedef **argument1**: type du premier argument que prend la fonction.
+
+- typedef **argument2**: type du second argument que prend la fonction.
+
+- typedef **result**: type du résultat de la fonction
+
+- méthode **read**: méthode donnant le résultat de l'application de la fonction.
+
+ Elle doit répondre au prototype suivant:
+ static result read(const argument1&, const argument2&);
+
+# Unaire affectable
+
+Une fonction unaire peut parfois être affectable. Cela autorise des écritures telles que:
+ cos(x) = 1;
+ red(col) = 255;
+
+Le terme "affectable" inclue la notion d'inversibilité de la fonction.
+Pour supporter ce comportement, il faut ajouter aux définitions d'une fonction unaire pure les éléments suivants:
+
+- typedef argument& **lvalue**: une fonction n'est considérée comme affectable que si ce typedef existe. Il donne de plus le type de l'argument de la fonction dans la notation "f(x) = y".
+
+- méthode **write**: méthode dont le premier argument est accessible en lecture/écriture et dont le second argument donne le résultat attendu de la méthode read après l'application de write (cad, write(x, 1) => read(x) == 1).
+
+ Elle doit répondre au prototype suivant:
+ static void write(lvalue, const result&);
+
+# Paramétrable
+
+La définition des paramètres s'effectue en spécialisant le modèle mln::fun::parameter<Flag>.
+
+ struct cos_ax;
+
+ template <>
+ struct parameter<cos_ax>
+ {
+ typedef int param;
+ };
+
+ struct cos_ax : unary<cos_ax>
+ {
+ cos_ax(int a) : unary<cos_ax>(a) {};
+ };
+
+Le modèle devant être spécialisé avant la définition de la meta-fonction, l'écriture peut sembler lourde. Un raccourcis est présenté dans les sections *unary_param* et *binary_param*. Il est nécessaire d'écrire le constructeur!
+
+## Unaire
+
+La présence d'un paramètre ajoute un argument aux méthodes read et write: la valeur donnée au paramètre est transmise en premier argument à read et, si applicable, à write.
+
+Les prototypes deviennent:
+ static result read(const param&, const argument&);
+ static void write(const param&, lvalue, const result&);
+
+### Exemple, implémentation de cos_ax
+
+ template <typename S>
+ struct set_unary_<mln::fun::cos_ax, Scalar, S>
+ {
+ typedef set_unary_ ret;
+
+ typedef S argument;
+ typedef S& lvalue;
+ typedef double result;
+
+ static result read(const int& a, const argument& x)
+ {
+ return math::cos(x) * a;
+ }
+
+ static void write(const int& a, lvalue l, const result& r)
+ {
+ l = math::acos(r) / a;
+ }
+ };
+
+### unary_param
+
+L'écriture passant par un modèle extérieur pouvant paraître lourde, le modèle unary_param permet de simplifier celle-ci.
+ unary_param<Flag,Param,Storage,E>
+
+E est le type exact, par défaut identique à Flag. Storage est expliqué dans la section éponyme.
+
+Param est le type désiré pour le paramètre, similaire à parameter<T>::param.
+Ainsi, cos_ax peut se déclarer de manière plus conçise:
+
+ struct cos_ax : unary_param<cos_ax,int>
+ {
+ cos_ax(int a) : unary_param<cos_ax,int>(a) {};
+ };
+
+## Binaire
+
+De même pour les fonctions binaires, la présence d'un paramètre ajoute un argument à la méthode read: la valeur donnée au paramètre est transmise en premier argument à read.
+
+Le prototype devient:
+ static result read(const param&, const argument1&, const argument2&);
+
+### Exemple, interpolation linéaire
+
+ struct lin_interp;
+
+ template <>
+ struct parameter<lin_interp>
+ {
+ typedef float param;
+ };
+
+ struct lin_interp : binary<lin_interp>
+ {
+ lin_interp(float a) : binary<lin_interp>(a) {};
+ };
+
+ template <typename S1, typename S2>
+ struct set_binary_<mln::fun::lin_interp, Scalar, S1, Scalar, S2>
+ {
+ typedef set_binary_ ret;
+
+ typedef S1 argument1;
+ typedef S2 argument2;
+ typedef double result;
+
+ static result read(const float& a, const argument1& f1, const argument2& f2)
+ {
+ return a * f1 + (1.0f - a) * f2;
+ }
+ };
+
+### binary_param
+
+L'écriture passant par un modèle extérieur pouvant paraître lourde, le modèle binary_param permet de simplifier celle-ci.
+ binary_param<Flag,Param,Storage,E>
+
+E est le type exact, par défaut identique à Flag. Storage est expliqué dans la section éponyme.
+
+Param est le type désiré pour le paramètre, similaire à parameter<T>::param.
+Ainsi, lin_interp peut se déclarer de manière plus conçise:
+
+ struct lin_interp : binary_param<lin_interp,float>
+ {
+ lin_interp(float a) : binary_param<lin_interp,float>(a) {};
+ };
+
+## «Storage»
+
+Lors de la spécialisation de mln::fun::parameter, on peut définir le type "storage". Cela permet d'utiliser un type différent pour le stockage du paramètre, et éventuellement d'effectuer un calcul.
+La présence de "storage" impose celle d'une méthode "compute":
+ static double compute(const param&);
+
+### Exemple
+
+Dans le namespace mln::fun:
+
+ struct log_n;
+
+ template <>
+ struct parameter<log_n>
+ {
+ typedef int param;
+ typedef double storage;
+
+ static double compute(const param& base)
+ {
+ return std::log(base);
+ }
+ };
+
+ struct log_n : unary<log_n>
+ {
+ log_n(int n) : unary<log_n>(n) {};
+ };
+
+Dans le namespace mln::trait::next:
+
+ template <typename S>
+ struct set_unary_<mln::fun::log_n, Scalar, S>
+ {
+ typedef set_unary_ ret;
+
+ typedef S argument;
+ typedef S& lvalue;
+ typedef double result;
+
+ static result read(const double& log_base, const argument& x)
+ {
+ return std::log(x) / log_base;
+ }
+
+ static void write(const double& log_base, lvalue l, const result& r)
+ {
+ l = std::exp(r * log_base);
+ }
+ };
+
+### ... avec unary_param
+
+Dans le namespace mln::fun:
+
+ struct log_n : unary_param<log_n, int, double>
+ {
+ log_n(int n) : unary<log_n>(n) {};
+
+ static double compute_param(const int& n)
+ {
+ return std::log(base);
+ }
+ };
+
+Dans le namespace mln::trait::next:
+
+ template <typename S>
+ struct set_unary_<mln::fun::log_n, Scalar, S>
+ {
+ typedef set_unary_ ret;
+
+ typedef S argument;
+ typedef S& lvalue;
+ typedef double result;
+
+ static result read(const double& log_base, const argument& x)
+ {
+ return std::log(x) / log_base;
+ }
+
+ static void write(const double& log_base, lvalue l, const result& r)
+ {
+ l = std::exp(r * log_base);
+ }
+ };
+
+# Composition
+
+La composition de fonctions opère entre une meta-fonction A unaire et une fonction B, éventuellement meta, unaire ou binaire. Le résultat est une fonction de l'arité de B, ou meta-fonction si B en est une.
+
+Le type de la composée "F . G" est:
+ mln::fun::internal::composition<Category_F, F, Category_G, G>
+
+La manière la plus simple de composer est d'appliquer la seconde fonction à la première:
+ cos(cos) est l'équivalent de "cos . cos"
+
+Il existe également une fonction compose:
+
+ mln::fun::compose compose;
+ compose(cos,cos) en est un autre équivalent
+
+# «thru»
\ No newline at end of file
Index: trunk/milena/sandbox/fred/functions.html
===================================================================
--- trunk/milena/sandbox/fred/functions.html (revision 0)
+++ trunk/milena/sandbox/fred/functions.html (revision 3733)
@@ -0,0 +1,478 @@
+<h1>Ecriture de fonctions</h1>
+
+<h1>Fichiers</h1>
+
+<h2>Fonctions unaires et binaires</h2>
+
+<ul>
+<li><em>mln/fun/unary.hh</em></li>
+<li><em>mln/fun/binary.hh</em></li>
+</ul>
+
+<p>Définitions des meta-fonctions unaires et binaires</p>
+
+<ul>
+<li><em>mln/fun/spe/binary.hh</em></li>
+<li><em>mln/fun/spe/unary.hh</em></li>
+</ul>
+
+<p>Modèles des fonctions unaires et binaires, instantiés par les meta-fonctions</p>
+
+<h2>Fonctions paramétrées</h2>
+
+<ul>
+<li><em>mln/fun/param.hh</em></li>
+</ul>
+
+<p>Définitions concernant les fonctions paramétrées.</p>
+
+<ul>
+<li><em>mln/fun/unary_param.hh</em></li>
+<li><em>mln/fun/binary_param.hh</em></li>
+</ul>
+
+<p>Raccourcis d'écritures pour les fonctions paramétrées</p>
+
+<h2>Composition</h2>
+
+<ul>
+<li><em>mln/fun/compose.hh</em></li>
+</ul>
+
+<p>Fonction permettant de composer deux autres fonctions.</p>
+
+<ul>
+<li><em>mln/fun/composition.hh</em></li>
+</ul>
+
+<p>Modèle du résultat de la composition de deux fonctions</p>
+
+<h2>Traits</h2>
+
+<ul>
+<li><em>mln/trait/fun.hh</em></li>
+</ul>
+
+<p>Accès à diverses propriétés de la fonction.</p>
+
+<p>mln_trait_fun_is_assignable, mln_trait_fun_is_parametrable: de type metal::bool_</p>
+
+<p>mln_trait_fun_lvalue, mln_trait_fun_param, mln_trait_fun_storage: typedef si la fonction répond à cette propriété, void sinon</p>
+
+<h1>Pure</h1>
+
+<p>L'ajout d'une nouvelle fonction s'effectue en deux étapes:
+- la création d'un «flag», en général une structure vide héritant d'un modèle de meta-fonction.</p>
+
+<pre><code> struct succ : mln::fun::unary<succ> {};
+</code></pre>
+
+<ul>
+<li>la définition de la fonction sur un ou plusieurs types d'argument. Détaillée ci-après.</li>
+</ul>
+
+<h2>Unaire</h2>
+
+<pre><code> #include <mln/fun/unary.hh>
+</code></pre>
+
+<p>Création du «flag» (on suppose que l'on se trouve dans le namespace mln::fun) :</p>
+
+<pre><code> struct succ : unary<succ> {};
+</code></pre>
+
+<p>Définition sur les entiers, dans le namespace mln::trait::next :</p>
+
+<pre><code> namespace mln
+ {
+ namespace trait
+ {
+ namespace next
+ {
+ template <typename T>
+ struct set_unary_<mln::fun::succ, Integer, T>
+ {
+ typedef set_unary_ ret;
+
+ typedef T argument;
+ typedef T result;
+
+ static result read(const argument& a)
+ {
+ return a + 1;
+ }
+ };
+ }
+ }
+ }
+</code></pre>
+
+<p>Ou, pour uniquement travailler sur les entiers non signés:</p>
+
+<pre><code> namespace mln
+ {
+ namespace trait
+ {
+ namespace next
+ {
+ template <typename T>
+ struct set_precise_unary_<mln::fun::succ, unsigned int>
+ {
+ typedef set_precise_unary_ ret;
+
+ typedef unsigned int argument;
+ typedef unsigned int result;
+
+ static result read(const argument& a)
+ {
+ return a + 1;
+ }
+ };
+ }
+ }
+ }
+</code></pre>
+
+<p>Définitions attendues:</p>
+
+<ul>
+<li><p>typedef <strong>ret</strong>: la classe résultat. On peut ainsi renvoyer vers une autre classe, c'est alors dans celle-ci que devront se trouver les autres définitions.</p></li>
+<li><p>typedef <strong>argument</strong>: type de l'argument (unique) que prend la fonction.</p></li>
+<li><p>typedef <strong>result</strong>: type du résultat de la fonction</p></li>
+<li><p>méthode <strong>read</strong>: méthode donnant le résultat de l'application de la fonction.</p>
+
+<pre><code>Elle doit répondre au prototype suivant:
+ static result read(const argument&);
+</code></pre></li>
+</ul>
+
+<p>Le modèle mln::fun::unary prend deux paramètres:
+ template \<typename F, typename E = F\></p>
+
+<p>Le premier est le drapeau, le second est le type exact (dans l'utilisation courante, les deux sont égaux).</p>
+
+<h2>Binaire</h2>
+
+<pre><code> #include <mln/fun/binary.hh>
+</code></pre>
+
+<p>Création du «flag» (on suppose que l'on se trouve dans le namespace mln::fun) :</p>
+
+<pre><code> struct plus : binary<plus> {};
+</code></pre>
+
+<p>Définition sur les scalaires, dans le namespace mln::trait::next :</p>
+
+<pre><code> namespace mln
+ {
+ namespace trait
+ {
+ namespace next
+ {
+ template <typename T1, typename T2>
+ struct set_binary_<mln::fun::plus, Scalar, T1, Scalar, T2>
+ {
+ typedef set_binary_ ret;
+
+ typedef T1 argument1;
+ typedef T2 argument2;
+ typedef mln_sum(T1, T2) result;
+
+ static result read(const argument1& a1, const argument2& a2)
+ {
+ return a1 + a2;
+ }
+ };
+ }
+ }
+ }
+</code></pre>
+
+<p>Ou, pour uniquement travailler entre entier non signé et flottant:</p>
+
+<pre><code> namespace mln
+ {
+ namespace trait
+ {
+ namespace next
+ {
+ template <typename T>
+ struct set_precise_binary_<mln::fun::plus, unsigned int, float>
+ {
+ typedef set_precise_binary_ ret;
+
+ typedef unsigned int argument1;
+ typedef float argument2;
+ typedef float result;
+
+ static result read(const argument1& a, const argument2& b)
+ {
+ return a + b;
+ }
+ };
+ }
+ }
+ }
+</code></pre>
+
+<p>Définitions attendues:</p>
+
+<ul>
+<li><p>typedef <strong>ret</strong>: la classe résultat. On peut ainsi renvoyer vers une autre classe, c'est alors dans celle-ci que devront se trouver les autres définitions.</p></li>
+<li><p>typedef <strong>argument1</strong>: type du premier argument que prend la fonction.</p></li>
+<li><p>typedef <strong>argument2</strong>: type du second argument que prend la fonction.</p></li>
+<li><p>typedef <strong>result</strong>: type du résultat de la fonction</p></li>
+<li><p>méthode <strong>read</strong>: méthode donnant le résultat de l'application de la fonction.</p>
+
+<pre><code>Elle doit répondre au prototype suivant:
+ static result read(const argument1&, const argument2&);
+</code></pre></li>
+</ul>
+
+<h1>Unaire affectable</h1>
+
+<p>Une fonction unaire peut parfois être affectable. Cela autorise des écritures telles que:
+ cos(x) = 1;
+ red(col) = 255;</p>
+
+<p>Le terme "affectable" inclue la notion d'inversibilité de la fonction.
+Pour supporter ce comportement, il faut ajouter aux définitions d'une fonction unaire pure les éléments suivants:</p>
+
+<ul>
+<li><p>typedef argument& <strong>lvalue</strong>: une fonction n'est considérée comme affectable que si ce typedef existe. Il donne de plus le type de l'argument de la fonction dans la notation "f(x) = y".</p></li>
+<li><p>méthode <strong>write</strong>: méthode dont le premier argument est accessible en lecture/écriture et dont le second argument donne le résultat attendu de la méthode read après l'application de write (cad, write(x, 1) => read(x) == 1).</p>
+
+<pre><code>Elle doit répondre au prototype suivant:
+ static void write(lvalue, const result&);
+</code></pre></li>
+</ul>
+
+<h1>Paramétrable</h1>
+
+<p>La définition des paramètres s'effectue en spécialisant le modèle mln::fun::parameter<Flag>.</p>
+
+<pre><code> struct cos_ax;
+
+ template <>
+ struct parameter<cos_ax>
+ {
+ typedef int param;
+ };
+
+ struct cos_ax : unary<cos_ax>
+ {
+ cos_ax(int a) : unary<cos_ax>(a) {};
+ };
+</code></pre>
+
+<p>Le modèle devant être spécialisé avant la définition de la meta-fonction, l'écriture peut sembler lourde. Un raccourcis est présenté dans les sections <em>unary_param</em> et <em>binary_param</em>. Il est nécessaire d'écrire le constructeur!</p>
+
+<h2>Unaire</h2>
+
+<p>La présence d'un paramètre ajoute un argument aux méthodes read et write: la valeur donnée au paramètre est transmise en premier argument à read et, si applicable, à write.</p>
+
+<p>Les prototypes deviennent:
+ static result read(const param&, const argument&);
+ static void write(const param&, lvalue, const result&);</p>
+
+<h3>Exemple, implémentation de cos_ax</h3>
+
+<pre><code> template <typename S>
+ struct set_unary_<mln::fun::cos_ax, Scalar, S>
+ {
+ typedef set_unary_ ret;
+
+ typedef S argument;
+ typedef S& lvalue;
+ typedef double result;
+
+ static result read(const int& a, const argument& x)
+ {
+ return math::cos(x) * a;
+ }
+
+ static void write(const int& a, lvalue l, const result& r)
+ {
+ l = math::acos(r) / a;
+ }
+ };
+</code></pre>
+
+<h3>unary_param</h3>
+
+<p>L'écriture passant par un modèle extérieur pouvant paraître lourde, le modèle unary<em>param permet de simplifier celle-ci.
+ unary</em>param<Flag,Param,Storage,E></p>
+
+<p>E est le type exact, par défaut identique à Flag. Storage est expliqué dans la section éponyme.</p>
+
+<p>Param est le type désiré pour le paramètre, similaire à parameter<T>::param.
+Ainsi, cos_ax peut se déclarer de manière plus conçise:</p>
+
+<pre><code> struct cos_ax : unary_param<cos_ax,int>
+ {
+ cos_ax(int a) : unary_param<cos_ax,int>(a) {};
+ };
+</code></pre>
+
+<h2>Binaire</h2>
+
+<p>De même pour les fonctions binaires, la présence d'un paramètre ajoute un argument à la méthode read: la valeur donnée au paramètre est transmise en premier argument à read.</p>
+
+<p>Le prototype devient:
+ static result read(const param&, const argument1&, const argument2&);</p>
+
+<h3>Exemple, interpolation linéaire</h3>
+
+<pre><code> struct lin_interp;
+
+ template <>
+ struct parameter<lin_interp>
+ {
+ typedef float param;
+ };
+
+ struct lin_interp : binary<lin_interp>
+ {
+ lin_interp(float a) : binary<lin_interp>(a) {};
+ };
+
+ template <typename S1, typename S2>
+ struct set_binary_<mln::fun::lin_interp, Scalar, S1, Scalar, S2>
+ {
+ typedef set_binary_ ret;
+
+ typedef S1 argument1;
+ typedef S2 argument2;
+ typedef double result;
+
+ static result read(const float& a, const argument1& f1, const argument2& f2)
+ {
+ return a * f1 + (1.0f - a) * f2;
+ }
+ };
+</code></pre>
+
+<h3>binary_param</h3>
+
+<p>L'écriture passant par un modèle extérieur pouvant paraître lourde, le modèle binary<em>param permet de simplifier celle-ci.
+ binary</em>param<Flag,Param,Storage,E></p>
+
+<p>E est le type exact, par défaut identique à Flag. Storage est expliqué dans la section éponyme.</p>
+
+<p>Param est le type désiré pour le paramètre, similaire à parameter<T>::param.
+Ainsi, lin_interp peut se déclarer de manière plus conçise:</p>
+
+<pre><code> struct lin_interp : binary_param<lin_interp,float>
+ {
+ lin_interp(float a) : binary_param<lin_interp,float>(a) {};
+ };
+</code></pre>
+
+<h2>«Storage»</h2>
+
+<p>Lors de la spécialisation de mln::fun::parameter, on peut définir le type "storage". Cela permet d'utiliser un type différent pour le stockage du paramètre, et éventuellement d'effectuer un calcul.
+La présence de "storage" impose celle d'une méthode "compute":
+ static double compute(const param&);</p>
+
+<h3>Exemple</h3>
+
+<p>Dans le namespace mln::fun:</p>
+
+<pre><code> struct log_n;
+
+ template <>
+ struct parameter<log_n>
+ {
+ typedef int param;
+ typedef double storage;
+
+ static double compute(const param& base)
+ {
+ return std::log(base);
+ }
+ };
+
+ struct log_n : unary<log_n>
+ {
+ log_n(int n) : unary<log_n>(n) {};
+ };
+</code></pre>
+
+<p>Dans le namespace mln::trait::next:</p>
+
+<pre><code> template <typename S>
+ struct set_unary_<mln::fun::log_n, Scalar, S>
+ {
+ typedef set_unary_ ret;
+
+ typedef S argument;
+ typedef S& lvalue;
+ typedef double result;
+
+ static result read(const double& log_base, const argument& x)
+ {
+ return std::log(x) / log_base;
+ }
+
+ static void write(const double& log_base, lvalue l, const result& r)
+ {
+ l = std::exp(r * log_base);
+ }
+ };
+</code></pre>
+
+<h3>... avec unary_param</h3>
+
+<p>Dans le namespace mln::fun:</p>
+
+<pre><code> struct log_n : unary_param<log_n, int, double>
+ {
+ log_n(int n) : unary<log_n>(n) {};
+
+ static double compute_param(const int& n)
+ {
+ return std::log(base);
+ }
+ };
+</code></pre>
+
+<p>Dans le namespace mln::trait::next:</p>
+
+<pre><code> template <typename S>
+ struct set_unary_<mln::fun::log_n, Scalar, S>
+ {
+ typedef set_unary_ ret;
+
+ typedef S argument;
+ typedef S& lvalue;
+ typedef double result;
+
+ static result read(const double& log_base, const argument& x)
+ {
+ return std::log(x) / log_base;
+ }
+
+ static void write(const double& log_base, lvalue l, const result& r)
+ {
+ l = std::exp(r * log_base);
+ }
+ };
+</code></pre>
+
+<h1>Composition</h1>
+
+<p>La composition de fonctions opère entre une meta-fonction A unaire et une fonction B, éventuellement meta, unaire ou binaire. Le résultat est une fonction de l'arité de B, ou meta-fonction si B en est une.</p>
+
+<p>Le type de la composée "F . G" est:
+ mln::fun::internal::composition<Category_F, F, Category_G, G></p>
+
+<p>La manière la plus simple de composer est d'appliquer la seconde fonction à la première:
+ cos(cos) est l'équivalent de "cos . cos"</p>
+
+<p>Il existe également une fonction compose:</p>
+
+<pre><code> mln::fun::compose compose;
+ compose(cos,cos) en est un autre équivalent
+</code></pre>
+
+<h1>«thru»</h1>
1
0
* doc/Doxyfile.in: add a new macro.
* doc/Makefile.am: add new distributed files.
* doc/examples/tuto3/first_routine.cc: add doxygen file tag.
* doc/groups.hh,
* doc/groups/accu.hh,
* doc/groups/functions.hh,
* doc/groups/graph.hh,
* doc/groups/images.hh,
* doc/groups/main.hh,
* doc/groups/neighb.hh,
* doc/groups/site_set.hh,
* doc/groups/util.hh,
* doc/groups/win.hh,
* mln/accu/bbox.hh,
* mln/accu/center.hh,
* mln/accu/convolve.hh,
* mln/accu/count.hh,
* mln/accu/count_adjacent_vertices.hh,
* mln/accu/count_labels.hh,
* mln/accu/height.hh,
* mln/accu/histo.hh,
* mln/accu/inf.hh,
* mln/accu/internal/couple.hh,
* mln/accu/label_used.hh,
* mln/accu/land.hh,
* mln/accu/land_basic.hh,
* mln/accu/line.hh,
* mln/accu/lor.hh,
* mln/accu/lor_basic.hh,
* mln/accu/maj_h.hh,
* mln/accu/max.hh,
* mln/accu/max_h.hh,
* mln/accu/mean.hh,
* mln/accu/median_alt.hh,
* mln/accu/median_h.hh,
* mln/accu/min.hh,
* mln/accu/min_h.hh,
* mln/accu/min_max.hh,
* mln/accu/pair.hh,
* mln/accu/rank.hh,
* mln/accu/rank_bool.hh,
* mln/accu/rank_high_quant.hh,
* mln/accu/rms.hh,
* mln/accu/site_set/rectangularity.hh,
* mln/accu/stat/deviation.hh,
* mln/accu/stat/variance.hh,
* mln/accu/sum.hh,
* mln/accu/sup.hh,
* mln/accu/tuple.hh,
* mln/accu/volume.hh,
* mln/canvas/morpho/internal/find_root.hh,
* mln/convert/impl/from_image_to_site_set.hh,
* mln/core/alias/neighb1d.hh,
* mln/core/alias/neighb2d.hh,
* mln/core/alias/neighb3d.hh,
* mln/core/alias/window1d.hh,
* mln/core/alias/window2d.hh,
* mln/core/alias/window3d.hh,
* mln/core/concept/function.hh,
* mln/core/concept/object.hh,
* mln/core/concept/object_id.hh,
* mln/core/image/complex_image.hh,
* mln/core/image/decorated_image.hh,
* mln/core/image/edge_image.hh,
* mln/core/image/extended.hh,
* mln/core/image/extension_fun.hh,
* mln/core/image/extension_ima.hh,
* mln/core/image/extension_val.hh,
* mln/core/image/flat_image.hh,
* mln/core/image/fun_image.hh,
* mln/core/image/hexa.hh,
* mln/core/image/interpolated.hh,
* mln/core/image/lazy_image.hh,
* mln/core/image/plain.hh,
* mln/core/image/safe.hh,
* mln/core/image/slice_image.hh,
* mln/core/image/sub_image.hh,
* mln/core/image/sub_image_if.hh,
* mln/core/image/t_image.hh,
* mln/core/image/thru_morpher.hh,
* mln/core/image/thrubin_morpher.hh,
* mln/core/image/tr_image.hh,
* mln/core/image/unproject_image.hh,
* mln/core/image/vertex_image.hh,
* mln/core/image/violent_cast_image.hh,
* mln/core/site_set/box.hh,
* mln/core/site_set/p_array.hh,
* mln/core/site_set/p_centered.hh,
* mln/core/site_set/p_complex.hh,
* mln/core/site_set/p_edges.hh,
* mln/core/site_set/p_faces.hh,
* mln/core/site_set/p_if.hh,
* mln/core/site_set/p_image.hh,
* mln/core/site_set/p_key.hh,
* mln/core/site_set/p_line2d.hh,
* mln/core/site_set/p_mutable_array_of.hh,
* mln/core/site_set/p_priority.hh,
* mln/core/site_set/p_queue.hh,
* mln/core/site_set/p_queue_fast.hh,
* mln/core/site_set/p_run.hh,
* mln/core/site_set/p_set.hh,
* mln/core/site_set/p_vaccess.hh,
* mln/core/site_set/p_vertices.hh,
* mln/fun/i2v/all.hh,
* mln/fun/meta/inty.hh,
* mln/fun/meta/lum.hh,
* mln/pw/image.hh,
* mln/topo/is_n_face.hh,
* mln/util/array.hh,
* mln/util/couple.hh,
* mln/util/fibonacci_heap.hh,
* mln/util/graph.hh,
* mln/util/line_graph.hh,
* mln/util/ord_pair.hh,
* mln/util/set.hh,
* mln/util/site_pair.hh,
* mln/util/soft_heap.hh,
* mln/win/backdiag2d.hh,
* mln/win/ball.hh,
* mln/win/cube3d.hh,
* mln/win/cuboid3d.hh,
* mln/win/diag2d.hh,
* mln/win/disk2d.hh,
* mln/win/hline2d.hh,
* mln/win/line.hh,
* mln/win/multiple.hh,
* mln/win/multiple_size.hh,
* mln/win/octagon2d.hh,
* mln/win/rectangle2d.hh,
* mln/win/segment1d.hh,
* mln/win/shift.hh,
* mln/win/sphere3d.hh,
* mln/win/vline2d.hh: revamp doc and map types to doxygen modules.
* tests/transform/distance_and_closest_point_geodesic.cc,
* tests/util/soft_heap.cc: fix doxygen file tag.
---
milena/ChangeLog | 144 ++++++++++++++
milena/doc/Doxyfile.in | 3 +-
milena/doc/Makefile.am | 1 +
milena/doc/examples/tuto3/first_routine.cc | 2 +
milena/doc/groups.hh | 28 ---
milena/doc/groups/accu.hh | 29 +++
milena/doc/groups/functions.hh | 7 +
milena/doc/groups/graph.hh | 7 +
milena/doc/groups/images.hh | 36 ++++
milena/doc/groups/main.hh | 30 +++
milena/doc/groups/neighb.hh | 28 +++
milena/doc/groups/site_set.hh | 42 ++++
milena/doc/groups/util.hh | 8 +
milena/doc/groups/win.hh | 42 ++++
milena/mln/accu/bbox.hh | 7 +-
milena/mln/accu/center.hh | 5 +-
milena/mln/accu/convolve.hh | 7 +-
milena/mln/accu/count.hh | 9 +-
milena/mln/accu/count_adjacent_vertices.hh | 9 +-
milena/mln/accu/count_labels.hh | 5 +-
milena/mln/accu/height.hh | 10 +-
milena/mln/accu/histo.hh | 8 +-
milena/mln/accu/inf.hh | 10 +-
milena/mln/accu/internal/couple.hh | 2 +-
milena/mln/accu/label_used.hh | 5 +-
milena/mln/accu/land.hh | 9 +-
milena/mln/accu/land_basic.hh | 13 +-
milena/mln/accu/line.hh | 5 +-
milena/mln/accu/lor.hh | 9 +-
milena/mln/accu/lor_basic.hh | 13 +-
milena/mln/accu/maj_h.hh | 8 +-
milena/mln/accu/max.hh | 7 +-
milena/mln/accu/max_h.hh | 8 +-
milena/mln/accu/mean.hh | 8 +-
milena/mln/accu/median_alt.hh | 8 +-
milena/mln/accu/median_h.hh | 8 +-
milena/mln/accu/min.hh | 8 +-
milena/mln/accu/min_h.hh | 8 +-
milena/mln/accu/min_max.hh | 7 +-
milena/mln/accu/pair.hh | 5 +-
milena/mln/accu/rank.hh | 7 +-
milena/mln/accu/rank_bool.hh | 11 +-
milena/mln/accu/rank_high_quant.hh | 8 +-
milena/mln/accu/rms.hh | 4 +-
milena/mln/accu/site_set/rectangularity.hh | 5 +-
milena/mln/accu/stat/deviation.hh | 4 +-
milena/mln/accu/stat/variance.hh | 5 +-
milena/mln/accu/sum.hh | 4 +-
milena/mln/accu/sup.hh | 4 +-
milena/mln/accu/tuple.hh | 6 +-
milena/mln/accu/volume.hh | 8 +-
milena/mln/canvas/morpho/internal/find_root.hh | 2 +-
milena/mln/convert/impl/from_image_to_site_set.hh | 2 +-
milena/mln/core/alias/neighb1d.hh | 37 ++--
milena/mln/core/alias/neighb2d.hh | 87 +++++---
milena/mln/core/alias/neighb3d.hh | 207 ++++++++++++--------
milena/mln/core/alias/window1d.hh | 10 +-
milena/mln/core/alias/window2d.hh | 45 +++--
milena/mln/core/alias/window3d.hh | 79 +++++---
milena/mln/core/concept/function.hh | 107 +++--------
milena/mln/core/concept/object.hh | 4 +-
milena/mln/core/concept/object_id.hh | 2 +-
milena/mln/core/image/complex_image.hh | 8 +-
milena/mln/core/image/decorated_image.hh | 22 +-
milena/mln/core/image/edge_image.hh | 4 +-
milena/mln/core/image/extended.hh | 6 +-
milena/mln/core/image/extension_fun.hh | 27 ++--
milena/mln/core/image/extension_ima.hh | 6 +-
milena/mln/core/image/extension_val.hh | 6 +-
milena/mln/core/image/flat_image.hh | 21 +-
milena/mln/core/image/fun_image.hh | 5 +-
milena/mln/core/image/hexa.hh | 9 +-
milena/mln/core/image/interpolated.hh | 3 +-
milena/mln/core/image/lazy_image.hh | 14 +-
milena/mln/core/image/plain.hh | 6 +-
milena/mln/core/image/safe.hh | 10 +-
milena/mln/core/image/slice_image.hh | 10 +-
milena/mln/core/image/sub_image.hh | 27 ++--
milena/mln/core/image/sub_image_if.hh | 19 +-
milena/mln/core/image/t_image.hh | 24 ++-
milena/mln/core/image/thru_morpher.hh | 8 +-
milena/mln/core/image/thrubin_morpher.hh | 12 +-
milena/mln/core/image/tr_image.hh | 7 +-
milena/mln/core/image/unproject_image.hh | 4 +-
milena/mln/core/image/vertex_image.hh | 5 +-
milena/mln/core/image/violent_cast_image.hh | 20 +-
milena/mln/core/site_set/box.hh | 16 +-
milena/mln/core/site_set/p_array.hh | 6 +-
milena/mln/core/site_set/p_centered.hh | 25 ++-
milena/mln/core/site_set/p_complex.hh | 6 +-
milena/mln/core/site_set/p_edges.hh | 4 +
milena/mln/core/site_set/p_faces.hh | 12 +-
milena/mln/core/site_set/p_if.hh | 22 ++-
milena/mln/core/site_set/p_image.hh | 21 ++-
milena/mln/core/site_set/p_key.hh | 21 +-
milena/mln/core/site_set/p_line2d.hh | 10 +-
milena/mln/core/site_set/p_mutable_array_of.hh | 9 +-
milena/mln/core/site_set/p_priority.hh | 12 +-
milena/mln/core/site_set/p_queue.hh | 17 +-
milena/mln/core/site_set/p_queue_fast.hh | 22 ++-
milena/mln/core/site_set/p_run.hh | 20 +-
milena/mln/core/site_set/p_set.hh | 10 +-
milena/mln/core/site_set/p_vaccess.hh | 8 +-
milena/mln/core/site_set/p_vertices.hh | 6 +-
milena/mln/fun/i2v/all.hh | 20 +-
milena/mln/fun/meta/inty.hh | 2 +-
milena/mln/fun/meta/lum.hh | 2 +-
milena/mln/pw/image.hh | 5 +-
milena/mln/topo/is_n_face.hh | 3 +-
milena/mln/util/array.hh | 5 +-
milena/mln/util/couple.hh | 3 +
milena/mln/util/fibonacci_heap.hh | 3 +
milena/mln/util/graph.hh | 5 +-
milena/mln/util/line_graph.hh | 5 +-
milena/mln/util/ord_pair.hh | 9 +-
milena/mln/util/set.hh | 7 +-
milena/mln/util/site_pair.hh | 8 +-
milena/mln/util/soft_heap.hh | 4 +
milena/mln/win/backdiag2d.hh | 22 ++-
milena/mln/win/ball.hh | 6 +-
milena/mln/win/cube3d.hh | 28 ++--
milena/mln/win/cuboid3d.hh | 44 +++--
milena/mln/win/diag2d.hh | 22 ++-
milena/mln/win/disk2d.hh | 6 +-
milena/mln/win/hline2d.hh | 31 ++--
milena/mln/win/line.hh | 8 +-
milena/mln/win/multiple.hh | 18 +-
milena/mln/win/multiple_size.hh | 4 +
milena/mln/win/octagon2d.hh | 22 ++-
milena/mln/win/rectangle2d.hh | 26 ++-
milena/mln/win/segment1d.hh | 22 ++-
milena/mln/win/shift.hh | 10 +-
milena/mln/win/sphere3d.hh | 7 +-
milena/mln/win/vline2d.hh | 34 ++--
.../distance_and_closest_point_geodesic.cc | 2 +-
milena/tests/util/graph.cc | 4 +-
milena/tests/util/soft_heap.cc | 2 +-
137 files changed, 1430 insertions(+), 755 deletions(-)
delete mode 100644 milena/doc/groups.hh
create mode 100644 milena/doc/groups/accu.hh
create mode 100644 milena/doc/groups/functions.hh
create mode 100644 milena/doc/groups/graph.hh
create mode 100644 milena/doc/groups/images.hh
create mode 100644 milena/doc/groups/main.hh
create mode 100644 milena/doc/groups/neighb.hh
create mode 100644 milena/doc/groups/site_set.hh
create mode 100644 milena/doc/groups/util.hh
create mode 100644 milena/doc/groups/win.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index b073efe..f27acb1 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,149 @@
2009-04-29 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Update doc.
+
+ * doc/Doxyfile.in: add a new macro.
+
+ * doc/Makefile.am: add new distributed files.
+
+ * doc/examples/tuto3/first_routine.cc: add doxygen file tag.
+
+ * doc/groups.hh,
+ * doc/groups/accu.hh,
+ * doc/groups/functions.hh,
+ * doc/groups/graph.hh,
+ * doc/groups/images.hh,
+ * doc/groups/main.hh,
+ * doc/groups/neighb.hh,
+ * doc/groups/site_set.hh,
+ * doc/groups/util.hh,
+ * doc/groups/win.hh,
+ * mln/accu/bbox.hh,
+ * mln/accu/center.hh,
+ * mln/accu/convolve.hh,
+ * mln/accu/count.hh,
+ * mln/accu/count_adjacent_vertices.hh,
+ * mln/accu/count_labels.hh,
+ * mln/accu/height.hh,
+ * mln/accu/histo.hh,
+ * mln/accu/inf.hh,
+ * mln/accu/internal/couple.hh,
+ * mln/accu/label_used.hh,
+ * mln/accu/land.hh,
+ * mln/accu/land_basic.hh,
+ * mln/accu/line.hh,
+ * mln/accu/lor.hh,
+ * mln/accu/lor_basic.hh,
+ * mln/accu/maj_h.hh,
+ * mln/accu/max.hh,
+ * mln/accu/max_h.hh,
+ * mln/accu/mean.hh,
+ * mln/accu/median_alt.hh,
+ * mln/accu/median_h.hh,
+ * mln/accu/min.hh,
+ * mln/accu/min_h.hh,
+ * mln/accu/min_max.hh,
+ * mln/accu/pair.hh,
+ * mln/accu/rank.hh,
+ * mln/accu/rank_bool.hh,
+ * mln/accu/rank_high_quant.hh,
+ * mln/accu/rms.hh,
+ * mln/accu/site_set/rectangularity.hh,
+ * mln/accu/stat/deviation.hh,
+ * mln/accu/stat/variance.hh,
+ * mln/accu/sum.hh,
+ * mln/accu/sup.hh,
+ * mln/accu/tuple.hh,
+ * mln/accu/volume.hh,
+ * mln/canvas/morpho/internal/find_root.hh,
+ * mln/convert/impl/from_image_to_site_set.hh,
+ * mln/core/alias/neighb1d.hh,
+ * mln/core/alias/neighb2d.hh,
+ * mln/core/alias/neighb3d.hh,
+ * mln/core/alias/window1d.hh,
+ * mln/core/alias/window2d.hh,
+ * mln/core/alias/window3d.hh,
+ * mln/core/concept/function.hh,
+ * mln/core/concept/object.hh,
+ * mln/core/concept/object_id.hh,
+ * mln/core/image/complex_image.hh,
+ * mln/core/image/decorated_image.hh,
+ * mln/core/image/edge_image.hh,
+ * mln/core/image/extended.hh,
+ * mln/core/image/extension_fun.hh,
+ * mln/core/image/extension_ima.hh,
+ * mln/core/image/extension_val.hh,
+ * mln/core/image/flat_image.hh,
+ * mln/core/image/fun_image.hh,
+ * mln/core/image/hexa.hh,
+ * mln/core/image/interpolated.hh,
+ * mln/core/image/lazy_image.hh,
+ * mln/core/image/plain.hh,
+ * mln/core/image/safe.hh,
+ * mln/core/image/slice_image.hh,
+ * mln/core/image/sub_image.hh,
+ * mln/core/image/sub_image_if.hh,
+ * mln/core/image/t_image.hh,
+ * mln/core/image/thru_morpher.hh,
+ * mln/core/image/thrubin_morpher.hh,
+ * mln/core/image/tr_image.hh,
+ * mln/core/image/unproject_image.hh,
+ * mln/core/image/vertex_image.hh,
+ * mln/core/image/violent_cast_image.hh,
+ * mln/core/site_set/box.hh,
+ * mln/core/site_set/p_array.hh,
+ * mln/core/site_set/p_centered.hh,
+ * mln/core/site_set/p_complex.hh,
+ * mln/core/site_set/p_edges.hh,
+ * mln/core/site_set/p_faces.hh,
+ * mln/core/site_set/p_if.hh,
+ * mln/core/site_set/p_image.hh,
+ * mln/core/site_set/p_key.hh,
+ * mln/core/site_set/p_line2d.hh,
+ * mln/core/site_set/p_mutable_array_of.hh,
+ * mln/core/site_set/p_priority.hh,
+ * mln/core/site_set/p_queue.hh,
+ * mln/core/site_set/p_queue_fast.hh,
+ * mln/core/site_set/p_run.hh,
+ * mln/core/site_set/p_set.hh,
+ * mln/core/site_set/p_vaccess.hh,
+ * mln/core/site_set/p_vertices.hh,
+ * mln/fun/i2v/all.hh,
+ * mln/fun/meta/inty.hh,
+ * mln/fun/meta/lum.hh,
+ * mln/pw/image.hh,
+ * mln/topo/is_n_face.hh,
+ * mln/util/array.hh,
+ * mln/util/couple.hh,
+ * mln/util/fibonacci_heap.hh,
+ * mln/util/graph.hh,
+ * mln/util/line_graph.hh,
+ * mln/util/ord_pair.hh,
+ * mln/util/set.hh,
+ * mln/util/site_pair.hh,
+ * mln/util/soft_heap.hh,
+ * mln/win/backdiag2d.hh,
+ * mln/win/ball.hh,
+ * mln/win/cube3d.hh,
+ * mln/win/cuboid3d.hh,
+ * mln/win/diag2d.hh,
+ * mln/win/disk2d.hh,
+ * mln/win/hline2d.hh,
+ * mln/win/line.hh,
+ * mln/win/multiple.hh,
+ * mln/win/multiple_size.hh,
+ * mln/win/octagon2d.hh,
+ * mln/win/rectangle2d.hh,
+ * mln/win/segment1d.hh,
+ * mln/win/shift.hh,
+ * mln/win/sphere3d.hh,
+ * mln/win/vline2d.hh: revamp doc and map types to doxygen modules.
+
+ * tests/transform/distance_and_closest_point_geodesic.cc,
+ * tests/util/soft_heap.cc: fix doxygen file tag.
+
+2009-04-29 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
Small fixes.
* mln/algebra/all.hh: fix comments.
diff --git a/milena/doc/Doxyfile.in b/milena/doc/Doxyfile.in
index 649ea2f..f088755 100644
--- a/milena/doc/Doxyfile.in
+++ b/milena/doc/Doxyfile.in
@@ -285,7 +285,8 @@ PREDEFINED = "mlc_unqualif(T)=typename mln::metal::unqualif<T>::ret"
"mln_gradient_component(I)=typename mln::trait::ch_value< I, mln::value::props< typename I::value >::sum >::ret" \
"mln_gradient(I)=mln::value::stack_image< I::point::dim, mln::trait::ch_value< I, mln::value::props< typename I::value >::sum >::ret >" \
"mln_trait_value_sum_product(T, U)=typename mln::trait::value_< mln_trait_op_times(T,U) >::sum" \
- "mln_sum_product(T, U)=typename mln::trait::value_< mln_trait_op_times(T,U) >::sum"
+ "mln_sum_product(T, U)=typename mln::trait::value_< mln_trait_op_times(T,U) >::sum" \
+ "mln_deduce(T, A1, A2)=typename T::A1::A2"
diff --git a/milena/doc/Makefile.am b/milena/doc/Makefile.am
index 14da88f..f1025b3 100644
--- a/milena/doc/Makefile.am
+++ b/milena/doc/Makefile.am
@@ -99,6 +99,7 @@ include $(srcdir)/outputs/outputs.mk
EXTRA_DIST += \
Doxyfile.in \
+groups \
user \
tools/sample_utils.hh \
tools/split_sample.sh \
diff --git a/milena/doc/examples/tuto3/first_routine.cc b/milena/doc/examples/tuto3/first_routine.cc
index a0eb870..b4d3b58 100644
--- a/milena/doc/examples/tuto3/first_routine.cc
+++ b/milena/doc/examples/tuto3/first_routine.cc
@@ -1,3 +1,5 @@
+/// \file doc/examples/first_routine.cc
+
#include <mln/essential/2d.hh>
#include <tests/data.hh>
#include <doc/tools/sample_utils.hh>
diff --git a/milena/doc/groups.hh b/milena/doc/groups.hh
deleted file mode 100644
index 30d9b6f..0000000
--- a/milena/doc/groups.hh
+++ /dev/null
@@ -1,28 +0,0 @@
-/*! \defgroup modimage Image types.
- *
- * All the generic image types provided in Olena.
- *
- */
-
-/*! \defgroup modimageconcrete Basic types.
- *
- * Concrete images.
- *
- * \ingroup modimage
- */
-
-/*! \defgroup modimagevaluemorpher Morpher on values.
- *
- * Morpher on image values.
- *
- * \ingroup modimage
- */
-
-/*! \defgroup modimagedomainmorpher Morpher on domain.
- *
- * Morpher on image domain.
- *
- * \ingroup modimage
- */
-
-
diff --git a/milena/doc/groups/accu.hh b/milena/doc/groups/accu.hh
new file mode 100644
index 0000000..bce4846
--- /dev/null
+++ b/milena/doc/groups/accu.hh
@@ -0,0 +1,29 @@
+/*! \defgroup modaccusiteset On site sets
+ *
+ * \brief Accumulators working on site sets.
+ *
+ * \ingroup modaccu
+ */
+
+/*! \defgroup modaccuimages On images
+ *
+ * \brief Accumulators working on images.
+ *
+ * \ingroup modaccu
+ */
+
+/*! \defgroup modaccuvalues On values
+ *
+ * \brief Accumulators working on image values.
+ *
+ * \ingroup modaccu
+ */
+
+/*! \defgroup modaccumulti Multiple accumulators
+ *
+ * \brief Set of special accumulators for computing several accumulators
+ * at the same time.
+ *
+ * \ingroup modaccu
+ */
+
diff --git a/milena/doc/groups/functions.hh b/milena/doc/groups/functions.hh
new file mode 100644
index 0000000..e5ce340
--- /dev/null
+++ b/milena/doc/groups/functions.hh
@@ -0,0 +1,7 @@
+/*! \defgroup modfunconcept Concepts
+ *
+ * \brief All function concepts.
+ *
+ * \ingroup modfun
+ */
+
diff --git a/milena/doc/groups/graph.hh b/milena/doc/groups/graph.hh
new file mode 100644
index 0000000..5b5040e
--- /dev/null
+++ b/milena/doc/groups/graph.hh
@@ -0,0 +1,7 @@
+/*! \defgroup modgraph Graphes
+ *
+ * \brief All graphes implementations.
+ *
+ * \ingroup modtypes
+ */
+
diff --git a/milena/doc/groups/images.hh b/milena/doc/groups/images.hh
new file mode 100644
index 0000000..c248cbb
--- /dev/null
+++ b/milena/doc/groups/images.hh
@@ -0,0 +1,36 @@
+/*! \defgroup modimage Images
+ *
+ * \brief All the generic image types provided in Olena.
+ *
+ * \ingroup modtypes
+ */
+
+/*! \defgroup modimageconcrete Basic types
+ *
+ * \brief Concrete images.
+ *
+ * \ingroup modimage
+ */
+
+/*! \defgroup modimagevaluemorpher Values morphers
+ *
+ * \brief Morpher on image values.
+ *
+ * \ingroup modimage
+ */
+
+/*! \defgroup modimagedomainmorpher Domain morphers
+ *
+ * \brief Morpher on image domain.
+ *
+ * \ingroup modimage
+ */
+
+/*! \defgroup modimageidmorpher Identity morphers
+ *
+ * \brief Morpher adding new functionnalities.
+ *
+ * \ingroup modimage
+ */
+
+
diff --git a/milena/doc/groups/main.hh b/milena/doc/groups/main.hh
new file mode 100644
index 0000000..80dc6a3
--- /dev/null
+++ b/milena/doc/groups/main.hh
@@ -0,0 +1,30 @@
+/*! \defgroup modtypes Types
+ *
+ * \brief Milena Object types.
+ *
+ */
+
+/*! \defgroup modaccu Accumulators
+ *
+ * \brief All accumulator types.
+ *
+ */
+
+/*! \defgroup modroutines Routines
+ *
+ * \brief All algorithms/routines provided in Milena.
+ *
+ */
+
+/*! \defgroup modcanvas Canvas
+ *
+ * \brief All canvas.
+ *
+ */
+
+/*! \defgroup modfun Functions
+ *
+ * \brief All predefined functions.
+ *
+ */
+
diff --git a/milena/doc/groups/neighb.hh b/milena/doc/groups/neighb.hh
new file mode 100644
index 0000000..ec9e07f
--- /dev/null
+++ b/milena/doc/groups/neighb.hh
@@ -0,0 +1,28 @@
+/*! \defgroup modneighb Neighborhoods
+ *
+ * \brief All the predefined generic neighborhoods.
+ *
+ * \ingroup modtypes
+ */
+
+/*! \defgroup modneighb1d 1D neighborhoods
+ *
+ * \brief Predefined 1D neighborhoods.
+ *
+ * \ingroup modneighb
+ */
+
+/*! \defgroup modneighb2d 2D neighborhoods
+ *
+ * \brief Predefined 2D neighborhoods.
+ *
+ * \ingroup modneighb
+ */
+
+/*! \defgroup modneighb3d 3D neighborhoods
+ *
+ * \brief Predefined 3D neighborhoods.
+ *
+ * \ingroup modneighb
+ */
+
diff --git a/milena/doc/groups/site_set.hh b/milena/doc/groups/site_set.hh
new file mode 100644
index 0000000..9589764
--- /dev/null
+++ b/milena/doc/groups/site_set.hh
@@ -0,0 +1,42 @@
+/*! \defgroup modsiteset Site sets
+ *
+ * \brief All Site set types.
+ *
+ * \ingroup modtypes
+ */
+
+/*! \defgroup modsitesetbasic Basic types
+ *
+ * \brief Basic site sets.
+ *
+ * \ingroup modsiteset
+ */
+
+/*! \defgroup modsitesetgraph Graph based
+ *
+ * \brief Site sets based on a graph.
+ *
+ * \ingroup modsiteset
+ */
+
+/*! \defgroup modsitesetcomplex Complex based
+ *
+ * \brief Site sets based on a complexes.
+ *
+ * \ingroup modsiteset
+ */
+
+/*! \defgroup modsitesetsparse Sparse types
+ *
+ * \brief Sparse site sets.
+ *
+ * \ingroup modsiteset
+ */
+
+/*! \defgroup modsitesetqueue Queue based
+ *
+ * \brief Site sets based on a queue.
+ *
+ * \ingroup modsiteset
+ */
+
diff --git a/milena/doc/groups/util.hh b/milena/doc/groups/util.hh
new file mode 100644
index 0000000..0a9c9af
--- /dev/null
+++ b/milena/doc/groups/util.hh
@@ -0,0 +1,8 @@
+/*! \defgroup modutil Utilities
+ *
+ * \brief Miscalleneous useful containers/structures.
+ *
+ * \ingroup modtypes
+ */
+
+
diff --git a/milena/doc/groups/win.hh b/milena/doc/groups/win.hh
new file mode 100644
index 0000000..a7e9431
--- /dev/null
+++ b/milena/doc/groups/win.hh
@@ -0,0 +1,42 @@
+/*! \defgroup modwin Windows
+ *
+ * \brief All the predefined generic windows.
+ *
+ * \ingroup modtypes
+ */
+
+/*! \defgroup modwin1d 1D windows
+ *
+ * \brief Predefined 1D windows.
+ *
+ * \ingroup modwin
+ */
+
+/*! \defgroup modwin2d 2D windows
+ *
+ * \brief Predefined 2D windows.
+ *
+ * \ingroup modwin
+ */
+
+/*! \defgroup modwin3d 3D windows
+ *
+ * \brief Predefined 3D windows.
+ *
+ * \ingroup modwin
+ */
+
+/*! \defgroup modwinnd N-D windows
+ *
+ * \brief Predefined N-D windows.
+ *
+ * \ingroup modwin
+ */
+
+/*! \defgroup modwinmulti Multiple windows
+ *
+ * \brief Generic multiple windows.
+ *
+ * \ingroup modwin
+ */
+
diff --git a/milena/mln/accu/bbox.hh b/milena/mln/accu/bbox.hh
index 1f8bfa5..35ecd4d 100644
--- a/milena/mln/accu/bbox.hh
+++ b/milena/mln/accu/bbox.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -44,10 +45,12 @@ namespace mln
{
- /// Generic bbox accumulator class.
+ /// \brief Generic bounding box accumulator class.
///
/// The parameter \c P is the type of points.
///
+ /// \ingroup modaccusiteset
+ //
template <typename P>
struct bbox : public mln::accu::internal::base< const box<P>& , bbox<P> >
{
diff --git a/milena/mln/accu/center.hh b/milena/mln/accu/center.hh
index 92e870e..6715dc6 100644
--- a/milena/mln/accu/center.hh
+++ b/milena/mln/accu/center.hh
@@ -45,11 +45,14 @@ namespace mln
{
- /// Generic center accumulator class.
+ /// \brief Mass center accumulator.
///
/// \tparam P the type of site.
/// \tparam V the type of vector to be used as result.
/// The default vector type is the one provided by P.
+ ///
+ /// \ingroup modaccusiteset
+ //
template <typename P, typename V = typename P::vec>
struct center
: public mln::accu::internal::base<V, center<P,V> >
diff --git a/milena/mln/accu/convolve.hh b/milena/mln/accu/convolve.hh
index 0769f1a..750454c 100644
--- a/milena/mln/accu/convolve.hh
+++ b/milena/mln/accu/convolve.hh
@@ -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 Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -44,11 +45,13 @@ namespace mln
{
- /// Generic convolution accumulator class.
+ /// \brief Generic convolution accumulator class.
///
/// Parameters \c T1 and \c T2 are the type of values to be
/// convolved. Parameter \c R is the result type.
///
+ /// \ingroup modaccuvalues
+ //
template <typename T1, typename T2,
typename R = mln_sum_product(T1, T2)>
struct convolve : public mln::accu::internal::base< R, convolve<T1,T2,R> >,
diff --git a/milena/mln/accu/count.hh b/milena/mln/accu/count.hh
index 9d68fec..dddc5f2 100644
--- a/milena/mln/accu/count.hh
+++ b/milena/mln/accu/count.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -43,8 +43,11 @@ namespace mln
namespace accu
{
- /// Generic counter accumulator class.
+ /// \brief Generic counter accumulator.
/// The parameter \a T is the type to be count.
+ ///
+ /// \ingroup modaccusiteset
+ //
template <typename T>
struct count : public mln::accu::internal::base< unsigned , count<T> >
{
diff --git a/milena/mln/accu/count_adjacent_vertices.hh b/milena/mln/accu/count_adjacent_vertices.hh
index 9d1f7b3..155ad56 100644
--- a/milena/mln/accu/count_adjacent_vertices.hh
+++ b/milena/mln/accu/count_adjacent_vertices.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,7 +45,7 @@ namespace mln
namespace accu
{
- /// Accumulator class counting the number of vertices
+ /// \brief Accumulator class counting the number of vertices
/// adjacent to a set of mln::p_edges_psite (i.e., a set of
/// edges).
///
@@ -54,6 +54,9 @@ namespace mln
///
/// This accumulator is used by mln::closing_area_on_vertices and
/// mln::opening_area_on_vertices.
+ ///
+ /// \ingroup modaccuimages
+ //
template <typename F, typename S>
struct count_adjacent_vertices
: public mln::accu::internal::base< unsigned,
diff --git a/milena/mln/accu/count_labels.hh b/milena/mln/accu/count_labels.hh
index 533e736..f6c6b3d 100644
--- a/milena/mln/accu/count_labels.hh
+++ b/milena/mln/accu/count_labels.hh
@@ -46,8 +46,11 @@ namespace mln
namespace accu
{
- /// Generic counter accumulator class.
+ /// \brief Count the number of different labels in an image.
/// The parameter \a L is the label type to be count.
+ ///
+ /// \ingroup modaccuvalues
+ //
template <typename L>
struct count_labels
: public mln::accu::internal::base< unsigned , count_labels<L> >,
diff --git a/milena/mln/accu/height.hh b/milena/mln/accu/height.hh
index 58f1569..6aca1a5 100644
--- a/milena/mln/accu/height.hh
+++ b/milena/mln/accu/height.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -30,6 +30,7 @@
# define MLN_ACCU_HEIGHT_HH
/// \file mln/accu/height.hh
+///
/// Define an accumulator that computes the height of a
/// component through one of its pixels.
/*
@@ -55,10 +56,13 @@ namespace mln
namespace accu
{
- /// Height accumulator class.
+ /// \brief Height accumulator.
///
/// The parameter \p I is the image type on which the accumulator
/// of pixels is built.
+ ///
+ /// \ingroup modaccuimages
+ //
template <typename I>
struct height
: public mln::accu::internal::base< unsigned , height<I> >
diff --git a/milena/mln/accu/histo.hh b/milena/mln/accu/histo.hh
index b66ed52..fbc3833 100644
--- a/milena/mln/accu/histo.hh
+++ b/milena/mln/accu/histo.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -52,9 +52,9 @@ namespace mln
{
+ /// \brief Generic histogram class over a value set with type \c V.
///
- /// Generic histogram class over a value set with type \c V.
- ///
+ /// \ingroup modaccuvalues
template <typename V>
struct histo :
public mln::accu::internal::base<const std::vector<unsigned>& ,
diff --git a/milena/mln/accu/inf.hh b/milena/mln/accu/inf.hh
index 0160069..a77c5aa 100644
--- a/milena/mln/accu/inf.hh
+++ b/milena/mln/accu/inf.hh
@@ -46,10 +46,12 @@ namespace mln
{
- /// Generic inf accumulator class.
- /*!
- * The parameter \c T is the type of values.
- */
+ /// \brief Generic inf accumulator class.
+ ///
+ /// The parameter \c T is the type of values.
+ ///
+ /// \ingroup modaccuvalues
+ //
template <typename T>
struct inf : public mln::accu::internal::base< const T&, inf<T> >
{
diff --git a/milena/mln/accu/internal/couple.hh b/milena/mln/accu/internal/couple.hh
index d4678a6..86db654 100644
--- a/milena/mln/accu/internal/couple.hh
+++ b/milena/mln/accu/internal/couple.hh
@@ -29,7 +29,7 @@
#ifndef MLN_ACCU_INTERNAL_COUPLE_HH
# define MLN_ACCU_INTERNAL_COUPLE_HH
-/// \file mln/accu/couple.hh
+/// \file mln/accu/internal/couple.hh
///
/// Base implementation of a couple of accumulators.
diff --git a/milena/mln/accu/label_used.hh b/milena/mln/accu/label_used.hh
index fe3553f..d268512 100644
--- a/milena/mln/accu/label_used.hh
+++ b/milena/mln/accu/label_used.hh
@@ -45,8 +45,11 @@ namespace mln
namespace accu
{
- /// Define an accumulator that references all the labels used.
+ /// \brief References all the labels used.
/// The parameter \a L is the label type.
+ ///
+ /// \ingroup modaccuvalues
+ //
template <typename L>
struct label_used : public mln::accu::internal::base< const fun::i2v::array<bool>& , label_used<L> >
{
diff --git a/milena/mln/accu/land.hh b/milena/mln/accu/land.hh
index 5a579a1..37161db 100644
--- a/milena/mln/accu/land.hh
+++ b/milena/mln/accu/land.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,7 +45,10 @@ namespace mln
namespace accu
{
- /// "Logical-and" accumulator class.
+ /// \brief "Logical-and" accumulator.
+ ///
+ /// \ingroup modaccuvalues
+ //
struct land : public mln::accu::internal::base< bool, land >
{
typedef bool argument;
diff --git a/milena/mln/accu/land_basic.hh b/milena/mln/accu/land_basic.hh
index 1c5f700..416a78f 100644
--- a/milena/mln/accu/land_basic.hh
+++ b/milena/mln/accu/land_basic.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,9 +45,12 @@ namespace mln
namespace accu
{
- /// "Logical-and" accumulator class. Conversely to accu::land,
- /// this version does not have the 'untake' method but features
- /// the 'can_stop' method.
+ /// \brief "Logical-and" accumulator.
+ /// Conversely to accu::land, this version does not have the 'untake'
+ /// method but features the 'can_stop' method.
+ ///
+ /// \ingroup modaccuvalues
+ //
struct land_basic : public mln::accu::internal::base< bool, land_basic >
{
typedef bool argument;
diff --git a/milena/mln/accu/line.hh b/milena/mln/accu/line.hh
index c8a440e..b4f30a7 100644
--- a/milena/mln/accu/line.hh
+++ b/milena/mln/accu/line.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -60,7 +60,6 @@ namespace mln
* accu::take(\p input, tmp) \n
* return tmp.to_result() \n
*/
-
template <typename Meta_Accu, unsigned Dir, // Free parameters.
typename I, typename O>
void
diff --git a/milena/mln/accu/lor.hh b/milena/mln/accu/lor.hh
index 2e49d75..8741e44 100644
--- a/milena/mln/accu/lor.hh
+++ b/milena/mln/accu/lor.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,7 +45,10 @@ namespace mln
namespace accu
{
- /// "Logical-or" accumulator class.
+ /// \brief "Logical-or" accumulator.
+ ///
+ /// \ingroup modaccuvalues
+ //
struct lor : public mln::accu::internal::base< bool, lor >
{
typedef bool argument;
diff --git a/milena/mln/accu/lor_basic.hh b/milena/mln/accu/lor_basic.hh
index 3dedacc..9a10f7c 100644
--- a/milena/mln/accu/lor_basic.hh
+++ b/milena/mln/accu/lor_basic.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,9 +45,12 @@ namespace mln
namespace accu
{
- /// "Logical-or" accumulator class. Conversely to accu::lor,
- /// this version does not have the 'untake' method but features
- /// the 'can_stop' method.
+ /// \brief "Logical-or" accumulator class.
+ /// Conversely to accu::lor, this version does not have the 'untake'
+ /// method but features the 'can_stop' method.
+ ///
+ /// \ingroup modaccuvalues
+ //
struct lor_basic : public mln::accu::internal::base< bool, lor_basic >
{
typedef bool argument;
diff --git a/milena/mln/accu/maj_h.hh b/milena/mln/accu/maj_h.hh
index 7d851bb..88e876d 100644
--- a/milena/mln/accu/maj_h.hh
+++ b/milena/mln/accu/maj_h.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -48,9 +49,12 @@ namespace mln
{
- /// Generic maj_h accumulator class.
+ /// \brief Compute the majority value.
/*!
+ * It is based on a histogram.
* The parameter \c T is the type of values.
+ *
+ * \ingroup modaccuvalues
*/
template <typename T>
struct maj_h : public mln::accu::internal::base< const T& , maj_h<T> >
diff --git a/milena/mln/accu/max.hh b/milena/mln/accu/max.hh
index 72cc698..dec02df 100644
--- a/milena/mln/accu/max.hh
+++ b/milena/mln/accu/max.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,9 +46,11 @@ namespace mln
{
- /// Generic max accumulator class.
+ /// \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> >
{
diff --git a/milena/mln/accu/max_h.hh b/milena/mln/accu/max_h.hh
index 20be166..f639eac 100644
--- a/milena/mln/accu/max_h.hh
+++ b/milena/mln/accu/max_h.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -44,8 +45,11 @@ namespace mln
{
- /// Generic max function based on histogram over a value set with
+ /// \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> >
{
diff --git a/milena/mln/accu/mean.hh b/milena/mln/accu/mean.hh
index 6ef643d..129b042 100644
--- a/milena/mln/accu/mean.hh
+++ b/milena/mln/accu/mean.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -47,13 +47,15 @@ namespace mln
{
- /// Generic mean accumulator class.
+ /// \brief Generic mean accumulator class.
/*!
* Parameter \c T is the type of values that we sum. Parameter \c
* S is the type to store the sum of values; the default type of
* \c S is the summation type (property) of \c T. Parameter \c M
* is the type of the mean value; the default type of \c M is \c
* S.
+ *
+ * \ingroup modaccuvalues
*/
template <typename T,
typename S = mln_sum(T),
diff --git a/milena/mln/accu/median_alt.hh b/milena/mln/accu/median_alt.hh
index 7815c95..2a1719c 100644
--- a/milena/mln/accu/median_alt.hh
+++ b/milena/mln/accu/median_alt.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -43,8 +44,11 @@ namespace mln
{
- /// Generic median_alt function based on histogram over a
+ /// \brief Generic median_alt function based on histogram over a
/// value set with type \c S.
+ ///
+ /// \ingroup modaccuvalues
+ //
template <typename S>
struct median_alt : public mln::accu::internal::base< const mln_value(S)&, median_alt<S> >
{
diff --git a/milena/mln/accu/median_h.hh b/milena/mln/accu/median_h.hh
index 9c368f8..2de9bc6 100644
--- a/milena/mln/accu/median_h.hh
+++ b/milena/mln/accu/median_h.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,8 +45,10 @@ namespace mln
{
- /// Generic median function based on histogram over a value
+ /// \brief Generic median function based on histogram over a value
/// set with type \c V.
+ ///
+ /// \ingroup modaccuvalues
template <typename V>
struct median_h : public mln::accu::internal::base< const V&, median_h<V> >
{
diff --git a/milena/mln/accu/min.hh b/milena/mln/accu/min.hh
index 023b480..8291ef5 100644
--- a/milena/mln/accu/min.hh
+++ b/milena/mln/accu/min.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -46,9 +46,11 @@ namespace mln
{
- /// Generic min accumulator class.
+ /// \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> >
diff --git a/milena/mln/accu/min_h.hh b/milena/mln/accu/min_h.hh
index b18f4ba..d538e6a 100644
--- a/milena/mln/accu/min_h.hh
+++ b/milena/mln/accu/min_h.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,8 +46,11 @@ namespace mln
{
- /// Generic min function based on histogram over a value
+ /// \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> >
{
diff --git a/milena/mln/accu/min_max.hh b/milena/mln/accu/min_max.hh
index 6f90560..f62716f 100644
--- a/milena/mln/accu/min_max.hh
+++ b/milena/mln/accu/min_max.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -49,9 +50,11 @@ namespace mln
namespace accu
{
- /// Generic min and max accumulator class.
+ /// \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> >
diff --git a/milena/mln/accu/pair.hh b/milena/mln/accu/pair.hh
index 41b1fe3..c9e7f08 100644
--- a/milena/mln/accu/pair.hh
+++ b/milena/mln/accu/pair.hh
@@ -49,11 +49,14 @@ namespace mln
{
- /// Generic pair of accumulators.
+ /// \brief Generic pair of accumulators.
///
/// The parameter \c T is the type of values.
///
/// \todo Check that, when T is not provided, A1 and A2 have the same value.
+ ///
+ /// \ingroup modaccumulti
+ //
template <typename A1, typename A2, typename T = mln_argument(A1)>
struct pair : public mln::accu::internal::base< std::pair<mln_result(A1), mln_result(A2)>,
pair<A1,A2,T> >
diff --git a/milena/mln/accu/rank.hh b/milena/mln/accu/rank.hh
index bd1999d..6b891c5 100644
--- a/milena/mln/accu/rank.hh
+++ b/milena/mln/accu/rank.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -50,9 +51,11 @@ namespace mln
{
- /// Generic rank accumulator class.
+ /// \brief Generic rank accumulator class.
///
/// The parameter \c T is the type of values.
+ ///
+ /// \ingroup modaccuvalues
template <typename T>
struct rank : public mln::accu::internal::base< const T&, rank<T> >
{
diff --git a/milena/mln/accu/rank_bool.hh b/milena/mln/accu/rank_bool.hh
index 54c06ba..fb3c944 100644
--- a/milena/mln/accu/rank_bool.hh
+++ b/milena/mln/accu/rank_bool.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -47,10 +47,13 @@ namespace mln
namespace accu
{
- // Fwd declaration.
+ // Forward declaration.
template <typename T> struct rank;
- /// rank accumulator class for Boolean.
+ /// \brief rank accumulator class for Boolean.
+ ///
+ /// \ingroup modaccuvalues
+ //
template <>
struct rank<bool> : public mln::accu::internal::base< bool, rank<bool> >
{
diff --git a/milena/mln/accu/rank_high_quant.hh b/milena/mln/accu/rank_high_quant.hh
index c05c6d4..80d5b23 100644
--- a/milena/mln/accu/rank_high_quant.hh
+++ b/milena/mln/accu/rank_high_quant.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -47,9 +47,11 @@ namespace mln
{
- /// Generic rank accumulator class.
+ /// \brief Generic rank accumulator class.
/*!
* The parameter \c T is the type of values.
+ *
+ * \ingroup modaccuvalues
*/
template <typename T>
struct rank : public mln::accu::internal::base< const T&, rank<T> >
diff --git a/milena/mln/accu/rms.hh b/milena/mln/accu/rms.hh
index 866ded1..8022ddc 100644
--- a/milena/mln/accu/rms.hh
+++ b/milena/mln/accu/rms.hh
@@ -44,10 +44,12 @@ namespace mln
{
- /// Generic rms accumulator class.
+ /// \brief Generic root mean square accumulator class.
///
/// The parameter \c T is the type of the root mean square value.
///
+ /// \ingroup modaccuvalues
+ //
template <typename T, typename V>
struct rms : public mln::accu::internal::base<V, rms<T,V> >
{
diff --git a/milena/mln/accu/site_set/rectangularity.hh b/milena/mln/accu/site_set/rectangularity.hh
index fef5b21..f0ced2c 100644
--- a/milena/mln/accu/site_set/rectangularity.hh
+++ b/milena/mln/accu/site_set/rectangularity.hh
@@ -47,7 +47,10 @@ namespace mln
namespace site_set
{
- /// Compute the rectangularity of a site set.
+ /// \brief Compute the rectangularity of a site set.
+ ///
+ /// \ingroup modaccusiteset
+ //
template <typename P>
class rectangularity
: public accu::internal::couple<accu::bbox<P>,
diff --git a/milena/mln/accu/stat/deviation.hh b/milena/mln/accu/stat/deviation.hh
index 890a93c..32277b1 100644
--- a/milena/mln/accu/stat/deviation.hh
+++ b/milena/mln/accu/stat/deviation.hh
@@ -49,13 +49,15 @@ namespace mln
namespace stat
{
- /// Generic standard deviation accumulator class.
+ /// \brief Generic standard deviation accumulator class.
/*!
* Parameter \c T is the type of values that we sum. Parameter \c
* S is the type to store the standard deviation; the default type of
* \c S is the summation type (property) of \c T. Parameter \c M
* is the type of the mean value; the default type of \c M is \c
* S.
+ *
+ * \ingroup modaccuvalues
*/
template <typename T,
typename S = mln_sum(T),
diff --git a/milena/mln/accu/stat/variance.hh b/milena/mln/accu/stat/variance.hh
index 0b4dc0b..388de2a 100644
--- a/milena/mln/accu/stat/variance.hh
+++ b/milena/mln/accu/stat/variance.hh
@@ -46,13 +46,16 @@ namespace mln
namespace stat
{
- /// Variance accumulator class.
+ /// \brief Variance accumulator class.
/*!
* Parameter \c T is the type of values that we sum. Parameter
* \c S is the type to store the value sum and the sum of value
* * value; the default type of \c S is the summation type
* (property) of \c T. Parameter \c R is the type of the mean
* and variance values; the default type of \c R is \c S.
+ *
+ * \ingroup modaccuvalues
+ *
*/
template <typename T,
typename S = mln_sum(T),
diff --git a/milena/mln/accu/sum.hh b/milena/mln/accu/sum.hh
index a0f11d9..2792438 100644
--- a/milena/mln/accu/sum.hh
+++ b/milena/mln/accu/sum.hh
@@ -50,11 +50,13 @@ namespace mln
{
- /// Generic sum accumulator class.
+ /// \brief Generic sum accumulator class.
/*!
* Parameter \c T is the type of values that we sum. Parameter \c
* S is the type to store the value sum; the default type of
* \c S is the summation type (property) of \c T.
+ *
+ * \ingroup modaccuvalues
*/
template <typename T, typename S = mln_sum(T)>
struct sum : public mln::accu::internal::base< const S&, sum<T,S> >
diff --git a/milena/mln/accu/sup.hh b/milena/mln/accu/sup.hh
index ded89e1..e16fcf6 100644
--- a/milena/mln/accu/sup.hh
+++ b/milena/mln/accu/sup.hh
@@ -46,9 +46,11 @@ namespace mln
{
- /// Generic sup accumulator class.
+ /// \brief Generic sup accumulator class.
/*!
* The parameter \c T is the type of values.
+ *
+ * \ingroup modaccuvalues
*/
template <typename T>
struct sup : public mln::accu::internal::base< const T&, sup<T> >
diff --git a/milena/mln/accu/tuple.hh b/milena/mln/accu/tuple.hh
index ae59bbc..f3befb5 100644
--- a/milena/mln/accu/tuple.hh
+++ b/milena/mln/accu/tuple.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
@@ -66,9 +66,11 @@ namespace mln
template <unsigned n, typename T> struct tuplehelper;
}
- /// Generic tuple of accumulators.
+ /// \brief Generic tuple of accumulators.
/*!
* The parameter \c T is the type of values.
+ *
+ * \ingroup modaccumulti
*/
template <typename A, unsigned n, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(10, typename T, boost::tuples::null_type)>
struct tuple
diff --git a/milena/mln/accu/volume.hh b/milena/mln/accu/volume.hh
index 5d25767..f60ee6b 100644
--- a/milena/mln/accu/volume.hh
+++ b/milena/mln/accu/volume.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -55,10 +55,12 @@ namespace mln
namespace accu
{
- /// Volume accumulator class.
+ /// \brief Volume accumulator class.
///
/// The parameter \p I is the image type on which the accumulator
/// of pixels is built.
+ ///
+ /// \ingroup modaccuimages
template <typename I>
struct volume
: public mln::accu::internal::base< unsigned , volume<I> >
diff --git a/milena/mln/canvas/morpho/internal/find_root.hh b/milena/mln/canvas/morpho/internal/find_root.hh
index 958ac9c..a1ff6bb 100644
--- a/milena/mln/canvas/morpho/internal/find_root.hh
+++ b/milena/mln/canvas/morpho/internal/find_root.hh
@@ -28,7 +28,7 @@
#ifndef MLN_CANVAS_MORPHO_INTERNAL_FIND_ROOT_HH
# define MLN_CANVAS_MORPHO_INTERNAL_FIND_ROOT_HH
-/// \file mln/canvas/morpho/internal/find_root.hh.hh
+/// \file mln/canvas/morpho/internal/find_root.hh
///
/// Routines to handle parent image.
///
diff --git a/milena/mln/convert/impl/from_image_to_site_set.hh b/milena/mln/convert/impl/from_image_to_site_set.hh
index 2e79f7e..eb9a1a2 100644
--- a/milena/mln/convert/impl/from_image_to_site_set.hh
+++ b/milena/mln/convert/impl/from_image_to_site_set.hh
@@ -149,7 +149,7 @@ namespace mln
void
from_image_to_site_set(const Image<I>& from, Site_Set<S>& to)
{
- from_image_to_site_set(exact(from), mln_deduce(I, pset, element)(),
+ from_image_to_site_set(exact(from), mln_deduce(I, domain_t, element)(),
exact(to), mln_i_element(S)());
}
diff --git a/milena/mln/core/alias/neighb1d.hh b/milena/mln/core/alias/neighb1d.hh
index 8c93466..3c32a21 100644
--- a/milena/mln/core/alias/neighb1d.hh
+++ b/milena/mln/core/alias/neighb1d.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,11 +29,10 @@
#ifndef MLN_CORE_ALIAS_NEIGHB1D_HH
# define MLN_CORE_ALIAS_NEIGHB1D_HH
-/*! \file mln/core/alias/neighb1d.hh
- *
- * \brief Definition of the mln::neighb1d alias and of some classical
- * 1D neighborhoods.
- */
+/// \file mln/core/alias/neighb1d.hh
+///
+/// Definition of the mln::neighb1d alias and of some classical
+/// 1D neighborhoods.
# include <cmath>
# include <mln/core/neighb.hh>
@@ -42,18 +42,25 @@
namespace mln
{
- /*! \brief Type alias for a neighborhood defined on the 1D square
- * grid with integer coordinates.
- */
+ /// \brief Type alias for a neighborhood defined on the 1D square
+ /// grid with integer coordinates.
+ ///
+ /// \ingroup modneighb1d
+ //
typedef neighb<window1d> neighb1d;
- /*! \brief 2-connectivity neighborhood on the 1D grid.
- *
- * o x o
- *
- * \return A neighb1d.
- */
+ /// \brief 2-connectivity neighborhood on the 1D grid.
+ /*!
+ \verbatim
+ o x o
+ \endverbatim
+
+
+ \return A neighb1d.
+
+ \ingroup modneighb1d
+ */
const neighb1d& c2();
diff --git a/milena/mln/core/alias/neighb2d.hh b/milena/mln/core/alias/neighb2d.hh
index 09a6db2..704d7cc 100644
--- a/milena/mln/core/alias/neighb2d.hh
+++ b/milena/mln/core/alias/neighb2d.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -48,6 +49,7 @@ namespace mln
/// Type alias for a neighborhood defined on the 2D square
/// grid with integer coordinates.
///
+ /// \ingroup modneighb2d
typedef neighb<window2d> neighb2d;
}
@@ -56,47 +58,66 @@ namespace mln
namespace mln
{
- /// 4-connectivity neighborhood on the 2D grid.
- ///
- /// - o -
- /// o x o
- /// - o -
- ///
- /// \return A neighb2d.
- ///
+ /// \brief 4-connectivity neighborhood on the 2D grid.
+ /*!
+ \verbatim
+ - o -
+ o x o
+ - o -
+ \endverbatim
+
+
+ \return A neighb2d.
+
+ \ingroup modneighb2d
+ */
const neighb2d& c4();
- /// 8-connectivity neighborhood on the 2D grid.
- ///
- /// o o o
- /// o x o
- /// o o o
- ///
- /// \return A neighb2d.
- ///
+ /// \brief 8-connectivity neighborhood on the 2D grid.
+ /*!
+ \verbatim
+ o o o
+ o x o
+ o o o
+ \endverbatim
+
+
+ \return A neighb2d.
+
+ \ingroup modneighb2d
+ */
const neighb2d& c8();
- /// Horizontal 2-connectivity neighborhood on the 2D grid.
- ///
- /// - - -
- /// o x o
- /// - - -
- ///
- /// \return A neighb2d.
- ///
+ /// \brief Horizontal 2-connectivity neighborhood on the 2D grid.
+ /*!
+ \verbatim
+ - - -
+ o x o
+ - - -
+ \endverbatim
+
+ \return A neighb2d.
+
+ \ingroup modneighb2d
+ */
const neighb2d& c2_row();
- /// Vertical 2-connectivity neighborhood on the 2D grid.
- ///
- /// - o -
- /// - x -
- /// - o -
- ///
- /// \return A neighb2d.
- ///
+ /// \brief Vertical 2-connectivity neighborhood on the 2D grid.
+ /*!
+ \verbatim
+ - o -
+ - x -
+ - o -
+ \endverbatim
+
+
+ \return A neighb2d.
+
+ \ingroup modneighb2d
+ */
const neighb2d& c2_col();
diff --git a/milena/mln/core/alias/neighb3d.hh b/milena/mln/core/alias/neighb3d.hh
index ad0545d..c7f4116 100644
--- a/milena/mln/core/alias/neighb3d.hh
+++ b/milena/mln/core/alias/neighb3d.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,100 +45,137 @@
namespace mln
{
- /*! \brief Type alias for a neighborhood defined on the 3D square
- * grid with integer coordinates.
- */
+ /// \brief Type alias for a neighborhood defined on the 3D square
+ /// grid with integer coordinates.
+ ///
+ /// \ingroup modneighb3d
+ //
typedef neighb<window3d> neighb3d;
- /// 4-connectivity neighborhood on the 3D grid.
- ///
- /// . . .
- /// . . .
- /// . . .
- ///
- /// . o .
- /// o x o
- /// . o .
- ///
- /// . . .
- /// . . .
- /// . . .
- ///
- /// \return A neighb3d.
- ///
+ /// \brief 4-connectivity neighborhood on the 3D grid.
+ /*!
+ \verbatim
+
+ . . .
+ . . .
+ . . .
+
+ . o .
+ o x o
+ . o .
+
+ . . .
+ . . .
+ . . .
+
+ \endverbatim
+
+
+ \return A neighb3d.
+
+ \ingroup modneighb3d
+ */
const neighb3d& c4_3d();
- /// 8-connectivity neighborhood on the 3D grid.
- ///
- /// . . .
- /// . . .
- /// . . .
- ///
- /// o o o
- /// o x o
- /// o o o
- ///
- /// . . .
- /// . . .
- /// . . .
- ///
- /// \return A neighb3d.
- ///
+ /// \brief 8-connectivity neighborhood on the 3D grid.
+ /*!
+ \verbatim
+
+ . . .
+ . . .
+ . . .
+
+ o o o
+ o x o
+ o o o
+
+ . . .
+ . . .
+ . . .
+
+ \endverbatim
+
+
+ \return A neighb3d.
+
+ \ingroup modneighb3d
+ */
const neighb3d& c8_3d();
- /*! \brief 6-connectivity neighborhood on the 3D grid.
- *
- * . . .
- * . o .
- * . . .
- *
- * . o .
- * o x o
- * . o .
- *
- * . . .
- * . o .
- * . . .
- *
- * \return A neighb3d.
- */
+ /// \brief 6-connectivity neighborhood on the 3D grid.
+ /*!
+ \verbatim
+
+ . . .
+ . o .
+ . . .
+
+ . o .
+ o x o
+ . o .
+
+ . . .
+ . o .
+ . . .
+
+ \endverbatim
+
+
+ \return A neighb3d.
+
+ \ingroup modneighb3d
+ */
const neighb3d& c6();
- /*! \brief 18-connectivity neighborhood on the 3D grid.
- *
- * . o .
- * o o o
- * . o .
- *
- * o o o
- * o x o
- * o o o
- *
- * . o .
- * o o o
- * . o .
- *
- * \return A neighb3d.
- */
+ /// \brief 18-connectivity neighborhood on the 3D grid.
+ /*!
+ \verbatim
+
+ . o .
+ o o o
+ . o .
+
+ o o o
+ o x o
+ o o o
+
+ . o .
+ o o o
+ . o .
+
+ \endverbatim
+
+
+ \return A neighb3d.
+
+ \ingroup modneighb3d
+ */
const neighb3d& c18();
- /*! \brief 26-connectivity neighborhood on the 3D grid.
- *
- * o o o
- * o o o
- * o o o
- *
- * o o o
- * o x o
- * o o o
- *
- * o o o
- * o o o
- * o o o
- *
- * \return A neighb3d.
- */
+ /// \brief 26-connectivity neighborhood on the 3D grid.
+ /*!
+ \verbatim
+
+ o o o
+ o o o
+ o o o
+
+ o o o
+ o x o
+ o o o
+
+ o o o
+ o o o
+ o o o
+
+ \endverbatim
+
+
+ \return A neighb3d.
+
+ \ingroup modneighb3d
+ */
const neighb3d& c26();
diff --git a/milena/mln/core/alias/window1d.hh b/milena/mln/core/alias/window1d.hh
index eee53cc..178dc19 100644
--- a/milena/mln/core/alias/window1d.hh
+++ b/milena/mln/core/alias/window1d.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -30,7 +30,8 @@
# define MLN_CORE_ALIAS_WINDOW1D_HH
/// \file mln/core/alias/window1d.hh
-/// \brief Definition of the mln::window1d alias and of a construction
+///
+/// Definition of the mln::window1d alias and of a construction
/// routine.
# include <mln/core/window.hh>
@@ -43,6 +44,9 @@ namespace mln
/// \brief Type alias for a window with arbitrary shape, defined on
/// the 1D square grid with integer coordinates.
+ ///
+ /// \ingroup modwin1d
+ //
typedef window<mln::dpoint1d> window1d;
diff --git a/milena/mln/core/alias/window2d.hh b/milena/mln/core/alias/window2d.hh
index f1acabe..e1479d4 100644
--- a/milena/mln/core/alias/window2d.hh
+++ b/milena/mln/core/alias/window2d.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,8 +33,6 @@
///
/// Definition of the mln::window2d alias and of a construction
/// routine.
-///
-/// \todo c8p etc.
# include <mln/core/window.hh>
# include <mln/core/alias/dpoint2d.hh>
@@ -47,26 +45,41 @@ namespace mln
/// \brief Type alias for a window with arbitrary shape, defined on
/// the 2D square grid with integer coordinates.
+ ///
+ /// \ingroup modwin2d
+ //
typedef window<mln::dpoint2d> window2d;
/// \brief 4-connectivity window on the 2D grid, including the
/// center.
- ///
- /// - o -
- /// o x o
- /// - o -
- ///
- /// \return A window2d.
+ /*!
+ \verbatim
+ - o -
+ o x o
+ - o -
+ \endverbatim
+
+
+ \return A window2d.
+
+ \ingroup modwin2d
+ */
const window2d& win_c4p();
/// \brief 8-connectivity window on the 2D grid, including the
/// center.
- ///
- /// o o o
- /// o x o
- /// o o o
- ///
- /// \return A window2d.
+ /*!
+ \verbatim
+ o o o
+ o x o
+ o o o
+ \endverbatim
+
+
+ \return A window2d.
+
+ \ingroup modwin2d
+ */
const window2d& win_c8p();
diff --git a/milena/mln/core/alias/window3d.hh b/milena/mln/core/alias/window3d.hh
index 5489fbd..1b5d57b 100644
--- a/milena/mln/core/alias/window3d.hh
+++ b/milena/mln/core/alias/window3d.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -43,45 +43,60 @@
namespace mln
{
- /// Type alias for a window with arbitrary shape, defined on
+ /// \brief Type alias for a window with arbitrary shape, defined on
/// the 3D square grid with integer coordinates.
+ ///
+ /// \ingroup modwin3d
+ //
typedef window<mln::dpoint3d> window3d;
/// \brief 4-connectivity window on the 3D grid, including the
/// center.
- ///
- /// - - -
- /// - - -
- /// - - -
- ///
- /// - o -
- /// o x o
- /// - o -
- ///
- /// - - -
- /// - - -
- /// - - -
- ///
- ///
- /// \return A window3d.
+ /*!
+ \verbatim
+
+ - - -
+ - - -
+ - - -
+
+ - o -
+ o x o
+ - o -
+
+ - - -
+ - - -
+ - - -
+ \endverbatim
+
+
+ \return A window3d.
+
+ \ingroup modwin3d
+ */
const window3d& win_c4p_3d();
/// \brief 8-connectivity window on the 3D grid, including the
/// center.
- ///
- /// - - -
- /// - - -
- /// - - -
- ///
- /// o o o
- /// o x o
- /// o o o
- ///
- /// - - -
- /// - - -
- /// - - -
- ///
- /// \return A window3d.
+ /*!
+ \verbatim
+ - - -
+ - - -
+ - - -
+
+ o o o
+ o x o
+ o o o
+
+ - - -
+ - - -
+ - - -
+ \endverbatim
+
+
+ \return A window3d.
+
+ \ingroup modwin3d
+ */
const window3d& win_c8p_3d();
diff --git a/milena/mln/core/concept/function.hh b/milena/mln/core/concept/function.hh
index 7cef23c..95742c5 100644
--- a/milena/mln/core/concept/function.hh
+++ b/milena/mln/core/concept/function.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -51,8 +51,6 @@ namespace mln
template <typename E> struct Function_p2b;
template <typename E> struct Function_p2p;
template <typename E> struct Function_x2x;
- template <typename E> struct Function_l2b;
- template <typename E> struct Function_l2l;
template <typename E> struct Function_vv2v;
template <typename E> struct Function_vv2b;
@@ -92,11 +90,13 @@ namespace mln
template <>
struct Function_v2v<void> { typedef Function<void> super; };
- /// Base class for implementation of function-objects from
+ /// \brief Base class for implementation of function-objects from
/// value to value.
///
/// The parameter \a E is the exact type.
///
+ /// \ingroup modfun
+ //
template <typename E>
struct Function_v2v : public Function<E>
{
@@ -122,8 +122,9 @@ namespace mln
* value V to value W and vice versa.
*
* The parameter \a E is the exact type.
+ *
+ * \ingroup modfun
*/
-
template <typename E>
struct Function_v2w2v : public Function<E>
{
@@ -158,8 +159,9 @@ namespace mln
*
* eg: f : x -> norm(x)
* f_1: (x, n) -> x' := x / norm(x) * n
+ *
+ * \ingroup modfun
*/
-
template <typename E>
struct Function_v2w_w2v : public Function<E>
{
@@ -188,6 +190,8 @@ namespace mln
///
/// The parameter \a E is the exact type.
///
+ /// \ingroup modfun
+ //
template <typename E>
struct Function_i2b : public Function_v2b<E>
{
@@ -211,6 +215,8 @@ namespace mln
///
/// The parameter \a E is the exact type.
///
+ /// \ingroup modfun
+ //
template <typename E>
struct Function_i2v : public Function_v2v<E>
{
@@ -233,6 +239,8 @@ namespace mln
///
/// The parameter \a E is the exact type.
///
+ /// \ingroup modfun
+ //
template <typename E>
struct Function_p2v : public virtual Function_v2v<E>
{
@@ -255,6 +263,8 @@ namespace mln
///
/// The parameter \a E is the exact type.
///
+ /// \ingroup modfun
+ //
template <typename E>
struct Function_v2b : public virtual Function_v2v<E>
{
@@ -278,6 +288,8 @@ namespace mln
///
/// The parameter \a E is the exact type.
///
+ /// \ingroup modfun
+ //
template <typename E>
struct Function_p2b : public Function_p2v<E>,
public Function_v2b<E>
@@ -302,6 +314,8 @@ namespace mln
///
/// The parameter \a E is the exact type.
///
+ /// \ingroup modfun
+ //
template <typename E>
struct Function_p2p : public Function_p2v<E>
{
@@ -324,6 +338,8 @@ namespace mln
///
/// The parameter \a E is the exact type.
///
+ /// \ingroup modfun
+ //
template <typename E>
struct Function_x2x : public Function_v2v<E>
{
@@ -343,6 +359,8 @@ namespace mln
///
/// The parameter \a E is the exact type.
///
+ /// \ingroup modfun
+ //
template <typename E>
struct Bijection_x2x : public Function_x2x< E >
{
@@ -355,50 +373,6 @@ namespace mln
};
- /*-----------------.
- | Label -> Value. |
- `-----------------*/
-
- template <>
- struct Function_l2b<void> { typedef Function_v2b<void> super; };
-
- /// Base class for implementation of function-objects from
- /// label to value.
- ///
- /// The parameter \a E is the exact type.
- ///
- template <typename E>
- struct Function_l2b : public Function_v2b<E>
- {
- typedef Function_l2b<void> category;
- protected:
- Function_l2b();
- Function_l2b(const Function_l2b&);
- };
-
-
- /*-----------------.
- | Label -> Label. |
- `-----------------*/
-
- template <>
- struct Function_l2l<void> { typedef Function_v2v<void> super; };
-
- /// Base class for implementation of function-objects from
- /// label to value.
- ///
- /// The parameter \a E is the exact type.
- ///
- template <typename E>
- struct Function_l2l : public Function_v2v<E>
- {
- typedef Function_l2l<void> category;
- protected:
- Function_l2l();
- Function_l2l(const Function_l2l&);
- };
-
-
/*------------------------.
| Value, Value -> Value. |
`------------------------*/
@@ -411,6 +385,8 @@ namespace mln
///
/// The parameter \a E is the exact type.
///
+ /// \ingroup modfun
+ //
template <typename E>
struct Function_vv2v : public Function<E>
{
@@ -432,6 +408,8 @@ namespace mln
///
/// The parameter \a E is the exact type.
///
+ /// \ingroup modfun
+ //
template <typename E>
struct Function_vv2b : public Function<E>
{
@@ -605,33 +583,6 @@ namespace mln
template <typename E>
inline
- Function_l2b<E>::Function_l2b()
- {
- }
-
- template <typename E>
- inline
- Function_l2b<E>::Function_l2b(const Function_l2b<E>& rhs)
- : Function_v2v<E>(rhs),
- Function_v2b<E>(rhs)
- {
- }
-
- template <typename E>
- inline
- Function_l2l<E>::Function_l2l()
- {
- }
-
- template <typename E>
- inline
- Function_l2l<E>::Function_l2l(const Function_l2l<E>& rhs)
- : Function_v2v<E>(rhs)
- {
- }
-
- template <typename E>
- inline
Function_vv2v<E>::Function_vv2v()
{
}
diff --git a/milena/mln/core/concept/object.hh b/milena/mln/core/concept/object.hh
index 27ef2a4..aaae2ad 100644
--- a/milena/mln/core/concept/object.hh
+++ b/milena/mln/core/concept/object.hh
@@ -62,9 +62,6 @@
*
* This is the documentation of Milena.
*
- * \section tools_subsec Tools required.
- * FIXME.
- *
* \section mln_sec Overview of Milena.
*
* <UL>
@@ -84,6 +81,7 @@
* <LI> \ref mln::extension
* <LI> \ref mln::fun
* <LI> \ref mln::geom
+ * <LI> \ref mln::graph
* <LI> \ref mln::histo
* <LI> \ref mln::io
* <LI> \ref mln::labeling
diff --git a/milena/mln/core/concept/object_id.hh b/milena/mln/core/concept/object_id.hh
index 770098e..e8102df 100644
--- a/milena/mln/core/concept/object_id.hh
+++ b/milena/mln/core/concept/object_id.hh
@@ -30,7 +30,7 @@
#ifndef MLN_CORE_CONCEPT_OBJECT_ID_HH
# define MLN_CORE_CONCEPT_OBJECT_ID_HH
-/// \file mln/util/internal/element_id.hh
+/// \file mln/core/concept/object_id.hh
///
/// Base class of an object id.
diff --git a/milena/mln/core/image/complex_image.hh b/milena/mln/core/image/complex_image.hh
index 152c10e..98d00c5 100644
--- a/milena/mln/core/image/complex_image.hh
+++ b/milena/mln/core/image/complex_image.hh
@@ -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 Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -114,13 +115,16 @@ namespace mln
} // end of namespace mln::trait
- /// Image based on a complex.
+ /// \brief Image based on a complex.
///
/// Values attached to each face of the complex.
///
/// \arg p D The dimension of the complex.
/// \arg p G The geometry type of the complex.
/// \arg p V The value type of the image.
+ ///
+ /// \ingroup modimageconcrete
+ //
template <unsigned D, typename G, typename V>
class complex_image
: public internal::image_primary< V, p_complex<D, G>,
diff --git a/milena/mln/core/image/decorated_image.hh b/milena/mln/core/image/decorated_image.hh
index 1d8108f..1f19009 100644
--- a/milena/mln/core/image/decorated_image.hh
+++ b/milena/mln/core/image/decorated_image.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,15 +33,15 @@
# include <mln/value/proxy.hh>
-/*! \file mln/core/image/decorated_image.hh
- *
- * \brief Definition of an image that can have additional features.
- */
+/// \file mln/core/image/decorated_image.hh
+///
+/// Definition of an image that can have additional features.
+
namespace mln
{
- // Fwd decl.
+ // Forward declaration.
template <typename I, typename D> struct decorated_image;
@@ -76,10 +76,10 @@ namespace mln
- /*!
- * \brief Class of decorated image : FIXME Doc
- *
- */
+ /// \brief Image that can have additional features.
+ ///
+ /// \ingroup modimageidmorpher
+ //
template <typename I, typename D>
struct decorated_image :
public internal::decorated_image_impl_< I, decorated_image<I,D> >,
diff --git a/milena/mln/core/image/edge_image.hh b/milena/mln/core/image/edge_image.hh
index 4ea3ce2..9b5fb75 100644
--- a/milena/mln/core/image/edge_image.hh
+++ b/milena/mln/core/image/edge_image.hh
@@ -118,7 +118,9 @@ namespace mln
} // end of namespace mln::internal
-
+ /// \brief Image based on graph edges.
+ ///
+ /// \ingroup modimageconcrete
template <typename P, typename V, typename G = util::graph>
class edge_image
: public pw::internal::image_base<fun::i2v::array<V>,
diff --git a/milena/mln/core/image/extended.hh b/milena/mln/core/image/extended.hh
index c6451a0..cde8009 100644
--- a/milena/mln/core/image/extended.hh
+++ b/milena/mln/core/image/extended.hh
@@ -86,8 +86,10 @@ namespace mln
- // FIXME: Doc!
-
+ /// \brief Makes an image become restricted by a point set.
+ ///
+ /// \ingroup modimagedomainmorpher
+ //
template <typename I>
struct extended : public internal::image_domain_morpher< I,
box<mln_site(I)>,
diff --git a/milena/mln/core/image/extension_fun.hh b/milena/mln/core/image/extension_fun.hh
index dd67f04..9992e33 100644
--- a/milena/mln/core/image/extension_fun.hh
+++ b/milena/mln/core/image/extension_fun.hh
@@ -29,15 +29,13 @@
#ifndef MLN_CORE_IMAGE_EXTENSION_FUN_HH
# define MLN_CORE_IMAGE_EXTENSION_FUN_HH
-/*!
- * \file mln/core/image/extension_fun.hh
- *
- * \brief Definition of a morpher that extends the domain of an image
- * with a function.
- *
- * \todo Deal with two-ways functions...
- * \todo Use an envelop as lvalue to test extension writing.
- */
+/// \file mln/core/image/extension_fun.hh
+///
+/// definition of a morpher that extends the domain of an image
+/// with a function.
+///
+/// \todo Deal with two-ways functions...
+/// \todo Use an envelop as lvalue to test extension writing.
# include <mln/core/internal/image_identity.hh>
@@ -96,12 +94,13 @@ namespace mln
- // FIXME: Doc!
-
+ /// \brief Extends the domain of an image with a function.
+ ///
+ /// \ingroup modimagedomainmorpher
+ //
template <typename I, typename F>
- class extension_fun :
-
- public internal::image_identity< I, mln_domain(I), extension_fun<I, F> >,
+ class extension_fun
+ : public internal::image_identity< I, mln_domain(I), extension_fun<I, F> >,
private mlc_converts_to(mln_result(F), mln_value(I))::check_t
{
public:
diff --git a/milena/mln/core/image/extension_ima.hh b/milena/mln/core/image/extension_ima.hh
index 72119a1..2a9f7d1 100644
--- a/milena/mln/core/image/extension_ima.hh
+++ b/milena/mln/core/image/extension_ima.hh
@@ -90,8 +90,10 @@ namespace mln
- // FIXME: Doc!
-
+ /// \brief Extends the domain of an image with an image.
+ ///
+ /// \ingroup modimagedomainmorpher
+ //
template <typename I, typename J>
class extension_ima
diff --git a/milena/mln/core/image/extension_val.hh b/milena/mln/core/image/extension_val.hh
index 82f0684..8a376fc 100644
--- a/milena/mln/core/image/extension_val.hh
+++ b/milena/mln/core/image/extension_val.hh
@@ -92,8 +92,10 @@ namespace mln
- // FIXME: Doc!
-
+ /// \brief Extends the domain of an image with a value.
+ ///
+ /// \ingroup modimagedomainmorpher
+ //
template <typename I>
class extension_val :
public internal::image_identity< I, mln_domain(I), extension_val<I> >
diff --git a/milena/mln/core/image/flat_image.hh b/milena/mln/core/image/flat_image.hh
index 8de6465..5d5beab 100644
--- a/milena/mln/core/image/flat_image.hh
+++ b/milena/mln/core/image/flat_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,13 +29,11 @@
#ifndef MLN_CORE_FLAT_IMAGE_HH
# define MLN_CORE_FLAT_IMAGE_HH
-/*!
- * \file mln/core/image/flat_image.hh
- *
- * \brief Definition of a image with a signle value.
- *
- * \todo Zed: Address the values v. destination issue.
- */
+/// \file mln/core/image/flat_image.hh
+///
+/// \brief Definition of a image with a signle value.
+///
+/// \todo Zed: Address the values v. destination issue.
# include <mln/core/internal/image_primary.hh>
# include <mln/value/set.hh>
@@ -101,8 +100,10 @@ namespace mln
- // FIXME: Doc!
-
+ /// \brief Image with a single value.
+ ///
+ /// \ingroup modimageconcrete
+ //
template <typename T, typename S>
struct flat_image : public internal::image_primary< T, S, flat_image<T,S> >
{
diff --git a/milena/mln/core/image/fun_image.hh b/milena/mln/core/image/fun_image.hh
index 0099dde..6a4c003 100644
--- a/milena/mln/core/image/fun_image.hh
+++ b/milena/mln/core/image/fun_image.hh
@@ -92,7 +92,10 @@ namespace mln
- /// Class of image morpher which takes allow to view an image throught a morpher
+ /// \brief Image read through a function.
+ ///
+ /// \ingroup modimagevaluemorpher
+ //
template <typename F, typename I>
struct fun_image :
public internal::image_value_morpher< I, mln_result(F), fun_image<F,I> >
diff --git a/milena/mln/core/image/hexa.hh b/milena/mln/core/image/hexa.hh
index 66ccdb1..498452e 100644
--- a/milena/mln/core/image/hexa.hh
+++ b/milena/mln/core/image/hexa.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -44,7 +44,8 @@
namespace mln
{
- // Fwd decl.
+
+ // Forward declaration.
template <typename I> class hexa;
@@ -113,7 +114,7 @@ namespace mln
* 8 XX| | | | | | |XX
* -------------------
*
- *
+ * \ingroup modimagedomainmorpher
*/
template <typename I>
struct hexa :
diff --git a/milena/mln/core/image/interpolated.hh b/milena/mln/core/image/interpolated.hh
index 91356db..25b1632 100644
--- a/milena/mln/core/image/interpolated.hh
+++ b/milena/mln/core/image/interpolated.hh
@@ -78,8 +78,9 @@ namespace mln
} // end of namespace mln::trait
- /// Morpher that makes underlaying image being accessed with floating coordinate.
+ /// \brief Makes the underlying image being accessed with floating coordinates.
///
+ /// \ingroup modimageidentity
template <typename I, template <class> class F>
struct interpolated :
public mln::internal::image_identity< I, mln_domain(I), interpolated<I,F> >
diff --git a/milena/mln/core/image/lazy_image.hh b/milena/mln/core/image/lazy_image.hh
index 1316284..90f5385 100644
--- a/milena/mln/core/image/lazy_image.hh
+++ b/milena/mln/core/image/lazy_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,10 @@
#ifndef MLN_CORE_IMAGE_LAZY_IMAGE_HH
# define MLN_CORE_IMAGE_LAZY_IMAGE_HH
-/*! \file mln/core/image/lazy_image.hh
- *
- * \brief Definition of a lazy image. Values are computed on the fly
- */
+/// \file mln/core/image/lazy_image.hh
+///
+/// Definition of a lazy image. Values are computed on the fly.
+
# include <cmath>
@@ -79,7 +80,7 @@ namespace mln
- /*! \brief Lazy image class.
+ /*! \brief Image values are computed on the fly.
*
* The parameter \c I is the type of image.
* The parameter \c F is the type of function.
@@ -88,6 +89,7 @@ namespace mln
* This image class tage a functor \p fun and a box \p box.
* Access to ima(p) where \p p include \p box return fun(b) lazily.
*
+ * \ingroup modimageidmorpher
*/
template <typename I, typename F, typename B>
struct lazy_image :
diff --git a/milena/mln/core/image/plain.hh b/milena/mln/core/image/plain.hh
index c40544e..6073eb0 100644
--- a/milena/mln/core/image/plain.hh
+++ b/milena/mln/core/image/plain.hh
@@ -74,8 +74,12 @@ namespace mln
- /// Morpher that prevents an image from sharing its data.
+ /// \brief Prevents an image from sharing its data.
+ ///
/// While assigned to another image, its data is duplicated.
+ ///
+ /// \ingroup modimageidmorpher
+ //
template <typename I>
class plain
diff --git a/milena/mln/core/image/safe.hh b/milena/mln/core/image/safe.hh
index f04c2b3..953aac6 100644
--- a/milena/mln/core/image/safe.hh
+++ b/milena/mln/core/image/safe.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -79,8 +79,10 @@ namespace mln
- // FIXME: Doc!
-
+ /// \brief Makes an image accessible at undefined location.
+ ///
+ /// \ingroup modimageidmorpher
+ //
template <typename I>
class safe_image : public internal::image_identity< I, mln_domain(I), safe_image<I> >
{
diff --git a/milena/mln/core/image/slice_image.hh b/milena/mln/core/image/slice_image.hh
index b9db296..65160d9 100644
--- a/milena/mln/core/image/slice_image.hh
+++ b/milena/mln/core/image/slice_image.hh
@@ -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 Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -30,7 +31,7 @@
/// \file mln/core/image/slice_image.hh
///
-/// Definition of an image FIXME: Doc!
+/// Definition of a 2D image extracted from a slice of a 3D image.
///
/// \todo Write init_.
@@ -89,7 +90,10 @@ namespace mln
- /// FIXME: Doc!
+ /// \brief 2D image extracted from a slice of a 3D image.
+ ///
+ /// \ingroup modimagedomainmorpher
+ //
template <typename I>
struct slice_image : public internal::image_domain_morpher< I,
box2d,
diff --git a/milena/mln/core/image/sub_image.hh b/milena/mln/core/image/sub_image.hh
index df4c7ba..09ba8b5 100644
--- a/milena/mln/core/image/sub_image.hh
+++ b/milena/mln/core/image/sub_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,15 +29,15 @@
#ifndef MLN_CORE_IMAGE_SUB_IMAGE_HH
# define MLN_CORE_IMAGE_SUB_IMAGE_HH
-/*!
- * \file mln/core/image/sub_image.hh
- *
- * \brief Definition of morpher that makes an image become restricted
- * given by a point set.
- *
- * \todo Add a special case for "ima | box"; think about some other
- * special cases...
- */
+
+/// \file mln/core/image/sub_image.hh
+///
+/// Definition of morpher that makes an image become restricted
+/// given by a point set.
+///
+/// \todo Add a special case for "ima | box"; think about some other
+/// special cases...
+
# include <mln/core/internal/image_domain_morpher.hh>
@@ -97,8 +98,10 @@ namespace mln
- // FIXME: Doc!
-
+ /// \brief Image having its domain restricted by a site set.
+ ///
+ /// \ingroup modimagedomainmorpher
+ //
template <typename I, typename S>
struct sub_image : public internal::image_domain_morpher< I,
S,
diff --git a/milena/mln/core/image/sub_image_if.hh b/milena/mln/core/image/sub_image_if.hh
index 820d618..f987330 100644
--- a/milena/mln/core/image/sub_image_if.hh
+++ b/milena/mln/core/image/sub_image_if.hh
@@ -28,13 +28,13 @@
#ifndef MLN_CORE_IMAGE_SUB_IMAGE_IF_HH
# define MLN_CORE_IMAGE_SUB_IMAGE_IF_HH
-/*!
- * \file mln/core/image/sub_image_if.hh
- *
- * \brief FIXME DOC!
- *
- * \todo Activate preconditions.
- */
+
+/// \file mln/core/image/sub_image_if.hh
+///
+/// Image having its domain restricted by a site set and a function.
+///
+/// \todo Activate preconditions.
+
# include <mln/core/internal/image_domain_morpher.hh>
# include <mln/core/site_set/p_if.hh>
@@ -95,8 +95,9 @@ namespace mln
- // FIXME: Doc!
-
+ /// \brief Image having its domain restricted by a site set and a function.
+ ///
+ /// \ingroup modimagedomainmorpher
template <typename I, typename S>
struct sub_image_if : public internal::image_domain_morpher< I,
p_if< S, fun::p2b::has<I> >,
diff --git a/milena/mln/core/image/t_image.hh b/milena/mln/core/image/t_image.hh
index 34e5992..0ff50a1 100644
--- a/milena/mln/core/image/t_image.hh
+++ b/milena/mln/core/image/t_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_CORE_IMAGE_T_IMAGE_HH
# define MLN_CORE_IMAGE_T_IMAGE_HH
-/*! \file mln/core/image/t_image.hh
- *
- * \brief Definition of the "transposed" image class mln::t_image.
- */
+/// \file mln/core/image/t_image.hh
+///
+/// Definition of the "transposed" image class mln::t_image.
# include <mln/core/internal/image_morpher.hh>
# include <mln/core/site_set/box.hh>
@@ -73,12 +73,14 @@ namespace mln
} // end of namespace mln::internal
- /*! \brief Transposed image class.
- *
- * Swap a couple of coordinates.
- *
- * \warning This class only works on images whose domain is a box.
- */
+ /// \brief Transposed image.
+ ///
+ /// Swap a couple of coordinates.
+ ///
+ /// \warning This class only works on images whose domain is a box.
+ ///
+ /// \ingroup modimagedomainmorpher
+ //
template <typename I>
class t_image
: public internal::image_morpher<I, mln_value(I), mln_domain(I), t_image<I> >
diff --git a/milena/mln/core/image/thru_morpher.hh b/milena/mln/core/image/thru_morpher.hh
index 368bf61..c86d918 100644
--- a/milena/mln/core/image/thru_morpher.hh
+++ b/milena/mln/core/image/thru_morpher.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -148,6 +148,10 @@ namespace mln
};
}
+ /// \brief Morph image values through a function.
+ ///
+ /// \ingroup modimagevaluemorpher
+ //
template <typename I, typename F>
class thru_image : public internal::thru_find_impl<I, F>::ret
{
diff --git a/milena/mln/core/image/thrubin_morpher.hh b/milena/mln/core/image/thrubin_morpher.hh
index c8d7696..05611d2 100644
--- a/milena/mln/core/image/thrubin_morpher.hh
+++ b/milena/mln/core/image/thrubin_morpher.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+/// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -34,11 +34,10 @@
# include <mln/metal/bexpr.hh>
# include <mln/trait/fun.hh>
-///
/// \file mln/core/image/thrubin_morpher.hh
///
-/// \brief Definition of a morpher that morph values from two images through a binary function.
-///
+/// \brief Definition of a morpher that morph values from two images
+/// through a binary function.
namespace mln
{
@@ -121,6 +120,9 @@ namespace mln
};
}
+ /// \brief Morphes values from two images through a binary function.
+ ///
+ /// \ingroup modimagevaluemorpher
template <typename I, typename F>
class thrubin_image : public internal::thrubin_find_impl<I, F>::ret
{
diff --git a/milena/mln/core/image/tr_image.hh b/milena/mln/core/image/tr_image.hh
index 753f666..b73654c 100644
--- a/milena/mln/core/image/tr_image.hh
+++ b/milena/mln/core/image/tr_image.hh
@@ -76,8 +76,11 @@ namespace mln
} // end of namespace mln::trait
- /// Morpher that makes an image become transformed by a given
- /// transformation.
+
+ /// \brief Transform an image by a given transformation.
+ ///
+ /// \ingroup modimageidmorpher
+ //
template <typename S, typename I, typename T>
struct tr_image :
public mln::internal::image_identity< I, mln_domain(I), tr_image<S,I,T> >
diff --git a/milena/mln/core/image/unproject_image.hh b/milena/mln/core/image/unproject_image.hh
index 31f069f..13ca285 100644
--- a/milena/mln/core/image/unproject_image.hh
+++ b/milena/mln/core/image/unproject_image.hh
@@ -90,7 +90,9 @@ namespace mln
- /// FIXME: Doc!
+ /// \brief Un-projects an image.
+ ///
+ /// \ingroup modimagedomainmorpher
template <typename I, typename D, typename F>
struct unproject_image : public internal::image_domain_morpher< I,
D,
diff --git a/milena/mln/core/image/vertex_image.hh b/milena/mln/core/image/vertex_image.hh
index 333750a..8184e3f 100644
--- a/milena/mln/core/image/vertex_image.hh
+++ b/milena/mln/core/image/vertex_image.hh
@@ -120,7 +120,10 @@ namespace mln
} // end of namespace mln::internal
-
+ /// \brief Image based on graph vertices.
+ ///
+ /// \ingroup modimageconcrete
+ //
template <typename P, typename V, typename G = util::graph>
class vertex_image
: public pw::internal::image_base<fun::i2v::array<V>,
diff --git a/milena/mln/core/image/violent_cast_image.hh b/milena/mln/core/image/violent_cast_image.hh
index b9808f0..8f381e2 100644
--- a/milena/mln/core/image/violent_cast_image.hh
+++ b/milena/mln/core/image/violent_cast_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,11 +29,10 @@
#ifndef MLN_CORE_IMAGE_VIOLENT_CAST_IMAGE_HH
# define MLN_CORE_IMAGE_VIOLENT_CAST_IMAGE_HH
-/*! \file mln/core/image/violent_cast_image.hh
- *
- * \brief Definition of an image morpher that make the user see the
- * same image but with another data type.
- */
+/// \file mln/core/image/violent_cast_image.hh
+///
+/// definition of an image morpher that make the user see the
+/// same image but with another data type.
# include <mln/core/internal/image_value_morpher.hh>
# include <mln/value/set.hh>
@@ -107,10 +107,10 @@ namespace mln
- /*! \brief Class of image morpher which takes an image to change its
- * data type.
- *
- */
+ /// \brief Violently cast image values to a given type.
+ ///
+ /// \ingroup modimagevaluemorpher
+ //
template <typename T, typename I>
struct violent_cast_image :
public internal::image_value_morpher< I, T, violent_cast_image<T,I> >
diff --git a/milena/mln/core/site_set/box.hh b/milena/mln/core/site_set/box.hh
index 349b1f9..2d143c2 100644
--- a/milena/mln/core/site_set/box.hh
+++ b/milena/mln/core/site_set/box.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -72,11 +72,13 @@ namespace mln
} // end of namespace mln::trait
- /*! \brief Generic box class: site set containing points of a
- * regular grid.
- *
- * Parameter \c P is the corresponding type of point.
- */
+ /// \brief Generic box class: site set containing points of a
+ /// regular grid.
+ ///
+ /// Parameter \c P is the corresponding type of point.
+ ///
+ /// \ingroup modsitesetbasic
+ //
template <typename P>
struct box : public Box< box<P> >,
public internal::box_impl_< P::dim, mln_coord(P), box<P> >,
diff --git a/milena/mln/core/site_set/p_array.hh b/milena/mln/core/site_set/p_array.hh
index ccb04fa..1cdc692 100644
--- a/milena/mln/core/site_set/p_array.hh
+++ b/milena/mln/core/site_set/p_array.hh
@@ -74,10 +74,12 @@ namespace mln
- /// Site set class based on std::vector.
+ /// \brief Multi-set of sites.
///
- /// This is a multi-set of sites.
+ /// Site set class based on std::vector.
///
+ /// \ingroup modsitesetsparse
+ //
template <typename P>
class p_array : public internal::site_set_base_< P, p_array<P> >
{
diff --git a/milena/mln/core/site_set/p_centered.hh b/milena/mln/core/site_set/p_centered.hh
index ec75518..6ae6519 100644
--- a/milena/mln/core/site_set/p_centered.hh
+++ b/milena/mln/core/site_set/p_centered.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,14 +29,14 @@
#ifndef MLN_CORE_SITE_SET_P_CENTERED_HH
# define MLN_CORE_SITE_SET_P_CENTERED_HH
-/*! \file mln/core/site_set/p_centered.hh
- *
- * \brief This file defines the site set corresponding to a window
- * centered on a site.
- *
- * \todo Add the bkd iter.
- * \todo Code is_valid() and change_target() for the site set.
- */
+/// \file mln/core/site_set/p_centered.hh
+///
+/// This file defines the site set corresponding to a window
+/// centered on a site.
+///
+/// \todo Add the bkd iter.
+/// \todo Code is_valid() and change_target() for the site set.
+
# include <mln/core/internal/site_set_base.hh>
# include <mln/core/internal/site_set_iterator_base.hh>
@@ -71,6 +72,10 @@ namespace mln
} // end of namespace mln::trait
+ /// \brief Site set corresponding to a window centered on a site.
+ ///
+ /// \ingroup modsitesetsparse
+ //
template <typename W>
class p_centered : public internal::site_set_base_< mln_psite(W), p_centered<W> >,
private mlc_is_a(W, Window)::check_t
@@ -120,7 +125,7 @@ namespace mln
/// Give the window this site set is defined upon.
const W& window() const;
-
+
protected:
W win_;
diff --git a/milena/mln/core/site_set/p_complex.hh b/milena/mln/core/site_set/p_complex.hh
index cfeb0c2..6c0c6a0 100644
--- a/milena/mln/core/site_set/p_complex.hh
+++ b/milena/mln/core/site_set/p_complex.hh
@@ -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 Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -111,6 +112,9 @@ namespace mln
\arg \p G A function object type, associating localization
information (geometry) to each face of the complex.
\see mln::geom::complex_geometry. */
+ /// \brief A complex psite set based on the N-faces of a complex.
+ ///
+ /// \ingroup modsitesetcomplex
template <unsigned D, typename G>
class p_complex
: public internal::site_set_base_< complex_psite<D, G>, p_complex<D, G> >
diff --git a/milena/mln/core/site_set/p_edges.hh b/milena/mln/core/site_set/p_edges.hh
index 06af1d3..f0c60da 100644
--- a/milena/mln/core/site_set/p_edges.hh
+++ b/milena/mln/core/site_set/p_edges.hh
@@ -65,6 +65,10 @@ namespace mln
} // end of namespace mln::trait
+ /// \brief Site set mapping graph edges and image sites.
+ ///
+ /// \ingroup modsitesetgraph
+ //
template <typename G, typename F = util::internal::id2element<G,util::edge<G> > >
class p_edges
: public internal::site_set_base_< mln_result(F), p_edges<G, F> >
diff --git a/milena/mln/core/site_set/p_faces.hh b/milena/mln/core/site_set/p_faces.hh
index a3c8cae..2b387b2 100644
--- a/milena/mln/core/site_set/p_faces.hh
+++ b/milena/mln/core/site_set/p_faces.hh
@@ -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 Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -29,7 +30,8 @@
# define MLN_CORE_SITE_SET_P_FACES_HH
/// \file mln/core/site_set/p_faces.hh
-/// \brief Definition of a point set based on the set of n-faces of a
+///
+/// definition of a point set based on the set of n-faces of a
/// complex.
# include <mln/core/internal/site_set_base.hh>
@@ -70,8 +72,10 @@ namespace mln
} // end of namespace mln::trait
- /// A complex psite set based on a the \tparam N -faces of a complex of
- /// dimension \tparam D (a \p D-complex).
+ /// \brief A complex psite set based on a the N-faces of a complex of
+ /// dimension D (a D-complex).
+ ///
+ /// \ingroup modsitesetgraph
template <unsigned N, unsigned D, typename P>
struct p_faces
: public internal::site_set_base_< faces_psite<N, D, P>,
diff --git a/milena/mln/core/site_set/p_if.hh b/milena/mln/core/site_set/p_if.hh
index 988ea4a..d55cc40 100644
--- a/milena/mln/core/site_set/p_if.hh
+++ b/milena/mln/core/site_set/p_if.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_CORE_SITE_SET_P_IF_HH
# define MLN_CORE_SITE_SET_P_IF_HH
-/*! \file mln/core/site_set/p_if.hh
- *
- * \brief Definition of the restriction of a site set w.r.t. a predicate.
- *
- * \todo Change s_ attribute type to S*.
- */
+/// \file mln/core/site_set/p_if.hh
+///
+/// Definition of the restriction of a site set w.r.t. a predicate.
+///
+/// \todo Change s_ attribute type to S*.
# include <mln/core/internal/site_set_base.hh>
# include <mln/core/concept/function.hh>
@@ -42,7 +42,7 @@
namespace mln
{
- // Fwd decls.
+ // Forward declarations.
template <typename S, typename F> struct p_if;
template <typename Pi, typename S, typename F> struct p_if_piter_;
@@ -74,8 +74,10 @@ namespace mln
- /*! \brief Generic subset class.
- *
+ /// \brief Site set restricted w.r.t. a predicate.
+ ///
+ /// \ingroup modsitesetsparse
+ /*!
* Parameter \c S is a site set type; parameter F is a function
* from point to Boolean.
*/
diff --git a/milena/mln/core/site_set/p_image.hh b/milena/mln/core/site_set/p_image.hh
index ca0d64f..b52a6b3 100644
--- a/milena/mln/core/site_set/p_image.hh
+++ b/milena/mln/core/site_set/p_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -29,13 +30,13 @@
# define MLN_CORE_SITE_SET_P_IMAGE_HH
-/*! \file mln/core/site_set/p_image.hh
- *
- * \brief Definition of a site set class based on an image of
- * Booleans.
- *
- * \todo Add an init method (deferred initialization).
- */
+/// \file mln/core/site_set/p_image.hh
+///
+/// Definition of a site set class based on an image of
+/// Booleans.
+///
+/// \todo Add an init method (deferred initialization).
+
# include <mln/core/site_set/p_if.hh>
# include <mln/fun/ops.hh>
@@ -67,7 +68,9 @@ namespace mln
} // end of namespace trait
-
+ /// \brief Site set based on an image of Booleans.
+ ///
+ /// \ingroup modsitesetsparse
template <typename I>
class p_image : public internal::site_set_base_< mln_psite(I), p_image<I> >
{
diff --git a/milena/mln/core/site_set/p_key.hh b/milena/mln/core/site_set/p_key.hh
index a265a92..befd39e 100644
--- a/milena/mln/core/site_set/p_key.hh
+++ b/milena/mln/core/site_set/p_key.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_CORE_SITE_SET_P_KEY_HH
# define MLN_CORE_SITE_SET_P_KEY_HH
-/*! \file mln/core/site_set/p_key.hh
- *
- * \brief Definition of a FIXME
- *
- * \todo Be more verbose in run_().
- */
+/// \file mln/core/site_set/p_key.hh
+///
+/// Definition of a priority queue class.
+///
+/// \todo Be more verbose in run_().
# include <map>
# include <mln/core/concept/function.hh>
@@ -68,10 +68,9 @@ namespace mln
- /*! \brief Priority queue class.
- *
- * FIXME
- */
+ /// \brief Priority queue class.
+ ///
+ /// \ingroup modsitesetqueue
template <typename K, typename P>
class p_key : public internal::site_set_base_< P,
p_key<K,P> >
diff --git a/milena/mln/core/site_set/p_line2d.hh b/milena/mln/core/site_set/p_line2d.hh
index 5b0a228..4594a1a 100644
--- a/milena/mln/core/site_set/p_line2d.hh
+++ b/milena/mln/core/site_set/p_line2d.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -74,7 +74,11 @@ namespace mln
- /// 2D line point set class.
+ /// \brief 2D discrete line of points.
+ /// It is based on p_array.
+ ///
+ /// \ingroup modsitesetbasic
+ //
class p_line2d : public internal::site_set_base_< point2d, p_line2d >
{
typedef p_line2d self_;
diff --git a/milena/mln/core/site_set/p_mutable_array_of.hh b/milena/mln/core/site_set/p_mutable_array_of.hh
index 627279a..7dd481f 100644
--- a/milena/mln/core/site_set/p_mutable_array_of.hh
+++ b/milena/mln/core/site_set/p_mutable_array_of.hh
@@ -69,10 +69,11 @@ namespace mln
- /*! \brief p_mutable_array_of is a mutable array of site sets.
- *
- * Parameter \c S is the type of the contained site sets.
- */
+ /// \brief p_mutable_array_of is a mutable array of site sets.
+ ///
+ /// Parameter \c S is the type of the contained site sets.
+ ///
+ /// \ingroup modsitesetbasic
template <typename S>
class p_mutable_array_of : public internal::site_set_base_< mln_site(S),
p_mutable_array_of<S> >,
diff --git a/milena/mln/core/site_set/p_priority.hh b/milena/mln/core/site_set/p_priority.hh
index 0e4b7fa..cb490fc 100644
--- a/milena/mln/core/site_set/p_priority.hh
+++ b/milena/mln/core/site_set/p_priority.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -65,8 +65,10 @@ namespace mln
- /*! \brief Priority queue class.
- *
+ /// \brief Priority queue.
+ ///
+ /// \ingroup modsitesetqueue
+ /*!
* The parameter \p P is the type of the priorities (for instance
* unsigned).
*
@@ -76,7 +78,7 @@ namespace mln
template <typename P, typename Q>
class p_priority : public internal::site_set_base_< mln_site(Q),
p_priority<P,Q> >,
- private mlc_is_a(Q, Site_Set)::check_t
+ private mlc_is_a(Q, Site_Set)::check_t
{
typedef p_priority<P,Q> self_;
public:
diff --git a/milena/mln/core/site_set/p_queue.hh b/milena/mln/core/site_set/p_queue.hh
index d6fc400..920f9ba 100644
--- a/milena/mln/core/site_set/p_queue.hh
+++ b/milena/mln/core/site_set/p_queue.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,10 @@
#ifndef MLN_CORE_SITE_SET_P_QUEUE_HH
# define MLN_CORE_SITE_SET_P_QUEUE_HH
-/*! \file mln/core/site_set/p_queue.hh
- *
- * \brief Definition of a site set based on std::deque.
- *
+/// \file mln/core/site_set/p_queue.hh
+///
+/// Definition of a site set based on std::deque.
+/*!
* \todo Rename 'front' because it is ambiguous for C++ users; we
* have:
* - 'p_queue::pop' means 'deque::pop_front'
@@ -66,8 +67,10 @@ namespace mln
- /*! \brief Queue of sites (based on std::deque).
- *
+ /// \brief Queue of sites (based on std::deque).
+ ///
+ /// \ingroup modsitesetqueue
+ /*!
* The parameter \c P shall be a site or pseudo-site type.
*/
template <typename P>
diff --git a/milena/mln/core/site_set/p_queue_fast.hh b/milena/mln/core/site_set/p_queue_fast.hh
index 97aab6e..ed3d2eb 100644
--- a/milena/mln/core/site_set/p_queue_fast.hh
+++ b/milena/mln/core/site_set/p_queue_fast.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,13 +29,12 @@
#ifndef MLN_CORE_SITE_SET_P_QUEUE_FAST_HH
# define MLN_CORE_SITE_SET_P_QUEUE_FAST_HH
-/*! \file mln/core/site_set/p_queue_fast.hh
- *
- * \brief Definition of a queue of sites that is fast but uses extra
- * memory w.r.t. a simple queue.
- *
- * \todo Add insert.
- */
+/// \file mln/core/site_set/p_queue_fast.hh
+///
+/// Definition of a queue of sites that is fast but uses extra
+/// memory w.r.t. a simple queue.
+///
+/// \todo Add insert.
# include <mln/core/site_set/p_array.hh>
@@ -63,8 +63,10 @@ namespace mln
- /*! \brief Queue of sites class (based on p_array<P>).
- *
+ /// \brief Queue of sites class (based on p_array<P>).
+ ///
+ /// \ingroup modsitesetqueue
+ /*!
* This container is efficient; FIXME: explain...
*
* The parameter \c P shall be a site or pseudo-site type.
diff --git a/milena/mln/core/site_set/p_run.hh b/milena/mln/core/site_set/p_run.hh
index af7588f..a50b74a 100644
--- a/milena/mln/core/site_set/p_run.hh
+++ b/milena/mln/core/site_set/p_run.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_CORE_SITE_SET_P_RUN_HH
# define MLN_CORE_SITE_SET_P_RUN_HH
-/*! \file mln/core/site_set/p_run.hh
- *
- * \brief Definition of a run of points.
- *
- * \todo Use a lazy approach (in subj) like in p_array psite.
- */
+/// \file mln/core/site_set/p_run.hh
+///
+/// Definition of a run of points.
+///
+/// \todo Use a lazy approach (in subj) like in p_array psite.
# include <mln/core/internal/site_set_base.hh>
# include <mln/core/site_set/box.hh>
@@ -76,8 +76,10 @@ namespace mln
- /*! \brief Point set class in run.
- *
+ /// \brief Point set class in run.
+ ///
+ /// \ingroup modsitesetbasic
+ /*!
* This is a mathematical set of points (not a multi-set). The
* parameter \p P shall be a Point type.
*
diff --git a/milena/mln/core/site_set/p_set.hh b/milena/mln/core/site_set/p_set.hh
index 8461171..7c473e0 100644
--- a/milena/mln/core/site_set/p_set.hh
+++ b/milena/mln/core/site_set/p_set.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -61,8 +61,10 @@ namespace mln
- /*! \brief Point set class based on util::set.
- *
+ /// \brief Mathematical set of sites (based on util::set).
+ ///
+ /// \ingroup modsitesetsparse
+ /*!
* This is a mathematical set of sites (not a multi-set).
*
* The parameter \c P shall be a site or pseudo-site type.
diff --git a/milena/mln/core/site_set/p_vaccess.hh b/milena/mln/core/site_set/p_vaccess.hh
index 25b8e5c..1ca999f 100644
--- a/milena/mln/core/site_set/p_vaccess.hh
+++ b/milena/mln/core/site_set/p_vaccess.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -66,7 +66,9 @@ namespace mln
- /// FIXME
+ /// \brief Site set in which sites are grouped by their associated value.
+ ///
+ /// \ingroup modsitesetsparse
template <typename V, typename S>
class p_vaccess : public internal::site_set_base_< mln_site(S),
p_vaccess<V,S> >,
diff --git a/milena/mln/core/site_set/p_vertices.hh b/milena/mln/core/site_set/p_vertices.hh
index f158626..aacf419 100644
--- a/milena/mln/core/site_set/p_vertices.hh
+++ b/milena/mln/core/site_set/p_vertices.hh
@@ -31,7 +31,7 @@
/// \file mln/core/site_set/p_vertices.hh
///
-/// Definition of a point set based on a graph.
+/// Definition of a point set based on graph vertices.
# include <mln/core/concept/function.hh>
# include <mln/core/internal/site_set_base.hh>
@@ -65,6 +65,10 @@ namespace mln
} // end of namespace mln::trait
+ /// \brief Site set based mapping graph vertices to sites.
+ ///
+ /// \ingroup modsitesetgraph
+ //
template <typename G, typename F = util::internal::id2element<G,util::vertex<G> > >
class p_vertices
: public internal::site_set_base_< mln_result(F), p_vertices<G,F> >
diff --git a/milena/mln/fun/i2v/all.hh b/milena/mln/fun/i2v/all.hh
index cc52d88..ec0c65d 100644
--- a/milena/mln/fun/i2v/all.hh
+++ b/milena/mln/fun/i2v/all.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_FUN_I2V_ALL_HH
# define MLN_FUN_I2V_ALL_HH
-/*! \file mln/fun/i2v/all.hh
- *
- * \brief File that includes all functions from index to value.
- */
+/// \file mln/fun/i2v/all.hh
+///
+/// File that includes all functions from index to value.
namespace mln
@@ -40,10 +40,12 @@ namespace mln
namespace fun
{
- /// Namespace of functions from index to value.
- namespace i2v
- {
- }
+ /// \brief Functions from index to value.
+ ///
+ /// \ingroup modfun
+ //
+ namespace i2v {}
+
}
}
diff --git a/milena/mln/fun/meta/inty.hh b/milena/mln/fun/meta/inty.hh
index 100641d..4f370a9 100644
--- a/milena/mln/fun/meta/inty.hh
+++ b/milena/mln/fun/meta/inty.hh
@@ -29,7 +29,7 @@
#ifndef MLN_FUN_META_INTY_HH
# define MLN_FUN_META_INTY_HH
-/// \file mln/fun/meta/infy.hh
+/// \file mln/fun/meta/inty.hh
///
/// Meta function to retrieve/modify the color intensity.
diff --git a/milena/mln/fun/meta/lum.hh b/milena/mln/fun/meta/lum.hh
index 2c987b9..9378c48 100644
--- a/milena/mln/fun/meta/lum.hh
+++ b/milena/mln/fun/meta/lum.hh
@@ -29,7 +29,7 @@
#ifndef MLN_FUN_META_LUM_HH
# define MLN_FUN_META_LUM_HH
-/// \file mln/fun/meta/infy.hh
+/// \file mln/fun/meta/lum.hh
///
/// Meta function to retrieve/modify the color luminosity.
diff --git a/milena/mln/pw/image.hh b/milena/mln/pw/image.hh
index d01ff32..9bd6b87 100644
--- a/milena/mln/pw/image.hh
+++ b/milena/mln/pw/image.hh
@@ -84,9 +84,12 @@ namespace mln
namespace pw
{
- /// A generic point-wise image implementation.
+ /// \brief A generic point-wise image implementation.
/// Parameter \p F is a function restricting the domain.
/// Parameter \p S is the domain type.
+ ///
+ /// \ingroup modimageconcrete
+ //
template <typename F, typename S>
class image :
public pw::internal::image_base< F, S, image<F,S> >
diff --git a/milena/mln/topo/is_n_face.hh b/milena/mln/topo/is_n_face.hh
index 33bce33..a43f072 100644
--- a/milena/mln/topo/is_n_face.hh
+++ b/milena/mln/topo/is_n_face.hh
@@ -29,6 +29,7 @@
# define MLN_TOPO_IS_N_FACE_HH
/// \file mln/topo/is_facet.hh
+///
/// \brief Testing whether an mln::complex_psite is an n-face.
# include <mln/core/site_set/complex_psite.hh>
@@ -44,7 +45,7 @@ namespace mln
// Forward declaration.
template <unsigned N> struct is_n_face;
- /// A functor testing wheter a mln::complex_psite is an \N-face.
+ /// A functor testing wheter a mln::complex_psite is an \p N -face.
template <unsigned N>
struct is_n_face : public mln::Function_p2b< is_n_face<N> >
{
diff --git a/milena/mln/util/array.hh b/milena/mln/util/array.hh
index f48d242..fd1f85b 100644
--- a/milena/mln/util/array.hh
+++ b/milena/mln/util/array.hh
@@ -83,12 +83,15 @@ namespace mln
template <typename T> class array_bkd_iter;
- /// A dynamic array class.
+ /// \brief A dynamic array class.
///
/// Elements are stored by copy. Implementation is lazy.
///
/// The parameter \c T is the element type, which shall not be
/// const-qualified.
+ ///
+ /// \ingroup modutil
+ //
template <typename T>
class array : public Function_i2v< mln::util::array<T> >
{
diff --git a/milena/mln/util/couple.hh b/milena/mln/util/couple.hh
index 5f43c27..33ba8e0 100644
--- a/milena/mln/util/couple.hh
+++ b/milena/mln/util/couple.hh
@@ -44,6 +44,9 @@ namespace mln
namespace util
{
+ /// \brief Definition of a couple.
+ ///
+ /// \ingroup modutil
template <typename T, typename U>
class couple : public mln::Object< couple<T,U> >
{
diff --git a/milena/mln/util/fibonacci_heap.hh b/milena/mln/util/fibonacci_heap.hh
index 597d87a..e3b1345 100644
--- a/milena/mln/util/fibonacci_heap.hh
+++ b/milena/mln/util/fibonacci_heap.hh
@@ -131,6 +131,9 @@ namespace mln
| Fibonacci Heap Class |
`---------------------*/
+ /// \brief Fibonacci heap.
+ ///
+ /// \ingroup modutil
template <typename P, typename T>
class fibonacci_heap : public Object< fibonacci_heap<P,T> >
{
diff --git a/milena/mln/util/graph.hh b/milena/mln/util/graph.hh
index 0614b61..fb0425f 100644
--- a/milena/mln/util/graph.hh
+++ b/milena/mln/util/graph.hh
@@ -82,7 +82,10 @@ namespace mln
namespace util
{
- /// Undirected graph.
+ /// \brief Undirected graph.
+ ///
+ /// \ingroup modgraph
+ //
class graph : public internal::graph_base<graph>
{
/// The super class.
diff --git a/milena/mln/util/line_graph.hh b/milena/mln/util/line_graph.hh
index 8ecf7b2..686a24f 100644
--- a/milena/mln/util/line_graph.hh
+++ b/milena/mln/util/line_graph.hh
@@ -77,7 +77,10 @@ namespace mln
namespace util
{
- /// Undirected line graph of a graph of type \tparam G.
+ /// \brief Undirected line graph of a graph of type \tparam G.
+ ///
+ /// \ingroup modgraph
+ //
template <typename G>
class line_graph : public internal::graph_base< line_graph<G> >
{
diff --git a/milena/mln/util/ord_pair.hh b/milena/mln/util/ord_pair.hh
index 674b98a..bdb5f94 100644
--- a/milena/mln/util/ord_pair.hh
+++ b/milena/mln/util/ord_pair.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -43,9 +43,12 @@ namespace mln
namespace util
{
- /// Ordered pair structure s.a. this->first <= this->second;
+ /// \brief Ordered pair structure s.a. this->first <= this->second;
/// ordered pairs are partially ordered using lexicographical
/// ordering.
+ ///
+ /// \ingroup modutil
+ //
template <typename T>
struct ord_pair : public mln::Object< ord_pair<T> >
{
diff --git a/milena/mln/util/set.hh b/milena/mln/util/set.hh
index 0401c69..929b77d 100644
--- a/milena/mln/util/set.hh
+++ b/milena/mln/util/set.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -76,6 +76,9 @@ namespace mln
/// mechanism.
///
/// \see mln::util::ord
+ ///
+ /// \ingroup modutil
+ //
template <typename T>
class set : public Object< mln::util::set<T> >
{
diff --git a/milena/mln/util/site_pair.hh b/milena/mln/util/site_pair.hh
index 0dbc531..b322290 100644
--- a/milena/mln/util/site_pair.hh
+++ b/milena/mln/util/site_pair.hh
@@ -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 Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,6 +46,11 @@ namespace mln
types to have a `coord' typedef, but util::ord_pair has none.
Hence this small workaround. Use ord_pair directly as soon as
image_base is refurbished. */
+ /// \brief A pair of sites.
+ /// It can be used as site.
+ ///
+ /// \ingroup modutil
+ //
template <typename P>
class site_pair : public mln::Object< site_pair<P> >
{
diff --git a/milena/mln/util/soft_heap.hh b/milena/mln/util/soft_heap.hh
index e0f8768..116c781 100644
--- a/milena/mln/util/soft_heap.hh
+++ b/milena/mln/util/soft_heap.hh
@@ -170,8 +170,12 @@ namespace mln
+ /// \brief Soft heap.
/// T key, the data to store in the heap. For instance a point 2d.
/// R rank, for instance int_u8
+ ///
+ /// \ingroup modutil
+ //
template <typename T, typename R>
class soft_heap : public Object< soft_heap<T,R> >
{
diff --git a/milena/mln/win/backdiag2d.hh b/milena/mln/win/backdiag2d.hh
index ecea98e..38e9948 100644
--- a/milena/mln/win/backdiag2d.hh
+++ b/milena/mln/win/backdiag2d.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,19 +45,23 @@ namespace mln
namespace win
{
-
+
/*! \brief Diagonal line window defined on the 2D square grid.
*
* An backdiag2d is centered and symmetric.
* its width (length) is odd.
*
- * For instance: \n
- * o \n
- * o \n
- * x \n
- * o \n
- * o \n
+ * For instance:
+ * \verbatim
+ * o
+ * o
+ * x
+ * o
+ * o
+ * \endverbatim
* is defined with length = 5.
+ *
+ * \ingroup modwin2d
*/
struct backdiag2d : public internal::classical_window_base< dpoint2d, backdiag2d >
{
diff --git a/milena/mln/win/ball.hh b/milena/mln/win/ball.hh
index 4dd4807..ba14475 100644
--- a/milena/mln/win/ball.hh
+++ b/milena/mln/win/ball.hh
@@ -59,13 +59,15 @@ namespace mln
namespace win
{
-
+
/*! \brief Generic ball window defined on a given grid.
*
* A ball is centered and symmetric; so its diameter is odd.
*
* G is the given grid on which the ball is defined and C is the
* type of coordinates.
+ *
+ * \ingroup modwinnd
*/
template <typename G, typename C>
struct ball : public internal::classical_window_base< dpoint<G,C>, ball<G,C> >
@@ -75,7 +77,7 @@ namespace mln
/// \param[in] diameter Diameter of the ball.
/// \pre \p diameter is odd.
ball(unsigned diameter);
-
+
/// Give the ball diameter.
unsigned diameter() const;
diff --git a/milena/mln/win/cube3d.hh b/milena/mln/win/cube3d.hh
index c3863b6..e2802c1 100644
--- a/milena/mln/win/cube3d.hh
+++ b/milena/mln/win/cube3d.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -51,19 +51,23 @@ namespace mln
* An cube3d is centered and symmetric; so
* its height (length) is odd.
*
- * For instance: \n
- * o o o \n
- * o o o \n
- * o o o \n
-
- * o o o \n
- * o x o \n
- * o o o \n
-
- * o o o \n
- * o o o \n
- * o o o \n
+ * For instance:
+ * \verbatim
+ * o o o
+ * o o o
+ * o o o
+
+ * o o o
+ * o x o
+ * o o o
+
+ * o o o
+ * o o o
+ * o o o
+ * \endverbatim
* is defined with length = 3.
+ *
+ * \ingroup modwin3d
*/
struct cube3d : public internal::classical_window_base< dpoint3d, cube3d >
{
diff --git a/milena/mln/win/cuboid3d.hh b/milena/mln/win/cuboid3d.hh
index b642dfd..990c239 100644
--- a/milena/mln/win/cuboid3d.hh
+++ b/milena/mln/win/cuboid3d.hh
@@ -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 Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -51,30 +52,33 @@ namespace mln
rectangular prism or rectangular parallelepiped) shape. It is
centered and symmetric.
- For instance: \n
-
- o o o o o o o\n
- o o o o o o o\n
- o o o o o o o\n
- o o o o o o o\n
- o o o o o o o\n
-
- o o o o o o o\n
- o o o o o o o\n
- o o o x o o o\n
- o o o o o o o\n
- o o o o o o o\n
-
- o o o o o o o\n
- o o o o o o o\n
- o o o o o o o\n
- o o o o o o o\n
- o o o o o o o\n
+ For instance:
+ \verbatim
+ o o o o o o o
+ o o o o o o o
+ o o o o o o o
+ o o o o o o o
+ o o o o o o o
+
+ o o o o o o o
+ o o o o o o o
+ o o o x o o o
+ o o o o o o o
+ o o o o o o o
+
+ o o o o o o o
+ o o o o o o o
+ o o o o o o o
+ o o o o o o o
+ o o o o o o o
+ \endverbatim
is defined with depth = 3, height = 5 and width = 7.
Reference:
http://en.wikipedia.org/wiki/Cuboid
+
+ \ingroup modwin3d
*/
struct cuboid3d : public internal::classical_window_base< dpoint3d, cuboid3d >
{
diff --git a/milena/mln/win/diag2d.hh b/milena/mln/win/diag2d.hh
index 41dcd6f..d4432af 100644
--- a/milena/mln/win/diag2d.hh
+++ b/milena/mln/win/diag2d.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,19 +45,23 @@ namespace mln
namespace win
{
-
+
/*! \brief Diagonal line window defined on the 2D square grid.
*
* An diag2d is centered and symmetric.
* its width (length) is odd.
*
- * For instance: \n
- * o \n
- * o \n
- * x \n
- * o \n
- * o \n
+ * For instance:
+ * \verbatim
+ * o
+ * o
+ * x
+ * o
+ * o
+ * \endverbatim
* is defined with length = 5.
+ *
+ * \ingroup modwin2d
*/
struct diag2d : public internal::classical_window_base< dpoint2d, diag2d >
{
diff --git a/milena/mln/win/disk2d.hh b/milena/mln/win/disk2d.hh
index 877d526..f388ad3 100644
--- a/milena/mln/win/disk2d.hh
+++ b/milena/mln/win/disk2d.hh
@@ -43,9 +43,11 @@ namespace mln
namespace win
{
-
- /// 2D disk window; precisely, ball-shaped window defined on the
+
+ /// \brief 2D disk window; precisely, ball-shaped window defined on the
/// 2D square grid.
+ ///
+ /// \ingroup modwin2d
//
typedef ball<grid::square, def::coord> disk2d;
diff --git a/milena/mln/win/hline2d.hh b/milena/mln/win/hline2d.hh
index 18c7546..27e9d61 100644
--- a/milena/mln/win/hline2d.hh
+++ b/milena/mln/win/hline2d.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,10 @@
#ifndef MLN_WIN_HLINE2D_HH
# define MLN_WIN_HLINE2D_HH
-/*! \file mln/win/hline2d.hh
- *
- * \brief Definition of the mln::win::hline2d window.
- */
+/// \file mln/win/hline2d.hh
+///
+/// Definition of the mln::win::hline2d window.
+
# include <mln/win/line.hh>
# include <mln/core/grids.hh>
@@ -42,15 +43,19 @@ namespace mln
namespace win
{
-
+
/*! \brief Horizontal line window defined on the 2D square grid.
- *
- * An hline2d is centered and symmetric; so its height is 1 and
- * its width (length) is odd.
- *
- * For instance: \n
- * o o x o o \n
- * is defined with length = 5.
+
+ An hline2d is centered and symmetric; so its height is 1 and
+ its width (length) is odd.
+
+ For instance:
+ \verbatim
+ o o x o o
+ \endverbatim
+ is defined with length = 5.
+
+ \ingroup modwin2d
*/
typedef line<grid::square, 1, def::coord> hline2d;
diff --git a/milena/mln/win/line.hh b/milena/mln/win/line.hh
index eab37cf..15f9fb7 100644
--- a/milena/mln/win/line.hh
+++ b/milena/mln/win/line.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -58,7 +58,7 @@ namespace mln
namespace win
{
-
+
/*! \brief Generic line window defined on a given grid in the
* given dimension.
*
@@ -69,6 +69,8 @@ namespace mln
* coordinates.
*
* \see mln::win::hline2d for an exemple of his use.
+ *
+ * \ingroup modwinnd
*/
template <typename M, unsigned i, typename C>
struct line : public internal::classical_window_base< dpoint<M, C>, line<M,i,C> >
diff --git a/milena/mln/win/multiple.hh b/milena/mln/win/multiple.hh
index 138f8f3..53b88bc 100644
--- a/milena/mln/win/multiple.hh
+++ b/milena/mln/win/multiple.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_WIN_MULTIPLE_HH
# define MLN_WIN_MULTIPLE_HH
-/*! \file mln/win/multiple.hh
- *
- * \brief Definition of a multiple window.
- *
- * \todo Implementation of the bkd_qiter (see FIXME).
- */
+/// \file mln/win/multiple.hh
+///
+/// Definition of a multiple window.
+///
+/// \todo Implementation of the bkd_qiter (see FIXME).
# include <mln/core/internal/window_base.hh>
# include <mln/core/internal/site_relative_iterator_base.hh>
@@ -71,6 +71,10 @@ namespace mln
namespace win
{
+
+ /// \brief Multiple window.
+ ///
+ /// \ingroup modwinmulti
template <typename W, typename F>
class multiple
diff --git a/milena/mln/win/multiple_size.hh b/milena/mln/win/multiple_size.hh
index 8760b9c..efd8dc5 100644
--- a/milena/mln/win/multiple_size.hh
+++ b/milena/mln/win/multiple_size.hh
@@ -72,6 +72,10 @@ namespace mln
namespace win
{
+ /// \brief Definition of a multiple-size window.
+ ///
+ /// \ingroup modwinmulti
+ //
template <unsigned n, typename W, typename F>
class multiple_size
diff --git a/milena/mln/win/octagon2d.hh b/milena/mln/win/octagon2d.hh
index b839010..98a9048 100644
--- a/milena/mln/win/octagon2d.hh
+++ b/milena/mln/win/octagon2d.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -54,14 +54,18 @@ namespace mln
* where l >= 0.
*
* For instance: \n
- * o o o \n
- * o o o o o \n
- * o o o o o o o \n
- * o o o x o o o \n
- * o o o o o o o \n
- * o o o o o \n
- * o o o \n
+ * \verbatim
+ * o o o
+ * o o o o o
+ * o o o o o o o
+ * o o o x o o o
+ * o o o o o o o
+ * o o o o o
+ * o o o
+ * \endverbatim
* is defined with L = 7 (l = 1).
+ *
+ * \ingroup modwin2d
*/
struct octagon2d : public internal::classical_window_base< dpoint2d, octagon2d >
{
diff --git a/milena/mln/win/rectangle2d.hh b/milena/mln/win/rectangle2d.hh
index dd807ac..311c49d 100644
--- a/milena/mln/win/rectangle2d.hh
+++ b/milena/mln/win/rectangle2d.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_WIN_RECTANGLE2D_HH
# define MLN_WIN_RECTANGLE2D_HH
-/*! \file mln/win/rectangle2d.hh
- *
- * \brief Definition of the mln::win::rectangle2d window.
- *
- * \todo Reactivate includes at EOF.
- */
+/// \file mln/win/rectangle2d.hh
+///
+/// Definition of the mln::win::rectangle2d window.
+///
+/// \todo Reactivate includes at EOF.
# include <mln/core/internal/classical_window_base.hh>
# include <mln/core/alias/dpoint2d.hh>
@@ -54,11 +54,15 @@ namespace mln
* A rectangle2d is a 2D window with rectangular shape. It is
* centered and symmetric.
*
- * For instance: \n
- * o o o o o \n
- * o o x o o \n
- * o o o o o \n
+ * For instance:
+ * \verbatim
+ * o o o o o
+ * o o x o o
+ * o o o o o
+ * \endverbatim
* is defined with height = 3 and width = 5.
+ *
+ * \ingroup modwin2d
*/
struct rectangle2d : public internal::classical_window_base< dpoint2d, rectangle2d >
{
diff --git a/milena/mln/win/segment1d.hh b/milena/mln/win/segment1d.hh
index 8d992ed..bc67e54 100644
--- a/milena/mln/win/segment1d.hh
+++ b/milena/mln/win/segment1d.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -44,13 +44,17 @@ namespace mln
{
/*! \brief Segment window defined on the 1D grid.
- *
- * An segment1d is centered and symmetric; so
- * its height (length) is odd.
- *
- * For instance: \n
- * o x o \n
- * is defined with length = 3.
+
+ An segment1d is centered and symmetric; so
+ its height (length) is odd.
+
+ For instance:
+ \verbatim
+ o x o
+ \endverbatim
+ is defined with length = 3.
+
+ \ingroup modwin1d
*/
typedef line<grid::tick, 0, def::coord> segment1d;
diff --git a/milena/mln/win/shift.hh b/milena/mln/win/shift.hh
index ef127ff..1b38e35 100644
--- a/milena/mln/win/shift.hh
+++ b/milena/mln/win/shift.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_WIN_SHIFT_HH
# define MLN_WIN_SHIFT_HH
-/*! \file mln/win/shift.hh
- *
- * \brief Define a function which shifts a window with a delta-point.
- */
+/// \file mln/win/shift.hh
+///
+/// Define a function which shifts a window with a delta-point.
# include <mln/core/window.hh>
diff --git a/milena/mln/win/sphere3d.hh b/milena/mln/win/sphere3d.hh
index 3767f4d..1a9c2a2 100644
--- a/milena/mln/win/sphere3d.hh
+++ b/milena/mln/win/sphere3d.hh
@@ -42,10 +42,11 @@ namespace mln
namespace win
{
-
- /// 3D sphere window; precisely, ball-shaped window defined on the
+
+ /// \brief 3D sphere window; precisely, ball-shaped window defined on the
/// 3D cubic grid.
- //
+ ///
+ /// \ingroup modwin3d
typedef ball<grid::cube, def::coord> sphere3d;
diff --git a/milena/mln/win/vline2d.hh b/milena/mln/win/vline2d.hh
index a1c43fb..8282d12 100644
--- a/milena/mln/win/vline2d.hh
+++ b/milena/mln/win/vline2d.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_WIN_VLINE2D_HH
# define MLN_WIN_VLINE2D_HH
-/*! \file mln/win/vline2d.hh
- *
- * \brief Definition of the mln::win::vline2d window.
- */
+/// \file mln/win/vline2d.hh
+///
+/// Definition of the mln::win::vline2d window.
# include <mln/win/line.hh>
# include <mln/core/grids.hh>
@@ -42,17 +42,21 @@ namespace mln
namespace win
{
-
+
/*! \brief Vertical line window defined on the 2D square grid.
- *
- * An vline2d is centered and symmetric; so its width is 1 and
- * its height (length) is odd.
- *
- * For instance: \n
- * o \n
- * x \n
- * o \n
- * is defined with length = 3.
+
+ An vline2d is centered and symmetric; so its width is 1 and
+ its height (length) is odd.
+
+ For instance:
+ \verbatim
+ o
+ x
+ o
+ \endverbatim
+ is defined with length = 3.
+
+ \ingroup modwin2d
*/
typedef line<grid::square, 0, def::coord> vline2d;
diff --git a/milena/tests/transform/distance_and_closest_point_geodesic.cc b/milena/tests/transform/distance_and_closest_point_geodesic.cc
index 368256b..0f2fccd 100644
--- a/milena/tests/transform/distance_and_closest_point_geodesic.cc
+++ b/milena/tests/transform/distance_and_closest_point_geodesic.cc
@@ -26,7 +26,7 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/transform/closest_point_geodesic.cc
+/// \file tests/transform/distance_and_closest_point_geodesic.cc
///
/// Test on mln::transform::closest_point_geodesic.
diff --git a/milena/tests/util/graph.cc b/milena/tests/util/graph.cc
index 7e3910e..e40fbdb 100644
--- a/milena/tests/util/graph.cc
+++ b/milena/tests/util/graph.cc
@@ -84,7 +84,7 @@ int main ()
{
unsigned i = 0;
for_all(n)
- mln_assertion(i++ == n.id());
+ mln_assertion(i++ == n.index());
mln_assertion(i != 0);
}
}
@@ -95,7 +95,7 @@ int main ()
{
unsigned i = v.nmax_nbh_edges();
for_all(e)
- mln_assertion(--i == e.id());
+ mln_assertion(--i == e.index());
mln_assertion((v.nmax_nbh_edges() == 0 && i == 0) || i != v.nmax_nbh_edges());
}
}
diff --git a/milena/tests/util/soft_heap.cc b/milena/tests/util/soft_heap.cc
index 86ce8eb..9850b12 100644
--- a/milena/tests/util/soft_heap.cc
+++ b/milena/tests/util/soft_heap.cc
@@ -25,7 +25,7 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file mln/util/soft_heap.cc
+/// \file tests/util/soft_heap.cc
///
/// Test for the soft heap (approximate priority queue).
--
1.5.6.5
1
0
* mln/algebra/all.hh: fix comments.
* mln/algebra/vec.hh: add operator>>.
* mln/core/internal/graph_psite_base.hh: convert to the correct id
type.
* mln/debug/draw_graph.hh: update doc.
* mln/graph/all.hh,
* mln/graph/essential.hh: new headers.
* mln/all.hh,
* mln/essential/routine.hh: include new headers.
* mln/io/pnm/load.hh: fix load_ascii builtin.
* mln/make/edge_image.hh: update prototype.
* mln/make/vertex_image.hh: be less restrictive on the function type.
* tests/level/approx/median.cc,
* tests/level/median.cc,
* tests/level/naive/median.cc: use a smaller image.
* tests/make/dummy_p_vertices.cc: test element id.
---
milena/ChangeLog | 31 +++++++
milena/mln/algebra/all.hh | 12 ++--
milena/mln/algebra/vec.hh | 18 ++++-
milena/mln/all.hh | 4 +-
milena/mln/core/internal/graph_psite_base.hh | 16 +++-
milena/mln/debug/draw_graph.hh | 97 +++++++++++++--------
milena/mln/essential/routine.hh | 4 +-
milena/mln/{algebra => graph}/all.hh | 25 ++---
milena/mln/{algebra/all.hh => graph/essential.hh} | 30 ++-----
milena/mln/io/pnm/load.hh | 11 ++-
milena/mln/make/edge_image.hh | 11 +--
milena/mln/make/vertex_image.hh | 15 ++--
milena/tests/level/approx/median.cc | 4 +-
milena/tests/level/median.cc | 2 +-
milena/tests/level/naive/median.cc | 12 ++--
milena/tests/make/dummy_p_vertices.cc | 3 +-
16 files changed, 185 insertions(+), 110 deletions(-)
copy milena/mln/{algebra => graph}/all.hh (72%)
copy milena/mln/{algebra/all.hh => graph/essential.hh} (70%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 5edf45d..b073efe 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,34 @@
+2009-04-29 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ Small fixes.
+
+ * mln/algebra/all.hh: fix comments.
+
+ * mln/algebra/vec.hh: add operator>>.
+
+ * mln/core/internal/graph_psite_base.hh: convert to the correct id
+ type.
+
+ * mln/debug/draw_graph.hh: update doc.
+
+ * mln/graph/all.hh,
+ * mln/graph/essential.hh: new headers.
+
+ * mln/all.hh,
+ * mln/essential/routine.hh: include new headers.
+
+ * mln/io/pnm/load.hh: fix load_ascii builtin.
+
+ * mln/make/edge_image.hh: update prototype.
+
+ * mln/make/vertex_image.hh: be less restrictive on the function type.
+
+ * tests/level/approx/median.cc,
+ * tests/level/median.cc,
+ * tests/level/naive/median.cc: use a smaller image.
+
+ * tests/make/dummy_p_vertices.cc: test element id.
+
2009-04-28 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
Rename Image::pset to Image::domain_t.
diff --git a/milena/mln/algebra/all.hh b/milena/mln/algebra/all.hh
index ba62843..9250b03 100644
--- a/milena/mln/algebra/all.hh
+++ b/milena/mln/algebra/all.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,16 +29,15 @@
#ifndef MLN_ALGEBRA_ALL_HH
# define MLN_ALGEBRA_ALL_HH
-/*! \file mln/algebra/essential.hh
- *
- * \brief File that includes essential "point-wise" expression tools.
- */
+/// \file mln/algebra/all.hh
+///
+/// File that includes all algebraic structures.
namespace mln
{
- /// Namespace of "point-wise" expression tools.
+ /// Namespace of algebraic structure.
namespace algebra {}
} // end of namespace mln
diff --git a/milena/mln/algebra/vec.hh b/milena/mln/algebra/vec.hh
index 858dcea..64c6db0 100644
--- a/milena/mln/algebra/vec.hh
+++ b/milena/mln/algebra/vec.hh
@@ -345,7 +345,7 @@ namespace mln
operator-(const vec<n,T>& lhs, const vec<n,U>& rhs);
// vec * vec
-
+
/// Scalar product (dot product).
template <unsigned n, typename T, typename U>
mln_sum_product(T,U)
@@ -369,6 +369,12 @@ namespace mln
std::ostream&
operator<<(std::ostream& ostr, const vec<n,T>& v);
+ // >>
+
+ template <unsigned n, typename T>
+ std::istream&
+ operator>>(std::istream& istr, vec<n,T>& v);
+
// vprod // FIXME: Generalize...
/// Vectorial product (cross product).
@@ -613,6 +619,16 @@ namespace mln
return ostr;
}
+ template <unsigned n, typename T>
+ inline
+ std::istream&
+ operator>>(std::istream& istr, vec<n,T>& v)
+ {
+ for (unsigned i = 0; i < n; ++i)
+ istr >> v[i];
+ return istr;
+ }
+
// vprod
template <typename T, typename U>
diff --git a/milena/mln/all.hh b/milena/mln/all.hh
index 879cd94..cc4374b 100644
--- a/milena/mln/all.hh
+++ b/milena/mln/all.hh
@@ -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 Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -48,6 +49,7 @@
#include <mln/extract/all.hh>
#include <mln/fun/all.hh>
#include <mln/geom/all.hh>
+#include <mln/graph/all.hh>
#include <mln/histo/all.hh>
#include <mln/io/all.hh>
#include <mln/labeling/all.hh>
diff --git a/milena/mln/core/internal/graph_psite_base.hh b/milena/mln/core/internal/graph_psite_base.hh
index d02df00..553c060 100644
--- a/milena/mln/core/internal/graph_psite_base.hh
+++ b/milena/mln/core/internal/graph_psite_base.hh
@@ -55,6 +55,7 @@ namespace mln
// As a Proxy:
const mln_site(S)& subj_();
+ typedef typename S::graph_element::id_t id_t;
/// Setters.
/// \{
@@ -77,7 +78,7 @@ namespace mln
const typename S::graph_t& graph() const;
/// Return the id of the graph element designated by this psite.
- unsigned id() const;
+ id_t id() const;
/// \}
@@ -89,6 +90,9 @@ namespace mln
/// Convertion towards the graph element Id.
operator unsigned() const;
+ /// Convertion towards the graph element Id.
+ operator id_t() const;
+
/// Conversion towards the graph element (vertex or edge).
operator const typename S::graph_element&() const;
@@ -258,7 +262,7 @@ namespace mln
template <typename S, typename E>
inline
- unsigned
+ typename graph_psite_base<S,E>::id_t
graph_psite_base<S,E>::id() const
{
return elt_.id();
@@ -296,6 +300,14 @@ namespace mln
template <typename S, typename E>
inline
+ graph_psite_base<S,E>::operator id_t() const
+ {
+ mln_precondition(is_valid());
+ return elt_.id();
+ }
+
+ template <typename S, typename E>
+ inline
graph_psite_base<S,E>::operator unsigned() const
{
mln_precondition(is_valid());
diff --git a/milena/mln/debug/draw_graph.hh b/milena/mln/debug/draw_graph.hh
index 7584b4e..90b12ac 100644
--- a/milena/mln/debug/draw_graph.hh
+++ b/milena/mln/debug/draw_graph.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -49,34 +49,55 @@ namespace mln
namespace debug
{
- /// Draw an image \p ima from a mln::p_graph \p pg, with
- /// value \p vertex_v for vertices, value \p edge_v for edges and 0 for
+ /// Draw an image \p ima from a mln::p_vertices \p pv, with
+ /// value \p vcolor for vertices, value \p ecolor for edges and 0 for
/// the background.
- ///
- /// \param[in,out] ima The image to be drawn.
- /// \param[in] pv The p_vertices which contains vertices positions.
- /// \param[in] vertex_v The value to assign to pixels which contains
- /// vertices.
- /// \param[in] edge_v The value to assign to pixels which contains
- /// edges.
+ /*
+ * \param[in,out] ima The image to be drawn.
+ * \param[in] pv The p_vertices which contains vertices positions.
+ * \param[in] vcolor The value to assign to pixels which contains
+ * vertices.
+ * \param[in] ecolor The value to assign to pixels which contains
+ * edges.
+ */
template <typename I, typename G, typename F>
void
draw_graph(Image<I>& ima, const p_vertices<G, F>& pv,
- mln_value(I) vertex_v, mln_value(I) edge_v);
-
-
+ mln_value(I) vcolor, mln_value(I) ecolor);
+
+
+ /// Draw an image \p ima from a mln::p_vertices \p pv. Colors for vertices
+ /// are defined through \p vcolor_f_. Colors for edges are defined though
+ /// \p ecolor_f_.
+ /*
+ * \param[in,out] ima The image to be drawn.
+ * \param[in] pv The p_vertices which contains vertices positions.
+ * \param[in] vcolor_f_ A function returning a color value for vertices.
+ * \param[in] ecolor_f_ A function returning a color value for edges.
+ *
+ */
template <typename I, typename G, typename F, typename V, typename E>
void
draw_graph(Image<I>& ima,
const p_vertices<G, F>& pv,
- const Function<V>& vcolor, const Function<E>& ecolor_);
-
+ const Function<V>& vcolor_f_, const Function<E>& ecolor_f_);
+
+ /// Draw an image \p ima from a mln::p_vertices \p pv. Colors for vertices
+ /// are defined through \p vcolor_f_. Colors for edges are defined though
+ /// \p ecolor_f_.
+ /*
+ * \param[in,out] ima The image to be drawn.
+ * \param[in] pv The p_vertices which contains vertices positions.
+ * \param[in] vcolor_f_ A function returning a color value for vertices.
+ * \param[in] ecolor_f_ A function returning a color value for edges.
+ *
+ */
template <typename I, typename G, typename F, typename V, typename E>
inline
void
draw_graph(Image<I>& ima,
const p_vertices<util::line_graph<G>, F>& pv,
- const Function<V>& vcolor_, const Function<E>& ecolor_);
+ const Function<V>& vcolor_f_, const Function<E>& ecolor_f_);
# ifndef MLN_INCLUDE_ONLY
@@ -91,8 +112,8 @@ namespace mln
void
draw_graph(Image<I>& ima,
const p_edges<G, F>& pe,
- mln_value(I) vertex_v,
- mln_value(I) edge_v)
+ mln_value(I) vcolor,
+ mln_value(I) ecolor)
{
trace::entering("debug::draw_graph");
@@ -102,11 +123,11 @@ namespace mln
for_all(p)
{
if (exact(ima).has(p.first()) && exact(ima).has(p.second()))
- draw::line(exact(ima), p.first(), p.second(), edge_v);
+ draw::line(exact(ima), p.first(), p.second(), ecolor);
if (exact(ima).has(p.first()))
- exact(ima)(p.first()) = vertex_v;
+ exact(ima)(p.first()) = vcolor;
if (exact(ima).has(p.second()))
- exact(ima)(p.second()) = vertex_v;
+ exact(ima)(p.second()) = vcolor;
}
trace::exiting("debug::draw_graph");
@@ -118,8 +139,8 @@ namespace mln
void
draw_graph(Image<I>& ima,
const p_vertices<G, F>& pv,
- mln_value(I) vertex_v,
- mln_value(I) edge_v)
+ mln_value(I) vcolor,
+ mln_value(I) ecolor)
{
trace::entering("debug::draw_graph");
@@ -128,58 +149,60 @@ namespace mln
typedef p_vertices<G, F> pv_t;
mln_edge_iter(G) ei(g);
for_all(ei)
- draw::line(exact(ima), pv(ei.v1()), pv(ei.v2()), edge_v);
+ draw::line(exact(ima), pv(ei.v1()), pv(ei.v2()), ecolor);
// Draw vertices.
mln_piter(pv_t) p(pv);
for_all(p)
if (exact(ima).has(p))
- exact(ima)(p) = vertex_v;
+ exact(ima)(p) = vcolor;
trace::exiting("debug::draw_graph");
}
+
// FIXME: Refactor + be more restrictive on the function type.
template <typename I, typename G, typename F, typename V, typename E>
inline
void
draw_graph(Image<I>& ima,
const p_vertices<G, F>& pv,
- const Function<V>& vcolor_, const Function<E>& ecolor_)
+ const Function<V>& vcolor_f_, const Function<E>& ecolor_f_)
{
trace::entering("debug::draw_graph");
- const V& vcolor = exact(vcolor_);
- const E& ecolor = exact(ecolor_);
+ const V& vcolor_f = exact(vcolor_f_);
+ const E& ecolor_f = exact(ecolor_f_);
// Draw edges.
const G& g = pv.graph();
typedef p_vertices<G, F> pv_t;
mln_edge_iter(G) ei(g);
for_all(ei)
- draw::line(exact(ima), pv(ei.v1()), pv(ei.v2()), ecolor(ei.id()));
+ draw::line(exact(ima), pv(ei.v1()), pv(ei.v2()), ecolor_f(ei.id()));
// Draw vertices.
mln_piter(pv_t) p(pv);
for_all(p)
if (exact(ima).has(p))
- exact(ima)(p) = vcolor(p);
+ exact(ima)(p) = vcolor_f(p);
trace::exiting("debug::draw_graph");
}
+
// FIXME: Refactor + be more restrictive on the function type.
template <typename I, typename G, typename F, typename V, typename E>
inline
void
draw_graph(Image<I>& ima,
const p_vertices<util::line_graph<G>, F>& pv,
- const Function<V>& vcolor_, const Function<E>& ecolor_)
+ const Function<V>& vcolor_f_, const Function<E>& ecolor_f_)
{
trace::entering("debug::draw_graph");
- const V& vcolor = exact(vcolor_);
- const E& ecolor = exact(ecolor_);
+ const V& vcolor_f = exact(vcolor_f_);
+ const E& ecolor_f = exact(ecolor_f_);
typedef util::line_graph<G> LG;
@@ -191,13 +214,13 @@ namespace mln
{
p_line2d l = pv(vi.id());
// Draw edges (Line graph vertices).
- draw::line(exact(ima), l.begin(), l.end(), ecolor(vi.id()));
+ draw::line(exact(ima), l.begin(), l.end(), ecolor_f(vi.id()));
// Draw vertices (graph vertices).
if (exact(ima).has(l.begin()))
- exact(ima)(l.begin()) = vcolor(g.edge(vi).v1());
+ exact(ima)(l.begin()) = vcolor_f(g.edge(vi).v1());
if (exact(ima).has(l.end()))
- exact(ima)(l.end()) = vcolor(g.edge(vi).v2());
+ exact(ima)(l.end()) = vcolor_f(g.edge(vi).v2());
}
trace::exiting("debug::draw_graph");
diff --git a/milena/mln/essential/routine.hh b/milena/mln/essential/routine.hh
index 434519f..1818964 100644
--- a/milena/mln/essential/routine.hh
+++ b/milena/mln/essential/routine.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -45,6 +46,7 @@
# include <mln/extract/essential.hh>
# include <mln/fun/essential.hh>
# include <mln/geom/essential.hh>
+# include <mln/graph/essential.hh>
# include <mln/histo/essential.hh>
# include <mln/io/essential.hh>
# include <mln/labeling/essential.hh>
diff --git a/milena/mln/algebra/all.hh b/milena/mln/graph/all.hh
similarity index 72%
copy from milena/mln/algebra/all.hh
copy to milena/mln/graph/all.hh
index ba62843..35707fe 100644
--- a/milena/mln/algebra/all.hh
+++ b/milena/mln/graph/all.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2009 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
@@ -25,29 +25,24 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_ALGEBRA_ALL_HH
-# define MLN_ALGEBRA_ALL_HH
+#ifndef MLN_GRAPH_ALL_HH
+# define MLN_GRAPH_ALL_HH
-/*! \file mln/algebra/essential.hh
- *
- * \brief File that includes essential "point-wise" expression tools.
- */
+/// \file mln/graph/all.hh
+///
+/// File that include all graph related routines.
namespace mln
{
- /// Namespace of "point-wise" expression tools.
- namespace algebra {}
+ /// Namespace of graph related routines.
+ namespace graph {}
} // end of namespace mln
-# include <mln/algebra/h_mat.hh>
-# include <mln/algebra/h_vec.hh>
-# include <mln/algebra/mat.hh>
-# include <mln/algebra/quat.hh>
-# include <mln/algebra/vec.hh>
+# include <mln/graph/compute.hh>
-#endif // ! MLN_ALGEBRA_ALL_HH
+#endif // ! MLN_GRAPH_ALL_HH
diff --git a/milena/mln/algebra/all.hh b/milena/mln/graph/essential.hh
similarity index 70%
copy from milena/mln/algebra/all.hh
copy to milena/mln/graph/essential.hh
index ba62843..d4a0ef1 100644
--- a/milena/mln/algebra/all.hh
+++ b/milena/mln/graph/essential.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2009 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
@@ -25,29 +25,15 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_ALGEBRA_ALL_HH
-# define MLN_ALGEBRA_ALL_HH
+#ifndef MLN_GRAPH_ESSENTIAL_HH
+# define MLN_GRAPH_ESSENTIAL_HH
-/*! \file mln/algebra/essential.hh
- *
- * \brief File that includes essential "point-wise" expression tools.
- */
+/// \file mln/graph/essential.hh
+///
+/// File that include essential graph related routines.
-namespace mln
-{
+# include <mln/graph/all.hh>
- /// Namespace of "point-wise" expression tools.
- namespace algebra {}
-} // end of namespace mln
-
-
-# include <mln/algebra/h_mat.hh>
-# include <mln/algebra/h_vec.hh>
-# include <mln/algebra/mat.hh>
-# include <mln/algebra/quat.hh>
-# include <mln/algebra/vec.hh>
-
-
-#endif // ! MLN_ALGEBRA_ALL_HH
+#endif // ! MLN_GRAPH_ESSENTIAL_HH
diff --git a/milena/mln/io/pnm/load.hh b/milena/mln/io/pnm/load.hh
index be37c51..71ee293 100644
--- a/milena/mln/io/pnm/load.hh
+++ b/milena/mln/io/pnm/load.hh
@@ -181,8 +181,17 @@ namespace mln
void load_ascii_builtin(std::ifstream& file, I& ima)
{
mln_fwd_piter(I) p(ima.domain());
+
+ // FIXME: May be wrong!
+ // Worked out with an image with a max value of 255
+ // loaded in an image2d<unsigned char>.
+ unsigned n;
+
for_all(p)
- file >> ima(p);
+ {
+ file >> n;
+ ima(p) = n;
+ }
}
/// load_raw_2d.
diff --git a/milena/mln/make/edge_image.hh b/milena/mln/make/edge_image.hh
index 7ca6980..11f9358 100644
--- a/milena/mln/make/edge_image.hh
+++ b/milena/mln/make/edge_image.hh
@@ -81,10 +81,10 @@ namespace mln
///
/// \return an edge image.
//
- template <typename P, typename V, typename FP, typename FV, typename G>
+ template <typename P, typename V, typename G, typename FP, typename FV>
mln::edge_image<mln_result(FP),mln_result(FV),G>
edge_image(const vertex_image<P,V,G>& v_ima_,
- const Function_v2v<FP>& fp_,
+ const p_edges<G,FP> pe,
const Function_vv2v<FV>& fv_);
@@ -125,23 +125,20 @@ namespace mln
}
- template <typename P, typename V, typename FP, typename FV, typename G>
+ template <typename P, typename V, typename G, typename FP, typename FV>
mln::edge_image<mln_result(FP),mln_result(FV),G>
edge_image(const vertex_image<P,V,G>& v_ima_,
- const Function_v2v<FP>& fp_,
+ const p_edges<G,FP> pe,
const Function_vv2v<FV>& fv_)
{
trace::entering("make::edge_image");
- const FP& fp = exact(fp_);
const FV& fv = exact(fv_);
const vertex_image<P,V,G>& v_ima = exact(v_ima_);
mln_precondition(v_ima.is_valid());
fun::i2v::array<mln_result(FV)> tmp_fv(v_ima.domain().graph().e_nmax());
- p_edges<G,FP> pe(v_ima.domain().graph(), fp);
-
typedef mln::edge_image<mln_result(FP),mln_result(FV),G> edge_ima_t;
edge_ima_t ima_e(pe, tmp_fv);
diff --git a/milena/mln/make/vertex_image.hh b/milena/mln/make/vertex_image.hh
index dc7e28f..a013a5e 100644
--- a/milena/mln/make/vertex_image.hh
+++ b/milena/mln/make/vertex_image.hh
@@ -51,9 +51,9 @@ namespace mln
///
/// \return A vertex image.
//
- template <typename V, typename G>
- mln::vertex_image<void,V,G>
- vertex_image(const Graph<G>& g, const fun::i2v::array<V>& fv);
+ template <typename G, typename FV>
+ mln::vertex_image<void,mln_result(FV),G>
+ vertex_image(const Graph<G>& g, const Function_i2v<FV>& fv);
/// Construct a vertex image
@@ -74,15 +74,16 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
- template <typename V, typename G>
- mln::vertex_image<void,V,G>
- vertex_image(const Graph<G>& g, const fun::i2v::array<V>& fv)
+ template <typename G, typename FV>
+ mln::vertex_image<void,mln_result(FV),G>
+ vertex_image(const Graph<G>& g, const Function_i2v<FV>& fv)
{
trace::entering("make::vertex_image");
mln_precondition(exact(g).is_valid());
p_vertices<G> pv(g);
- mln::vertex_image<void,V,G> ima(pv, fv);
+ mln::vertex_image<void,mln_result(FV),G>
+ ima(pv, mln::convert::to<fun::i2v::array<mln_result(FV)> >(fv));
trace::exiting("make::vertex_image");
return ima;
diff --git a/milena/tests/level/approx/median.cc b/milena/tests/level/approx/median.cc
index 7dd3f12..5bd8062 100644
--- a/milena/tests/level/approx/median.cc
+++ b/milena/tests/level/approx/median.cc
@@ -47,10 +47,10 @@ int main()
using value::int_u8;
image2d<int_u8> lena;
- io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
{
- win::octagon2d oct(51);
+ win::octagon2d oct(49);
image2d<int_u8> out = level::approx::median(lena, oct);
io::pgm::save(out, "out_oct.pgm");
}
diff --git a/milena/tests/level/median.cc b/milena/tests/level/median.cc
index 40ca061..8489260 100644
--- a/milena/tests/level/median.cc
+++ b/milena/tests/level/median.cc
@@ -49,7 +49,7 @@ int main()
using value::int_u8;
image2d<int_u8> lena;
- io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
{
win::rectangle2d rect(51, 51);
image2d<int_u8> out = level::median(lena, rect);
diff --git a/milena/tests/level/naive/median.cc b/milena/tests/level/naive/median.cc
index 9f73289..71772d3 100644
--- a/milena/tests/level/naive/median.cc
+++ b/milena/tests/level/naive/median.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/naive/median.cc
- *
- * \brief Test on mln::level::naive::median.
- */
+/// \file tests/level/naive/median.cc
+///
+/// Test on mln::level::naive::median.
#include <mln/core/image/image2d.hh>
#include <mln/win/rectangle2d.hh>
@@ -52,7 +52,7 @@ int main()
border::thickness = 52;
image2d<int_u8> lena;
- io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
image2d<int_u8> out(lena.domain());
level::naive::median(lena, rec, out);
diff --git a/milena/tests/make/dummy_p_vertices.cc b/milena/tests/make/dummy_p_vertices.cc
index c97e805..ba7a1db 100644
--- a/milena/tests/make/dummy_p_vertices.cc
+++ b/milena/tests/make/dummy_p_vertices.cc
@@ -54,11 +54,12 @@ int main()
{
typedef p_vertices<G> pe_t;
pe_t pe = make::dummy_p_vertices(g);
+ unsigned i = 0;
mln_assertion(pe.nsites() == 5);
mln_piter_(pe_t) p(pe);
for_all(p)
- mln_assertion(p == 0);
+ mln_assertion(p.id() == i++);
}
{
--
1.5.6.5
1
0