Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- 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
- 9625 discussions
* m4/with-swilena.m4 (_OLN_WITH_SWIG): Disable tests on Ruby.
---
ChangeLog | 6 ++++++
m4/with-swilena.m4 | 49 +++++++++++++++++++++++++++----------------------
2 files changed, 33 insertions(+), 22 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index de54993..ed57f9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-06-03 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Do not require Ruby for Swilena.
+
+ * m4/with-swilena.m4 (_OLN_WITH_SWIG): Disable tests on Ruby.
+
2009-05-29 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Update makefile list.
diff --git a/m4/with-swilena.m4 b/m4/with-swilena.m4
index 5c52206..602abc6 100644
--- a/m4/with-swilena.m4
+++ b/m4/with-swilena.m4
@@ -50,28 +50,33 @@ if test x$with_swig != xno; then
CPPFLAGS=$save_CPPFLAGS
- # Check for Ruby.
- AC_CHECK_PROGS([RUBY], [ruby], [$am_aux_dir/missing ruby])
- if test "x$RUBY" = "x$am_aux_dir/missing ruby"; then
- AC_MSG_ERROR([no suitable Ruby interpreter found])
- fi
-
- AC_ARG_VAR([RUBY_CPPFLAGS], [Path to ruby.h])
- AC_ARG_WITH([ruby-includedir], [Include path for ruby.h],
- [RUBY_CPPFLAGS="-I$withval"],
- [RUBY_CPPFLAGS="-I`$RUBY -e 'puts $:.join("\n")' | \
- while read line
- do
- if [[ -f ${line}/ruby.h ]]; then
- echo $line
- fi
- done`"])
- save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS $RUBY_CPPFLAGS"
- AC_CHECK_HEADERS([ruby.h], [],
- [AC_MSG_ERROR(
- [You need Ruby development files to compile the Ruby interface.])])
- CPPFLAGS=$save_CPPFLAGS
+# FIXME: Disabled. Swilena does not support Ruby again (as it used to
+# in Olena 0.11). Moreover, the user should be given the choice
+# between the front ends (Python, Ruby, etc.); enabling Swilena shall
+# not systematically imply compiling the *whole* back ends!
+#
+# # Check for Ruby.
+# AC_CHECK_PROGS([RUBY], [ruby], [$am_aux_dir/missing ruby])
+# if test "x$RUBY" = "x$am_aux_dir/missing ruby"; then
+# AC_MSG_ERROR([no suitable Ruby interpreter found])
+# fi
+#
+# AC_ARG_VAR([RUBY_CPPFLAGS], [Path to ruby.h])
+# AC_ARG_WITH([ruby-includedir], [Include path for ruby.h],
+# [RUBY_CPPFLAGS="-I$withval"],
+# [RUBY_CPPFLAGS="-I`$RUBY -e 'puts $:.join("\n")' | \
+# while read line
+# do
+# if [[ -f ${line}/ruby.h ]]; then
+# echo $line
+# fi
+# done`"])
+# save_CPPFLAGS=$CPPFLAGS
+# CPPFLAGS="$CPPFLAGS $RUBY_CPPFLAGS"
+# AC_CHECK_HEADERS([ruby.h], [],
+# [AC_MSG_ERROR(
+# [You need Ruby development files to compile the Ruby interface.])])
+# CPPFLAGS=$save_CPPFLAGS
AC_PROG_SWIG([1.3.31])
if (eval "$SWIG -version") >/dev/null 2>&1; then :; else
--
1.6.1.2
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Help g++-2.95.
* mln/topo/skeleton/crest.hh: Layout. Upgrade doc style.
* mln/world/binary_2d/enlarge.hh: Help g++-2.95.
* mln/metal/converts_to.hh: Layout.
* mln/make/image3d.hh (image3d): Disambiguate overloading.
Help g++-2.95.
Explicitly use mln::box2d in static check.
* mln/convert/from_to.hh (todo): New.
Layout.
* tests/topo/skeleton/crest.cc: Upgrade doc style.
Disambiguate transform call (mln v. std) for g++-2.95.
mln/convert/from_to.hh | 17 +++++++++++------
mln/make/image3d.hh | 18 +++++++++++-------
mln/topo/skeleton/crest.hh | 3 +--
mln/world/binary_2d/enlarge.hh | 3 ++-
tests/topo/skeleton/crest.cc | 10 ++--------
5 files changed, 27 insertions(+), 24 deletions(-)
Index: mln/topo/skeleton/crest.hh
--- mln/topo/skeleton/crest.hh (revision 3950)
+++ mln/topo/skeleton/crest.hh (working copy)
@@ -30,11 +30,10 @@
/// \file mln/topo/skeleton/crest.hh
///
-/// Compute skeletization constraints.
+/// \brief Compute skeletization constraints.
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
-
# include <mln/data/fill.hh>
Index: mln/world/binary_2d/enlarge.hh
--- mln/world/binary_2d/enlarge.hh (revision 3950)
+++ mln/world/binary_2d/enlarge.hh (working copy)
@@ -356,7 +356,8 @@
trace::entering("mln::world::binary_2d::enlarge");
mln_precondition(exact(input).is_valid());
- mlc_bool(mln_site_(I)::dim == 2)::check();
+ typedef mln_site(I) S;
+ mlc_bool(S::dim == 2)::check();
mln_concrete(I) output;
if (n == 0)
Index: mln/metal/converts_to.hh
Index: mln/make/image3d.hh
--- mln/make/image3d.hh (revision 3950)
+++ mln/make/image3d.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -30,7 +31,8 @@
/// \file mln/make/image3d.hh
///
-/// Routine to create a 3D image from an array of 2D images.
+/// \brief Routine to create a 3D image from an array of 2D images or
+/// from one 2D image.
///
/// \todo Think about removing make::image3d since it is redundant
/// with convert::to and convert::from_to.
@@ -55,11 +57,11 @@
mln::image3d<mln_value(I)>
image3d(const util::array<I>& ima);
- /// Create an image3d from a 2D images.
+ /// Create an image3d from a 2D image.
///
template <typename I>
mln::image3d<mln_value(I)>
- image3d(const I& ima);
+ image3d(const Image<I>& ima);
# ifndef MLN_INCLUDE_ONLY
@@ -69,7 +71,7 @@
mln::image3d<mln_value(I)>
image3d(const util::array<I>& ima)
{
- mlc_is_a(mln_domain(I), Box)::check();
+ mlc_is_a(mln_domain(I), mln::box2d)::check();
mln_precondition(! ima.is_empty());
def::coord n_slices = ima.nelements();
@@ -89,9 +91,11 @@
template <typename I>
inline
mln::image3d<mln_value(I)>
- image3d(const I& ima)
+ image3d(const Image<I>& ima_)
{
- mlc_is_a(mln_domain(I), Box)::check();
+ const I& ima = exact(ima_);
+
+ mlc_equal(mln_domain(I), mln::box2d)::check();
mln_precondition(ima.is_valid());
mln::box2d b = ima.domain();
Index: mln/convert/from_to.hh
--- mln/convert/from_to.hh (revision 3950)
+++ mln/convert/from_to.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -30,11 +31,13 @@
/// \file mln/convert/from_to.hh
///
-/// General conversion procedure between two objects.
+/// \brief General conversion procedure between two objects.
///
/// \todo Test the effectiveness of guards.
+///
/// \todo Dispatch code in appropriate files.
-
+///
+/// \todo Find a solution for g++-2.95 and '...'; see FIXME below.
# include <mln/convert/impl/all.hh>
# include <mln/convert/from_to.hxx>
@@ -112,7 +115,8 @@
template <typename F, typename T>
inline
void
- from_to_dispatch(const metal::true_&, const Object<F>& from, Object<T>& to)
+ from_to_dispatch(metal::true_,
+ const Object<F>& from, Object<T>& to)
{
exact(to) = exact(from);
}
@@ -122,7 +126,8 @@
template <typename F, typename T>
inline
void
- from_to_dispatch(const metal::false_&, const Object<F>& from, Object<T>& to)
+ from_to_dispatch(metal::false_,
+ const Object<F>& from, Object<T>& to)
{
over_load::from_to_(exact(from), exact(to));
}
@@ -137,7 +142,7 @@
void
from_to_dispatch(const Object<F>& from, Object<T>& to)
{
- typedef mlc_converts_to(F, T) F_converts_to_T;
+ typedef mlc_converts_to(F, T) F_converts_to_T; // FIXME: HERE we've got a problem with g++-2.95.
internal::from_to_dispatch(F_converts_to_T(),
exact(from), exact(to));
}
Index: tests/topo/skeleton/crest.cc
--- tests/topo/skeleton/crest.cc (revision 3950)
+++ tests/topo/skeleton/crest.cc (working copy)
@@ -27,22 +27,16 @@
/// \file tests/topo/skeleton/crest.cc
///
-/// Test of mln::topo::skeleton::crest.
+/// \brief Test of mln::topo::skeleton::crest.
# include <mln/core/alias/neighb2d.hh>
# include <mln/core/image/image2d.hh>
-
# include <mln/data/compare.hh>
-
# include <mln/logical/not.hh>
-
# include <mln/make/image.hh>
# include <mln/make/w_window2d_int.hh>
-
# include <mln/topo/skeleton/crest.hh>
-
# include <mln/transform/distance_front.hh>
-
# include <mln/value/int_u8.hh>
@@ -76,7 +70,7 @@
image2d<bool> crest_ref = make::image(ref_dat);
image2d<value::int_u8>
- dist_map = transform::distance_front(logical::not_(input), c8(),
+ dist_map = mln::transform::distance_front(logical::not_(input), c8(),
make::w_window2d_int(vals),
mln_max(value::int_u8));
image2d<bool> crest_ima = topo::skeleton::crest(input, dist_map, c8());
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix tr_image and trash boost_graph stuff.
* mln/core/image/imorph/tr_image.hh (site): New typedef.
So that we can use site::dim.
* mln/util/internal/boost_graph.hh,
* mln/util/internal/boost_graph_access.hh,
* mln/util/internal/boost_graph_property.hh,
* mln/util/internal/boost_graph_structure.hh,
* tests/util/boost_graph.cc: Move to...
* trash/boost_graph.hh,
* trash/boost_graph_access.hh,
* trash/boost_graph_property.hh,
* trash/boost_graph_structure.hh,
* trash/boost_graph.cc: ...trash.
tr_image.hh | 3 +++
1 file changed, 3 insertions(+)
Index: mln/core/image/imorph/tr_image.hh
--- mln/core/image/imorph/tr_image.hh (revision 3949)
+++ mln/core/image/imorph/tr_image.hh (working copy)
@@ -94,6 +94,9 @@
/// Point_Site associated type.
typedef mln_psite(I) psite;
+ /// Site associated type.
+ typedef mln_site(I) site;
+
/// Value associated type.
typedef mln_value(I) value;
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Improve compatibility with g++-2.95.
* mln/core/internal/exact_gcc_2_95.hh: New.
* mln/core/routine/exact.hh: Calls the previous version if
g++ version is less than 3.
* mln/core/internal/exact.hh (make_): Add code so that
it passes g++-2.95.
* tests/core/routine/exact.cc: Augment.
* trash/fi_adaptor.cc,
* mln/topo/face.hh,
* mln/topo/internal/complex_iterator_base.hh,
* mln/core/site_set/p_array.hh,
* mln/core/site_set/p_image.hh,
* mln/core/image/imorph/tr_image.hh,
* mln/core/image/imorph/interpolated.hh,
* mln/core/image/imorph/labeled_image.hh,
* mln/core/point.hh,
* mln/core/concept/pseudo_site.hh,
* mln/core/category.hh,
* mln/core/internal/check/image_fastest.hh,
* mln/core/internal/graph_psite_base.hh,
* mln/accu/transform_directional.hh,
* mln/accu/transform_diagonal.hh,
* mln/accu/transform_snake.hh,
* mln/value/internal/gray_.hh,
* mln/convert/to_p_array.hh,
* mln/binarization/binarization.hh,
* mln/binarization/threshold.hh,
* mln/canvas/browsing/backdiagonal2d.hh,
* mln/canvas/browsing/internal/graph_first_search.hh,
* mln/labeling/compute.hh,
* tests/core/image/imorph/tr_image.cc,
* tests/core/image/imorph/labeled_image.cc,
* tests/accu/site_set/rectangularity.cc,
* tests/accu/compute.cc,
* tests/canvas/browsing/fwd.cc,
* tests/canvas/browsing/snake_fwd.cc,
* tests/canvas/browsing/snake_vert.cc,
* tests/canvas/browsing/snake_generic_2d_vert.cc,
* tests/canvas/browsing/snake_generic_2d_hori.cc,
* tests/canvas/browsing/snake_generic_3d_vert.cc,
* tests/canvas/browsing/snake_generic_3d_hori.cc,
* tests/canvas/browsing/hyper_directional.cc,
* tests/canvas/browsing/diagonal2d.cc,
* tests/canvas/browsing/backdiagonal2d.cc: Better pass g++-2.95.
Misc.
* mln/trait/concrete.hh (mln_concrete_ch_value): Remove.
We have mln_ch_value.
mln/accu/transform_diagonal.hh | 5
mln/accu/transform_directional.hh | 6
mln/accu/transform_snake.hh | 2
mln/binarization/binarization.hh | 14 -
mln/binarization/threshold.hh | 10 -
mln/canvas/browsing/backdiagonal2d.hh | 9 -
mln/canvas/browsing/internal/graph_first_search.hh | 9 -
mln/convert/to_p_array.hh | 4
mln/core/category.hh | 37 ++--
mln/core/concept/pseudo_site.hh | 14 +
mln/core/image/imorph/interpolated.hh | 14 -
mln/core/image/imorph/labeled_image.hh | 9 -
mln/core/image/imorph/tr_image.hh | 17 +-
mln/core/internal/check/image_fastest.hh | 10 -
mln/core/internal/exact.hh | 24 ++
mln/core/internal/exact_gcc_2_95.hh | 173 +++++++++++++++++++++
mln/core/internal/graph_psite_base.hh | 5
mln/core/point.hh | 29 ++-
mln/core/routine/exact.hh | 23 ++
mln/core/site_set/p_array.hh | 11 -
mln/core/site_set/p_image.hh | 25 ++-
mln/labeling/compute.hh | 4
mln/topo/face.hh | 10 -
mln/topo/internal/complex_iterator_base.hh | 7
mln/trait/concrete.hh | 8
mln/value/internal/gray_.hh | 2
tests/accu/compute.cc | 8
tests/accu/site_set/rectangularity.cc | 5
tests/canvas/browsing/backdiagonal2d.cc | 4
tests/canvas/browsing/diagonal2d.cc | 3
tests/canvas/browsing/fwd.cc | 9 -
tests/canvas/browsing/hyper_directional.cc | 3
tests/canvas/browsing/snake_fwd.cc | 9 -
tests/canvas/browsing/snake_generic_2d_hori.cc | 14 -
tests/canvas/browsing/snake_generic_2d_vert.cc | 14 -
tests/canvas/browsing/snake_generic_3d_hori.cc | 14 -
tests/canvas/browsing/snake_generic_3d_vert.cc | 14 -
tests/canvas/browsing/snake_vert.cc | 11 -
tests/core/image/imorph/labeled_image.cc | 10 -
tests/core/image/imorph/tr_image.cc | 8
tests/core/routine/exact.cc | 170 +++++++++++++++++++-
trash/fi_adaptor.cc | 4
42 files changed, 608 insertions(+), 173 deletions(-)
Index: trash/fi_adaptor.cc
--- trash/fi_adaptor.cc (revision 3948)
+++ trash/fi_adaptor.cc (working copy)
@@ -50,8 +50,8 @@
int main()
{
- using typename value::int_u8;
- using typename value::rgb8;
+ using value::int_u8;
+ using value::rgb8;
{
/* FIXME: Under GNU/Linux or under any *nix OS (i.e. under Unix or
Index: mln/topo/face.hh
--- mln/topo/face.hh (revision 3948)
+++ mln/topo/face.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -29,7 +30,8 @@
# define MLN_TOPO_FACE_HH
/// \file mln/topo/face.hh
-/// Face of a complex.
+///
+/// \brief Face of a complex.
# include <iostream>
# include <vector>
@@ -357,7 +359,7 @@
face<D>::lower_dim_adj_faces() const
{
// FIXME: Warning: might prevent any attempt to build a complex<0>.
- metal::bool_< D != 0 >::check();
+ metal::bool_<( D != 0 )>::check();
return n_ > 0 ?
internal::lower_dim_adj_faces_if_dim_matches_<D, D>()(*this) :
@@ -370,7 +372,7 @@
face<D>::higher_dim_adj_faces() const
{
// FIXME: Warning: might prevent any attempt to build a complex<0>.
- metal::bool_< D != 0 >::check();
+ metal::bool_<( D != 0 )>::check();
return n_ < D ?
internal::higher_dim_adj_faces_if_dim_matches_<D - 1, D>()(*this) :
Index: mln/topo/internal/complex_iterator_base.hh
--- mln/topo/internal/complex_iterator_base.hh (revision 3948)
+++ mln/topo/internal/complex_iterator_base.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -29,7 +30,8 @@
# define MLN_TOPO_INTERNAL_COMPLEX_ITERATOR_BASE_HH
/** \file mln/topo/internal/complex_iterator_base.hh
- Definition of an implementation (factoring) class for
+
+ \brief Definition of an implementation (factoring) class for
iterators on complexes.
Concrete iterators should inherit either from
@@ -56,6 +58,7 @@
*/
# include <iosfwd>
+# include <iostream>
# include <mln/core/concept/iterator.hh>
# include <mln/topo/complex.hh>
Index: mln/trait/concrete.hh
--- mln/trait/concrete.hh (revision 3948)
+++ mln/trait/concrete.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
@@ -31,7 +31,7 @@
/// \file mln/trait/concrete.hh
///
-/// Definition of the concrete image trait.
+/// \brief Definition of the concrete image trait.
# include <mln/trait/ch_value.hh>
@@ -39,8 +39,6 @@
# define mln_concrete(I) typename mln::trait::concrete< I >::ret
# define mln_concrete_(I) mln::trait::concrete< I >::ret
-# define mln_concrete_ch_value(I, V) mln_ch_value(mln_concrete(I), V)
-
namespace mln
{
Index: mln/core/site_set/p_array.hh
--- mln/core/site_set/p_array.hh (revision 3948)
+++ mln/core/site_set/p_array.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
@@ -31,12 +31,14 @@
/// \file mln/core/site_set/p_array.hh
///
-/// Definition of a point set class based on std::vector.
+/// \brief Definition of a point set class based on std::vector.
///
/// \todo Add a facade to index_of_in so that it dispatches when
/// calling it with Object<p_array_site>.
///
/// \todo Use util::index (instead of int) as many times as possible.
+///
+/// \todo See also the 'todo' entry in mln/core/concept/pseudo_site.hh.
# include <vector>
@@ -188,6 +190,9 @@
// pseudo site knows the site set it refers to.
typedef S target;
+ typedef S target_t; // To please g++-2.95.
+ // Also read the 'todo' in mln/core/concept/pseudo_site.hh.
+
// As a Proxy:
const element& subj_();
Index: mln/core/site_set/p_image.hh
--- mln/core/site_set/p_image.hh (revision 3948)
+++ mln/core/site_set/p_image.hh (working copy)
@@ -67,21 +67,36 @@
} // end of namespace trait
+ namespace internal
+ {
+
+ template <typename I>
+ struct p_image_site_set // Hack to help g++-2.95.
+ {
+ private:
+ typedef mln_domain(I) S_;
+ typedef fun::eq_v2b_expr_< pw::value_<I>, pw::cst_<bool> > F_;
+ public:
+ typedef p_if<S_, F_> ret;
+ };
+
+
+ } // end of namespace internal
+
+
/// \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> >
{
- typedef mln_domain(I) S_;
- typedef fun::eq_v2b_expr_< pw::value_<I>, pw::cst_<bool> > F_;
public:
/// Equivalent site_set type.
- typedef p_if<S_, F_> S;
+ typedef typename internal::p_image_site_set<I>::ret S;
/// Conversion towards the equivalent site set.
- operator S() const;
+ operator typename internal::p_image_site_set<I>::ret () const;
/// Element associated type.
@@ -159,7 +174,7 @@
template <typename I>
inline
- p_image<I>::operator S() const
+ p_image<I>::operator typename internal::p_image_site_set<I>::ret () const
{
S tmp(ima_.domain(), pw::value(ima_) == pw::cst(true));
return tmp;
Index: mln/core/image/imorph/tr_image.hh
--- mln/core/image/imorph/tr_image.hh (revision 3948)
+++ mln/core/image/imorph/tr_image.hh (working copy)
@@ -31,7 +31,7 @@
/// \file mln/core/image/imorph/tr_image.hh
///
-/// Definition of the morpher mln::tr_image presenting an image
+/// \brief Definition of the morpher mln::tr_image presenting an image
/// through a (bijective) transformation.
# include <cmath>
@@ -40,6 +40,7 @@
# include <mln/algebra/vec.hh>
# include <mln/value/set.hh>
+
namespace mln
{
@@ -126,7 +127,7 @@
using super_::has;
/// Test if a pixel value is accessible at \p v.
- bool has(const mln::algebra::vec<I::psite::dim, float>& v) const;
+ bool has(const mln::algebra::vec<site::dim, float>& v) const;
/// Read-only access of pixel value at point site \p p.
/// Mutable access is only OK for reading (not writing).
@@ -186,12 +187,12 @@
template <typename S, typename I, typename T>
inline
bool
- tr_image<S,I,T>::has(const algebra::vec<I::psite::dim, float>& v) const
+ tr_image<S,I,T>::has(const algebra::vec<site::dim, float>& v) const
{
mln_psite(I) p;
- algebra::vec<I::point::dim, float> v2 = this->data_->tr_.inv()(v);
- for (unsigned i = 0; i < I::point::dim; ++i)
- p[i] = static_cast<int>(round(v2[i]));
+ algebra::vec<I::site::dim, float> v2 = this->data_->tr_.inv()(v);
+ for (unsigned i = 0; i < I::site::dim; ++i)
+ p[i] = static_cast<int>(v2[i]);
return this->delegatee_().has(p);
}
@@ -201,7 +202,7 @@
mln_value(I)
tr_image<S,I,T>::operator()(const psite& p) const
{
- algebra::vec<I::psite::dim, float> v = p.to_vec();
+ algebra::vec<site::dim, float> v = p.to_vec();
return this->data_->ima_(this->data_->tr_.inv()(v));
}
@@ -210,7 +211,7 @@
mln_value(I)
tr_image<S,I,T>::operator()(const psite& p)
{
- algebra::vec<I::psite::dim, float> v = p.to_vec();
+ algebra::vec<site::dim, float> v = p.to_vec();
return this->data_->ima_(this->data_->tr_.inv()(v));
}
Index: mln/core/image/imorph/interpolated.hh
--- mln/core/image/imorph/interpolated.hh (revision 3948)
+++ mln/core/image/imorph/interpolated.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
@@ -31,7 +31,7 @@
/// \file mln/core/image/imorph/interpolated.hh
///
-/// Definition of a morpher that makes an image become readable
+/// \brief Definition of a morpher that makes an image become readable
/// with floating coordinates.
///
/// \todo think having has(algebra::vec v) as a method
@@ -128,8 +128,8 @@
/// Mutable access is only OK for reading (not writing).
using super_::operator();
- mln_value(I) operator()(const mln::algebra::vec<I::psite::dim, float>& v) const;
- mln_value(I) operator()(const mln::algebra::vec<I::psite::dim, float>& v);
+ mln_value(I) operator()(const mln::algebra::vec<psite::dim, float>& v) const;
+ mln_value(I) operator()(const mln::algebra::vec<psite::dim, float>& v);
const F<I> fun_;
};
@@ -197,7 +197,7 @@
template <typename I, template <class> class F>
inline
mln_value(I)
- interpolated<I,F>::operator()(const mln::algebra::vec<I::psite::dim, float>& v) const
+ interpolated<I,F>::operator()(const mln::algebra::vec<psite::dim, float>& v) const
{
return fun_(v);
}
@@ -205,7 +205,7 @@
template <typename I, template <class> class F>
inline
mln_value(I)
- interpolated<I,F>::operator()(const mln::algebra::vec<I::psite::dim, float>& v)
+ interpolated<I,F>::operator()(const mln::algebra::vec<psite::dim, float>& v)
{
return fun_(v);
}
Index: mln/core/image/imorph/labeled_image.hh
--- mln/core/image/imorph/labeled_image.hh (revision 3948)
+++ mln/core/image/imorph/labeled_image.hh (working copy)
@@ -31,14 +31,11 @@
/// \file mln/core/image/imorph/labeled_image.hh
///
-/// Definition of a morpher on a labeled image.
+/// \brief Definition of a morpher on a labeled image.
# include <mln/core/image/dmorph/image_if.hh>
-
# include <mln/core/concept/function.hh>
-
# include <mln/core/internal/image_identity.hh>
-
# include <mln/core/site_set/box.hh>
# include <mln/accu/pair.hh>
@@ -340,8 +337,8 @@
void
labeled_image<I>::update_()
{
- this->data_->bboxes_
- = labeling::compute(accu::meta::bbox(), this->data_->ima_,
+ this->data_->bboxes_ = labeling::compute(accu::meta::bbox(),
+ this->data_->ima_,
this->data_->nlabels_);
}
Index: mln/core/routine/exact.hh
--- mln/core/routine/exact.hh (revision 3948)
+++ mln/core/routine/exact.hh (working copy)
@@ -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,9 +29,9 @@
#ifndef MLN_CORE_ROUTINE_EXACT_HH
# define MLN_CORE_ROUTINE_EXACT_HH
-/*! \file mln/core/routine/exact.hh
- * \brief Definition of the mln::exact downcast routines.
- */
+/// \file mln/core/routine/exact.hh
+///
+/// \brief Definition of the mln::exact downcast routines.
/// FIXME: Doc!
#define mln_exact(T) typename mln::internal::exact_<T>::ret
@@ -38,9 +39,17 @@
#include <mln/core/internal/exact.hh>
+
+
+# if defined(__GNUC__) && __GNUC__ < 3
+# include <mln/core/internal/exact_gcc_2_95.hh>
+# else
+
+
namespace mln
{
+
/*! \brief Exact cast routine for mln objects.
*
* This set of routines can be used to downcast an object towards
@@ -65,7 +74,7 @@
# ifndef MLN_INCLUDE_ONLY
- // exact
+ // Exact.
template <typename T>
inline
@@ -85,4 +94,8 @@
} // end of namespace mln
+
+# endif // ! (defined(__GNUC__) && __GNUC__ < 3)
+
+
#endif // ! MLN_CORE_ROUTINE_EXACT_HH
Index: mln/core/point.hh
--- mln/core/point.hh (revision 3948)
+++ mln/core/point.hh (working copy)
@@ -31,7 +31,12 @@
/// \file mln/core/point.hh
///
-/// Definition of the generic point class mln::point.
+/// \brief Definition of the generic point class mln::point.
+///
+/// \todo the structure subject_point_impl is useless: first it is
+/// only used for 3D points (and it can be usefull for other points);
+/// second there is a room for the couple of methods (in the
+/// subject_impl specializations defined in core/alias/point*d.hh).
# include <mln/core/def/coord.hh>
# include <mln/core/concept/proxy.hh>
@@ -76,6 +81,17 @@
+ namespace internal
+ {
+ // This is a hack so that g++-2.95 can compile the method
+ // "point<G,C>::operator vec() const".
+ template <typename G, typename C>
+ struct vec_of_point
+ {
+ typedef algebra::vec<G::dim, float> ret;
+ };
+ }
+
/// Generic point class.
///
/// Parameters are \c n the dimension of the space and \c C the
@@ -176,7 +192,7 @@
https://trac.lrde.org/olena/changeset/1224#file2
https://www.lrde.epita.fr/pipermail/olena-patches/2007-October/001592.html
*/
- operator algebra::vec<G::dim, float> () const;
+ operator typename internal::vec_of_point<G,C>::ret () const; // Hack to help g++-2.95.
/// Explicit conversion towards mln::algebra::vec.
vec to_vec() const;
@@ -207,7 +223,7 @@
struct subject_point_impl< point<G,C>, E >
{
typename point<G,C>::vec to_vec() const;
- operator algebra::vec<G::dim, float>() const;
+ operator typename point<G,C>::vec () const; // Hack to help g++-2.95.
private:
const E& exact_() const;
@@ -226,6 +242,7 @@
const util::yes& cut_(const point<grid::tick,C>& p);
+
# ifndef MLN_INCLUDE_ONLY
namespace convert
@@ -430,7 +447,7 @@
template <typename G, typename C>
inline
- point<G,C>::operator algebra::vec<G::dim, float> () const
+ point<G,C>::operator typename internal::vec_of_point<G,C>::ret () const // Hack to help g++-2.95.
{
return to_vec();
}
@@ -521,7 +538,7 @@
template <typename G, typename C, typename E>
inline
- subject_point_impl< point<G,C>, E >::operator algebra::vec<G::dim, float>() const
+ subject_point_impl< point<G,C>, E >::operator typename point<G,C>::vec () const // Hack to help g++-2.95.
{
return exact_().get_subject();
}
@@ -530,7 +547,7 @@
template <typename G, typename C>
inline
- algebra::vec<point<G,C>::dim - 1, C>
+ const algebra::vec<point<G,C>::dim - 1, C>&
cut_(const point<G,C>& p)
{
return *(algebra::vec<point<G,C>::dim - 1, C>*)(& p.to_vec());
Index: mln/core/concept/pseudo_site.hh
--- mln/core/concept/pseudo_site.hh (revision 3948)
+++ mln/core/concept/pseudo_site.hh (working copy)
@@ -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,10 +29,13 @@
#ifndef MLN_CORE_CONCEPT_PSEUDO_SITE_HH
# define MLN_CORE_CONCEPT_PSEUDO_SITE_HH
-/*! \file mln/core/concept/pseudo_site.hh
- *
- * \brief Definition of the concept of mln::Pseudo_Site.
- */
+/// \file mln/core/concept/pseudo_site.hh
+///
+/// \brief Definition of the concept of mln::Pseudo_Site.
+///
+/// \todo Inconsistency: "if_possible::change_target" expects
+/// "::target_t" from a pseudo-site, whereas the concept checks for
+/// "::target".
# include <mln/core/concept/site_proxy.hh>
# include <mln/metal/is_a.hh>
Index: mln/core/category.hh
--- mln/core/category.hh (revision 3948)
+++ mln/core/category.hh (working copy)
@@ -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_CATEGORY_HH
# define MLN_CORE_CATEGORY_HH
-/*! \file mln/core/category.hh
- *
- * \brief Definition of the category holder type.
- */
+/// \file mln/core/category.hh
+///
+/// \brief Definition of the category holder type.
# include <mln/metal/equal.hh>
@@ -80,24 +80,35 @@
namespace internal
{
- template < typename Category, typename T >
- struct helper_super_category_;
+ // The code above could be merged into a couple of structures.
+ // Yet g++-2.95 needs help so we first decompose Category<S>
+ // into (Category, S) then we solve.
+
+ template < template <class> class Category, typename S, typename T >
+ struct helper_super_category_solve_
+ :
+ private metal::equal< typename Category<void>::super, void* >::check_t
+ {
+ // New case.
+ typedef S ret;
+ };
template < template <class> class Category, typename T >
- struct helper_super_category_< Category<void>, T >
+ struct helper_super_category_solve_< Category, void, T >
{
typedef typename Category<void>::super ret; // One super category: keep it.
};
+ template < typename Category, typename T >
+ struct helper_super_category_;
+
template < template <class> class Category, typename S, typename T >
- struct helper_super_category_< Category<S>, T >
- :
- private metal::equal< typename Category<void>::super, void* >::check_t
+ struct helper_super_category_< Category<S>, T > : helper_super_category_solve_< Category, S, T >
{
- // New case.
- typedef S ret;
};
+
+
// For bwd in-compatibility.
template < template <class> class Category, typename T >
struct helper_super_category_< Category<void*>, T >;
Index: mln/core/internal/exact.hh
--- mln/core/internal/exact.hh (revision 3948)
+++ mln/core/internal/exact.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,9 +29,9 @@
#ifndef MLN_CORE_INTERNAL_EXACT_HH
# define MLN_CORE_INTERNAL_EXACT_HH
-/*! \file mln/core/internal/exact.hh
- * \brief Meta-code for the mln::exact downcast routines.
- */
+/// \file mln/core/internal/exact.hh
+///
+/// \brief Meta-code for the mln::exact downcast routines.
/// Forward declaration.
@@ -88,7 +89,8 @@
struct exact_
{
enum { id = sizeof(exact_selector_(make_<T>::ptr())) };
- typedef typename exact_ret_<id, T>::ret ret;
+ typedef exact_ret_<id, T> helper;
+ typedef typename helper::ret ret;
static ret* run(T* t)
{
return exact_run_(t, t);
@@ -99,7 +101,8 @@
struct exact_<const T>
{
enum { id = sizeof(exact_selector_(make_<T>::ptr())) };
- typedef const typename exact_ret_<id, T>::ret ret;
+ typedef exact_ret_<id, T> helper;
+ typedef const typename helper::ret ret;
static ret* run(const T* t)
{
return exact_run_((T*)t, (T*)t);
@@ -109,6 +112,15 @@
# ifndef MLN_INCLUDE_ONLY
+ template <typename T>
+ inline
+ T*
+ make_<T>::ptr() // This piece of code is defined to prevent an ICE from g++-2.95.
+ {
+ T* tmp;
+ return tmp;
+ }
+
template <typename E, typename T>
inline
E* exact_run_(Object<E>* t, T*)
Index: mln/core/internal/check/image_fastest.hh
--- mln/core/internal/check/image_fastest.hh (revision 3948)
+++ mln/core/internal/check/image_fastest.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
@@ -31,18 +31,18 @@
/// \file mln/core/internal/check/image_fastest.hh
///
-/// Class that statically checks the interface of fastest
+/// \brief Class that statically checks the interface of fastest
/// images.
///
/// \todo Check and convert p in index_of_point towards E::psite.
-
# include <mln/metal/bool.hh>
# include <mln/core/macros.hh>
# include <mln/core/trait/pixter.hh>
# include <mln/core/trait/qlf_value.hh>
# include <mln/core/internal/force_exact.hh>
+
namespace mln
{
@@ -121,8 +121,10 @@
unsigned (E::*m8)() const = & E::nelements;
m8 = 0;
+# if defined(__GNUC__) && __GNUC__ >= 3
unsigned (E::*m9)(const psite& p) const = & E::index_of_point;
m9 = 0;
+# endif
// FIXME: how to check that qixter are defined when W is unknown!
}
Index: mln/core/internal/graph_psite_base.hh
--- mln/core/internal/graph_psite_base.hh (revision 3948)
+++ mln/core/internal/graph_psite_base.hh (working copy)
@@ -32,6 +32,9 @@
/// \file mln/core/internal/graph_psite_base.hh
///
/// Base implementation for graph based psites.
+///
+/// \todo Do not compile when id_t is unsigned (so the conversion
+/// operator is defined twice!)
# include <mln/core/internal/pseudo_site_base.hh>
@@ -309,7 +312,7 @@
template <typename S, typename E>
inline
- graph_psite_base<S,E>::operator unsigned() const
+ graph_psite_base<S,E>::operator unsigned() const // HERE
{
mln_precondition(is_valid());
return elt_.id();
Index: mln/core/internal/exact_gcc_2_95.hh
--- mln/core/internal/exact_gcc_2_95.hh (revision 0)
+++ mln/core/internal/exact_gcc_2_95.hh (revision 0)
@@ -0,0 +1,173 @@
+// 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_CORE_INTERNAL_EXACT_GCC_2_95_HH
+# define MLN_CORE_INTERNAL_EXACT_GCC_2_95_HH
+
+/// \file mln/core/internal/exact_gcc_2_95.hh
+///
+/// \brief Definition of the mln::exact downcast routines
+/// for g++-2.95.
+
+
+namespace mln
+{
+
+ namespace internal
+ {
+
+ // For exact(T&):
+
+ template <typename T>
+ struct exact_gcc_2_95
+ {
+ typedef mln_exact(T) E;
+ typedef E& ret;
+ static ret run(T& t)
+ {
+ return *internal::exact_<T>::run(&t);
+ }
+ };
+
+ template <typename T>
+ struct exact_gcc_2_95< const T >
+ {
+ typedef mln_exact(T) E;
+ typedef const E& ret;
+ static ret run(T& t)
+ {
+ return *internal::exact_<T>::run(const_cast<T*>(&t));
+ }
+ };
+
+ template <typename T>
+ struct exact_gcc_2_95< T* >
+ {
+ typedef mln_exact(T) E;
+ typedef E* ret;
+ static ret run(T* t)
+ {
+ return internal::exact_<T>::run(t);
+ }
+ };
+
+ template <typename T>
+ struct exact_gcc_2_95< const T* >
+ {
+ typedef mln_exact(T) E;
+ typedef const E* ret;
+ static ret run(const T* t)
+ {
+ return internal::exact_<T>::run(const_cast<T*>(t));
+ }
+ };
+
+
+
+ // For exact(const T&):
+
+ template <typename T>
+ struct exact_const_gcc_2_95
+ {
+ typedef mln_exact(T) E;
+ typedef const E& ret;
+ static ret run(T& t)
+ {
+ return *internal::exact_<T>::run(&t);
+ }
+ };
+
+ template <typename T>
+ struct exact_const_gcc_2_95< const T >
+ {
+ typedef mln_exact(T) E;
+ typedef const E& ret;
+ static ret run(T& t)
+ {
+ return *internal::exact_<T>::run(const_cast<T*>(&t));
+ }
+ };
+
+ template <typename T>
+ struct exact_const_gcc_2_95< T* >
+ {
+ typedef mln_exact(T) E;
+ typedef E* ret;
+ static ret run(T* t)
+ {
+ return internal::exact_<T>::run(t);
+ }
+ };
+
+ template <typename T>
+ struct exact_const_gcc_2_95< const T*const >
+ {
+ typedef mln_exact(T) E;
+ typedef const E* ret;
+ static ret run(T* t)
+ {
+ return internal::exact_<T>::run(const_cast<T*>(t));
+ }
+ };
+
+ template <typename T>
+ struct exact_const_gcc_2_95< const T* >
+ {
+ typedef mln_exact(T) E;
+ typedef const E* ret;
+ static ret run(const T* t)
+ {
+ return internal::exact_<T>::run(const_cast<T*>(t));
+ }
+ };
+
+
+ } // end of namespace mln::internal
+
+
+
+ template <typename T>
+ typename internal::exact_gcc_2_95<T>::ret
+ inline
+ exact(T& t)
+ {
+ return internal::exact_gcc_2_95<T>::run(t);
+ }
+
+ template <typename T>
+ typename internal::exact_const_gcc_2_95<T>::ret
+ inline
+ exact(const T& t)
+ {
+ return internal::exact_const_gcc_2_95<T>::run(const_cast<T&>(t));
+ }
+
+
+
+} // end of namespace mln
+
+#endif // ! MLN_CORE_INTERNAL_EXACT_GCC_2_95_HH
Index: mln/accu/transform_directional.hh
--- mln/accu/transform_directional.hh (revision 3948)
+++ mln/accu/transform_directional.hh (working copy)
@@ -31,7 +31,7 @@
/// \file mln/accu/transform_directional.hh
///
-/// Run an accumulator over a particular direction.
+/// \brief Run an accumulator over a particular direction.
///
/// \todo Split dispatch and impl.
///
@@ -123,7 +123,9 @@
const W& win;
mln_ch_value(I, mln_result(A)) output;
A accu;
- enum { dim = I::site::dim };
+
+ typedef mln_site(I) S; // Help g++-2.95.
+ enum { dim = S::dim };
mln_psite(I) p;
unsigned dir;
Index: mln/accu/transform_diagonal.hh
--- mln/accu/transform_diagonal.hh (revision 3948)
+++ mln/accu/transform_diagonal.hh (working copy)
@@ -31,7 +31,7 @@
/// \file mln/accu/transform_diagonal.hh
///
-/// Run an accumulator over a diagonal.
+/// \brief Run an accumulator over a diagonal.
///
/// \todo Split dispatch and impl.
///
@@ -114,7 +114,8 @@
A accu;
mln_psite(I) p;
- enum { dim = I::site::dim };
+ typedef mln_site(I) S; // Help g++-2.95.
+ enum { dim = S::dim };
window2d win_left, win_right;
Index: mln/accu/transform_snake.hh
--- mln/accu/transform_snake.hh (revision 3948)
+++ mln/accu/transform_snake.hh (working copy)
@@ -31,7 +31,7 @@
/// \file mln/accu/transform_snake.hh
///
-/// Run an accumulator in a snake-like browsing.
+/// \brief Run an accumulator in a snake-like browsing.
///
/// \todo Make it n-D.
///
Index: mln/value/internal/gray_.hh
--- mln/value/internal/gray_.hh (revision 3948)
+++ mln/value/internal/gray_.hh (working copy)
@@ -232,7 +232,7 @@
inline
long convert(int val)
{
- using typename mln::metal::int_;
+ using mln::metal::int_;
typedef mlc_max(int_<n_dest - n_src> , int_<n_src - n_dest>) m;
if (n_dest == n_src)
Index: mln/convert/to_p_array.hh
--- mln/convert/to_p_array.hh (revision 3948)
+++ mln/convert/to_p_array.hh (working copy)
@@ -31,7 +31,7 @@
/// \file mln/convert/to_p_array.hh
///
-/// Conversions to mln::p_array.
+/// \brief Conversions to mln::p_array.
///
/// \todo Move these conversion in from_to related mechanisms.
@@ -59,7 +59,7 @@
/// Convert an image \p img into a p_array.
template <typename I>
- p_array<mln_point(I)>
+ p_array<mln_psite(I)>
to_p_array(const Image<I>& img);
Index: mln/binarization/binarization.hh
--- mln/binarization/binarization.hh (revision 3948)
+++ mln/binarization/binarization.hh (working copy)
@@ -31,7 +31,9 @@
/// \file mln/binarization/threshold.hh
///
-/// Threshold the contents of an image into another binary one.
+/// \brief Threshold an image.
+///
+/// \todo Rename and/or remove (that is this?)
# include <mln/core/concept/function.hh>
# include <mln/data/transform.hh>
@@ -52,7 +54,7 @@
/// for_all(p), output(p) = fun(p)
template <typename I, typename F>
inline
- mln_concrete_ch_value(I, bool)
+ mln_ch_value(I, bool)
binarization(const Image<I>& input, const Function_v2b<F>& fun);
@@ -63,11 +65,11 @@
template <typename I, typename F>
inline
- mln_concrete_ch_value(I, bool)
+ mln_ch_value(I, bool)
binarization_(const I& input, const Function_v2b<F>& fun)
{
trace::entering("binarization::impl::binarization_");
- mln_concrete_ch_value(I, bool) output(input.domain());
+ mln_ch_value(I, bool) output(input.domain());
output = data::transform(input, fun);
@@ -83,13 +85,13 @@
template <typename I, typename F>
inline
- mln_concrete_ch_value(I, bool)
+ mln_ch_value(I, bool)
binarization(const Image<I>& input, const Function_v2b<F>& fun)
{
trace::entering("binarization::binarization");
mln_precondition(exact(input).is_valid());
- mln_concrete_ch_value(I, bool) output(exact(input).domain());
+ mln_ch_value(I, bool) output(exact(input).domain());
output = impl::binarization_(exact(input), fun);
trace::exiting("binarization::binarization");
Index: mln/binarization/threshold.hh
--- mln/binarization/threshold.hh (revision 3948)
+++ mln/binarization/threshold.hh (working copy)
@@ -31,7 +31,7 @@
/// \file mln/binarization/threshold.hh
///
-/// Threshold the contents of an image into another binary one.
+/// \brief Threshold an image.
# include <mln/binarization/binarization.hh>
# include <mln/fun/v2b/threshold.hh>
@@ -52,7 +52,7 @@
/// If input(p) is greater or equal than the threshold, the
/// value in the output image in the same point will be TRUE, else FALSE.
template <typename I>
- mln_concrete_ch_value(I, bool)
+ mln_ch_value(I, bool)
threshold(const Image<I>& input, const mln_value(I) threshold);
@@ -60,7 +60,7 @@
template <typename I>
inline
- mln_concrete_ch_value(I, bool)
+ mln_ch_value(I, bool)
threshold(const Image<I>& input, const mln_value(I) threshold_value)
{
trace::entering("binarization::threshold");
@@ -69,12 +69,12 @@
mlc_is(mln_trait_value_nature(mln_value(I)),
trait::value::nature::scalar)::check();
- mln_concrete_ch_value(I, bool) output(exact(input).domain());
+ mln_ch_value(I, bool) output(exact(input).domain());
// FIXME : threshold value should be a percentage.
fun::v2b::threshold< mln_value(I) > f(threshold_value);
- output = binarization::binarization(exact(input), f);
+ output = mln::binarization::binarization(exact(input), f);
trace::exiting("binarization::threshold");
return output;
Index: mln/canvas/browsing/backdiagonal2d.hh
--- mln/canvas/browsing/backdiagonal2d.hh (revision 3948)
+++ mln/canvas/browsing/backdiagonal2d.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
@@ -31,11 +31,12 @@
/// \file mln/canvas/browsing/backdiagonal2d.hh
///
-/// Backdiagonal2d browsing of an image.
+/// \brief Backdiagonal2d browsing of an image.
# include <mln/core/concept/browsing.hh>
# include <mln/core/concept/image.hh>
+
namespace mln
{
@@ -89,6 +90,8 @@
extern const backdiagonal2d_t backdiagonal2d;
+
+
# ifndef MLN_INCLUDE_ONLY
const backdiagonal2d_t backdiagonal2d;
Index: mln/canvas/browsing/internal/graph_first_search.hh
--- mln/canvas/browsing/internal/graph_first_search.hh (revision 3948)
+++ mln/canvas/browsing/internal/graph_first_search.hh (working copy)
@@ -30,8 +30,10 @@
/// \file mln/canvas/browsing/internal/graph_first_search.hh
///
-/// Depth-limited search algorithm for graph.
-/// Browse over all vertices for each component.
+/// \brief Depth-limited search algorithm for graph. Browse over all
+/// vertices for each component.
+///
+/// \todo Code "next(const S& stack)".
/*!
** The functor should provide the following methods:
@@ -126,8 +128,9 @@
util::vertex_id_t
next(const S& stack)
{
+ mln_assertion(0);
/// Not defined yet!
- mlc_abort(S)::check();
+ // mlc_abort(S)::check();
return 0;
}
Index: mln/labeling/compute.hh
--- mln/labeling/compute.hh (revision 3948)
+++ mln/labeling/compute.hh (working copy)
@@ -31,8 +31,8 @@
/// \file mln/labeling/compute.hh
///
-/// Compute accumulators onto sites/values of each labeled component
-/// of an image.
+/// \brief Compute accumulators onto sites/values of each labeled
+/// component of an image.
///
/// \todo write fastest version.
///
Index: tests/core/image/imorph/tr_image.cc
--- tests/core/image/imorph/tr_image.cc (revision 3948)
+++ tests/core/image/imorph/tr_image.cc (working copy)
@@ -28,11 +28,12 @@
/// \file tests/core/image/imorph/tr_image.cc
///
-/// Tests on mln::tr_image.
-/// FIXME: write a real test!
-
+/// \brief Tests on mln::tr_image.
+///
+/// \todo Write an effective test!
#include <iostream>
+
#include <mln/fun/x2x/rotation.hh>
#include <mln/core/image/image3d.hh>
#include <mln/value/int_u8.hh>
@@ -40,6 +41,7 @@
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
+
int main()
{
using namespace mln;
Index: tests/core/image/imorph/labeled_image.cc
--- tests/core/image/imorph/labeled_image.cc (revision 3948)
+++ tests/core/image/imorph/labeled_image.cc (working copy)
@@ -28,24 +28,20 @@
/// \file tests/core/image/imorph/labeled_image.cc
///
-/// Tests on mln::labeled_image.
-
+/// \brief Tests on mln::labeled_image.
#include <mln/core/image/image2d.hh>
#include <mln/core/image/imorph/labeled_image.hh>
#include <mln/core/routine/duplicate.hh>
-
#include <mln/make/image.hh>
-
#include <mln/make/box2d.hh>
-
#include <mln/value/label_8.hh>
-
#include <mln/accu/pair.hh>
#include <mln/accu/center.hh>
#include <mln/accu/bbox.hh>
+
static const unsigned bboxes_1[][4] = { { 1,1, 1,1 },
{ 2,0, 2,1 },
{ 0,0, 0,1 },
@@ -59,7 +55,6 @@
-
namespace mln
{
@@ -106,5 +101,4 @@
lbl_i.relabel(f);
test_image(lbl_i, bboxes_2);
-
}
Index: tests/core/routine/exact.cc
--- tests/core/routine/exact.cc (revision 3948)
+++ tests/core/routine/exact.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,25 +26,178 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/core/routine/exact.cc
- *
- * \brief Tests on mln::exact.
- */
+/// \file tests/core/routine/exact.cc
+///
+/// \brief Tests on mln::exact.
#include <typeinfo>
#include <mln/core/routine/exact.hh>
+
struct test : mln::Object< test >
{
};
+namespace mln
+{
+
+ template <typename E>
+ struct Base : Object<E>
+ {
+ void m()
+ {
+ int** i = exact(this)->m_impl();
+ }
+ void m() const
+ {
+ int* i = exact(this)->m_impl();
+ }
+ };
+
+ struct concrete : Base< concrete >
+ {
+ int** m_impl() { return 0; }
+ int* m_impl() const { return 0; }
+ };
+
+}
+
+
int main()
{
using namespace mln;
- test t;
- Object<test>& t_ = t;
- mln_assertion(typeid(exact(t_)).name() == typeid(exact(t)).name());
+ {
+
+ concrete c;
+ Base<concrete>& b = c;
+ b.m();
+ const Base<concrete>& bb = c;
+ bb.m();
+
+ }
+
+
+// -----------------------------------
+
+// test t;
+// Object<test>& t_ = t;
+// mln_assertion(typeid(exact(t_)).name() == typeid(exact(t)).name());
+
+// {
+// int i;
+// exact(i); // `int' from `float'
+// exact(&i); // `int *' from `const double'
+// }
+// {
+// const int j = 0;
+// exact(j); // `int' from `const double'
+// exact(&j); // `const int *' from `const double
+// }
+
+// {
+// int i;
+// int& j = i;
+// exact(j); // `int' from `float'
+// exact(&j); // `int *' from `const double'
+// }
+// {
+// int i;
+// const int& j = i;
+// exact(j); // `int' from `const double'
+// exact(&j); // `const int *' from `const double'
+// }
+
+// {
+// int* i;
+// exact(i); // `int *' from `float'
+// exact(*i); // `int' from `float'
+// int *const j = 0;
+// exact(j); // `int *' from `const double'
+// exact(*j); `int' from `float'
+// }
+
+// {
+// const int* i;
+// exact(i); // `const int *' from `float'
+// exact(*i); // `int' from `const double'
+// const int *const j = 0;
+// exact(j); // `const int *' from `const double'
+// exact(*j); `int' from `const double'
+// }
+
+
+// -----------------------------------
+
+
+// {
+// int i;
+// exact(&i); // `int *' from `const double'
+// }
+// {
+// const int j = 0;
+// exact(j); // `int' from `const double'
+// exact(&j); // `const int *' from `const double
+// }
+
+// {
+// int i;
+// int& j = i;
+// exact(&j); // `int *' from `const double'
+// }
+// {
+// int i;
+// const int& j = i;
+// exact(j); // `int' from `const double'
+// exact(&j); // `const int *' from `const double'
+// }
+
+// {
+// int *const j = 0;
+// exact(j); // `int *' from `const double'
+// }
+
+// {
+// const int* i;
+// exact(*i); // `int' from `const double'
+// const int *const j = 0;
+// exact(j); // `const int *' from `const double'
+// exact(*j); // `int' from `const double'
+// }
+
+
+// -----------------------------------
+
+
+// {
+// int* i;
+// exact(i);
+// }
+
+// {
+// int i;
+// exact(i); // `int' from `float'
+// }
+
+// {
+// int i;
+// int& j = i;
+// exact(j); // `int' from `float'
+// }
+
+// {
+// int* i;
+// exact(i); // `int *' from `float'
+// exact(*i); // `int' from `float'
+// int *const j = 0;
+// exact(*j); // `int' from `float'
+// }
+
+// {
+// const int* i;
+// exact(i); // `const int *' from `float'
+// }
+
}
Index: tests/accu/site_set/rectangularity.cc
--- tests/accu/site_set/rectangularity.cc (revision 3948)
+++ tests/accu/site_set/rectangularity.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory
+// 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
@@ -36,6 +36,7 @@
#include <mln/accu/site_set/rectangularity.hh>
#include <mln/set/compute.hh>
+
int main()
{
using namespace mln;
@@ -59,7 +60,7 @@
{
box2d b(2,2);
- float r = set::compute(accu::site_set::rectangularity<point2d>(), b);
+ float r = mln::set::compute(accu::site_set::rectangularity<point2d>(), b);
mln_assertion(r == 1.0f);
}
Index: tests/accu/compute.cc
--- tests/accu/compute.cc (revision 3948)
+++ tests/accu/compute.cc (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
@@ -28,7 +28,7 @@
/// \file tests/accu/compute.cc
///
-/// Tests on mln::accu::compute.
+/// \brief Tests on mln::accu::compute.
#include <mln/core/image/image2d.hh>
#include <mln/value/int_u8.hh>
@@ -40,7 +40,7 @@
int main()
{
using namespace mln;
- using typename value::int_u8;
+ using value::int_u8;
unsigned n = 3;
image2d<int_u8> ima(n, n);
Index: tests/canvas/browsing/fwd.cc
--- tests/canvas/browsing/fwd.cc (revision 3948)
+++ tests/canvas/browsing/fwd.cc (working copy)
@@ -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
@@ -27,7 +28,7 @@
/// \file tests/canvas/browsing/fwd.cc
///
-/// Tests on mln::canvas::browsing::fwd.hh
+/// \brief Tests on mln::canvas::browsing::fwd.hh
#include <mln/core/image/image2d.hh>
#include <mln/canvas/browsing/fwd.hh>
@@ -39,8 +40,8 @@
struct assign_browsing_functor
{
typedef I_ I;
- enum { dim = I::site::dim };
-
+ typedef mln_site(I) S;
+ enum { dim = S::dim };
I input;
F f;
Index: tests/canvas/browsing/snake_fwd.cc
--- tests/canvas/browsing/snake_fwd.cc (revision 3948)
+++ tests/canvas/browsing/snake_fwd.cc (working copy)
@@ -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
@@ -27,7 +28,7 @@
/// \file tests/canvas/browsing/snake_fwd.cc
///
-/// Tests on mln::canvas::browsing::snake_fwd.
+/// \brief Tests on mln::canvas::browsing::snake_fwd.
#include <mln/core/image/image2d.hh>
#include <mln/canvas/browsing/snake_fwd.hh>
@@ -38,8 +39,8 @@
template <typename I, typename F>
struct assign_browsing_functor
{
- enum { dim = I::site::dim };
-
+ typedef mln_site(I) S;
+ enum { dim = S::dim };
I input;
F f;
Index: tests/canvas/browsing/snake_vert.cc
--- tests/canvas/browsing/snake_vert.cc (revision 3948)
+++ tests/canvas/browsing/snake_vert.cc (working copy)
@@ -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
@@ -27,21 +28,23 @@
/// \file tests/canvas/browsing/snake_vert.cc
///
-/// Tests on mln::canvas::browsing::snake_vert.
+/// \brief Tests on mln::canvas::browsing::snake_vert.
#include <mln/core/image/image2d.hh>
#include <mln/canvas/browsing/snake_vert.hh>
#include <mln/fun/p2v/iota.hh>
#include <mln/debug/println.hh>
+
unsigned res[2][7] = { { 1, 4, 5, 8, 9, 12, 13 },
{ 2, 3, 6, 7, 10, 11, 14 } };
+
template <typename I, typename F>
struct assign_browsing_functor
{
- enum { dim = I::site::dim };
-
+ typedef mln_site(I) S;
+ enum { dim = S::dim };
I input;
F f;
Index: tests/canvas/browsing/snake_generic_2d_vert.cc
--- tests/canvas/browsing/snake_generic_2d_vert.cc (revision 3948)
+++ tests/canvas/browsing/snake_generic_2d_vert.cc (working copy)
@@ -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
@@ -25,20 +26,21 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/canvas/browsing/snake_generic_2d_vert.cc
- *
- * \brief Tests on mln::canvas::browsing::snake_generic.
- */
+/// \file tests/canvas/browsing/snake_generic_2d_vert.cc
+///
+/// \brief Tests on mln::canvas::browsing::snake_generic.
#include <mln/core/image/image2d.hh>
#include <mln/canvas/browsing/snake_generic.hh>
#include <mln/fun/p2v/iota.hh>
#include <mln/debug/println.hh>
+
template <typename I, typename F>
struct assign_browsing_functor
{
- enum { dim = I::site::dim };
+ typedef mln_site(I) S;
+ enum { dim = S::dim };
typedef assign_browsing_functor<I, F> self;
typedef mln_deduce(I, psite, delta) dpsite;
Index: tests/canvas/browsing/snake_generic_2d_hori.cc
--- tests/canvas/browsing/snake_generic_2d_hori.cc (revision 3948)
+++ tests/canvas/browsing/snake_generic_2d_hori.cc (working copy)
@@ -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
@@ -25,20 +26,21 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/canvas/browsing/snake_generic_3d_hori.cc
- *
- * \brief Tests on mln::canvas::browsing::snake_generic.
- */
+/// \file tests/canvas/browsing/snake_generic_3d_hori.cc
+///
+/// \brief Tests on mln::canvas::browsing::snake_generic.
#include <mln/core/image/image2d.hh>
#include <mln/canvas/browsing/snake_generic.hh>
#include <mln/fun/p2v/iota.hh>
#include <mln/debug/println.hh>
+
template <typename I, typename F>
struct assign_browsing_functor
{
- enum { dim = I::site::dim };
+ typedef mln_site(I) S;
+ enum { dim = S::dim };
typedef assign_browsing_functor<I, F> self;
typedef mln_deduce(I, psite, delta) dpsite;
Index: tests/canvas/browsing/snake_generic_3d_vert.cc
--- tests/canvas/browsing/snake_generic_3d_vert.cc (revision 3948)
+++ tests/canvas/browsing/snake_generic_3d_vert.cc (working copy)
@@ -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
@@ -25,20 +26,21 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/canvas/browsing/snake_generic_3d_vert.cc
- *
- * \brief Tests on mln::canvas::browsing::snake_generic.
- */
+/// \file tests/canvas/browsing/snake_generic_3d_vert.cc
+///
+/// \brief Tests on mln::canvas::browsing::snake_generic.
#include <mln/core/image/image3d.hh>
#include <mln/canvas/browsing/snake_generic.hh>
#include <mln/fun/p2v/iota.hh>
#include <mln/debug/println.hh>
+
template <typename I, typename F>
struct assign_browsing_functor
{
- enum { dim = I::site::dim };
+ typedef mln_site(I) S;
+ enum { dim = S::dim };
typedef assign_browsing_functor<I, F> self;
typedef mln_deduce(I, psite, delta) dpsite;
Index: tests/canvas/browsing/snake_generic_3d_hori.cc
--- tests/canvas/browsing/snake_generic_3d_hori.cc (revision 3948)
+++ tests/canvas/browsing/snake_generic_3d_hori.cc (working copy)
@@ -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
@@ -25,20 +26,21 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/canvas/browsing/snake_generic_3d_hori.cc
- *
- * \brief Tests on mln::canvas::browsing::snake_generic.
- */
+/// \file tests/canvas/browsing/snake_generic_3d_hori.cc
+///
+/// \brief Tests on mln::canvas::browsing::snake_generic.
#include <mln/core/image/image3d.hh>
#include <mln/canvas/browsing/snake_generic.hh>
#include <mln/fun/p2v/iota.hh>
#include <mln/debug/println.hh>
+
template <typename I, typename F>
struct assign_browsing_functor
{
- enum { dim = I::site::dim };
+ typedef mln_site(I) S;
+ enum { dim = S::dim };
typedef assign_browsing_functor<I, F> self;
typedef mln_deduce(I, psite, delta) dpsite;
Index: tests/canvas/browsing/hyper_directional.cc
--- tests/canvas/browsing/hyper_directional.cc (revision 3948)
+++ tests/canvas/browsing/hyper_directional.cc (working copy)
@@ -41,7 +41,8 @@
struct assign_browsing_functor
{
typedef I_ I;
- enum { dim = I::site::dim };
+ typedef mln_site(I) S;
+ enum { dim = S::dim };
I input;
Index: tests/canvas/browsing/diagonal2d.cc
--- tests/canvas/browsing/diagonal2d.cc (revision 3948)
+++ tests/canvas/browsing/diagonal2d.cc (working copy)
@@ -40,7 +40,8 @@
struct assign_browsing_functor
{
typedef I_ I;
- enum { dim = I::site::dim };
+ typedef mln_site(I) S;
+ enum { dim = S::dim };
typedef assign_browsing_functor<I, F> self;
typedef mln_deduce(I, psite, delta) dpsite;
Index: tests/canvas/browsing/backdiagonal2d.cc
--- tests/canvas/browsing/backdiagonal2d.cc (revision 3948)
+++ tests/canvas/browsing/backdiagonal2d.cc (working copy)
@@ -35,11 +35,13 @@
#include <mln/fun/p2v/iota.hh>
#include <mln/debug/println.hh>
+
template <typename I_, typename F>
struct assign_browsing_functor
{
typedef I_ I;
- enum { dim = I::site::dim };
+ typedef mln_site(I) S;
+ enum { dim = S::dim };
typedef assign_browsing_functor<I, F> self;
typedef mln_deduce(I, psite, delta) dpsite;
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Improve g++-2.95 compatibility.
* garrigues/fllt/test_fllt10.cc,
* garrigues/fllt/test_fllt12.cc,
* garrigues/fllt/test_fllt10_inv.cc,
* garrigues/fllt/test_fllt7.cc,
* garrigues/fllt/test_fllt9.cc,
* garrigues/fllt/test_flltb.cc,
* garrigues/fllt/test_fllt7_inv.cc,
* garrigues/fllt/test_fllt13.cc,
* garrigues/fllt/test_fllt15.cc,
* garrigues/fllt/test_fllt8.cc (using): Remove useless typename.
That makes files compile with g++-2.95.
* inim/2009/binarization/binarization.hh
(mln_concrete_ch_value): Replace by...
(mln_ch_value): ...this.
garrigues/fllt/test_fllt10.cc | 2 +-
garrigues/fllt/test_fllt10_inv.cc | 2 +-
garrigues/fllt/test_fllt12.cc | 2 +-
garrigues/fllt/test_fllt13.cc | 2 +-
garrigues/fllt/test_fllt15.cc | 2 +-
garrigues/fllt/test_fllt7.cc | 2 +-
garrigues/fllt/test_fllt7_inv.cc | 2 +-
garrigues/fllt/test_fllt8.cc | 2 +-
garrigues/fllt/test_fllt9.cc | 2 +-
garrigues/fllt/test_flltb.cc | 2 +-
inim/2009/binarization/binarization.hh | 10 +++++-----
11 files changed, 15 insertions(+), 15 deletions(-)
Index: garrigues/fllt/test_fllt10.cc
--- garrigues/fllt/test_fllt10.cc (revision 3947)
+++ garrigues/fllt/test_fllt10.cc (working copy)
@@ -17,7 +17,7 @@
{
using namespace mln;
- using typename value::int_u8;
+ using value::int_u8;
int vs[5][10] = { {3, 3, 3, 3, 3, 4, 4, 4, 4, 4},
{3, 4, 4, 4, 3, 4, 3, 3, 3, 4},
Index: garrigues/fllt/test_fllt12.cc
--- garrigues/fllt/test_fllt12.cc (revision 3947)
+++ garrigues/fllt/test_fllt12.cc (working copy)
@@ -17,7 +17,7 @@
{
using namespace mln;
- using typename value::int_u8;
+ using value::int_u8;
int vs[4][5] = { {4, 4, 2, 2, 2},
{4, 3, 1, 2, 2},
Index: garrigues/fllt/test_fllt10_inv.cc
--- garrigues/fllt/test_fllt10_inv.cc (revision 3947)
+++ garrigues/fllt/test_fllt10_inv.cc (working copy)
@@ -17,7 +17,7 @@
{
using namespace mln;
- using typename value::int_u8;
+ using value::int_u8;
int vs[5][10] = { {0, 0, 0, 0, 0, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 0, 1, 0, 0, 0, 1},
Index: garrigues/fllt/test_fllt7.cc
--- garrigues/fllt/test_fllt7.cc (revision 3947)
+++ garrigues/fllt/test_fllt7.cc (working copy)
@@ -17,7 +17,7 @@
{
using namespace mln;
- using typename value::int_u8;
+ using value::int_u8;
int ws[49] = {101, 101, 101, 191, 204, 255, 191,
101, 101, 191, 204, 204, 204, 204,
Index: garrigues/fllt/test_fllt9.cc
--- garrigues/fllt/test_fllt9.cc (revision 3947)
+++ garrigues/fllt/test_fllt9.cc (working copy)
@@ -17,7 +17,7 @@
{
using namespace mln;
- using typename value::int_u8;
+ using value::int_u8;
int vs[5][5] = { {100, 100, 100, 100, 100},
{100, 200, 255, 200, 100},
Index: garrigues/fllt/test_flltb.cc
--- garrigues/fllt/test_flltb.cc (revision 3947)
+++ garrigues/fllt/test_flltb.cc (working copy)
@@ -17,7 +17,7 @@
{
using namespace mln;
- using typename value::int_u8;
+ using value::int_u8;
// int vs[3][6] = { {0, 0, 0, 1, 1, 1},
// {0, 1, 0, 1, 0, 1},
Index: garrigues/fllt/test_fllt7_inv.cc
--- garrigues/fllt/test_fllt7_inv.cc (revision 3947)
+++ garrigues/fllt/test_fllt7_inv.cc (working copy)
@@ -17,7 +17,7 @@
{
using namespace mln;
- using typename value::int_u8;
+ using value::int_u8;
int vs[5][5] = { {200, 100, 100, 100, 200},
{200, 100, 0 , 100, 200},
Index: garrigues/fllt/test_fllt13.cc
--- garrigues/fllt/test_fllt13.cc (revision 3947)
+++ garrigues/fllt/test_fllt13.cc (working copy)
@@ -17,7 +17,7 @@
{
using namespace mln;
- using typename value::int_u8;
+ using value::int_u8;
int vs[5][8] = { { 1, 1, 1, 1, 1, 1, 1, 4 },
{ 1, 4, 1, 1, 1, 1, 4, 1 },
Index: garrigues/fllt/test_fllt15.cc
--- garrigues/fllt/test_fllt15.cc (revision 3947)
+++ garrigues/fllt/test_fllt15.cc (working copy)
@@ -17,7 +17,7 @@
{
using namespace mln;
- using typename value::int_u8;
+ using value::int_u8;
// int vs[3][6] = { {0, 0, 0, 1, 1, 1},
// {0, 1, 0, 1, 0, 1},
Index: garrigues/fllt/test_fllt8.cc
--- garrigues/fllt/test_fllt8.cc (revision 3947)
+++ garrigues/fllt/test_fllt8.cc (working copy)
@@ -17,7 +17,7 @@
{
using namespace mln;
- using typename value::int_u8;
+ using value::int_u8;
int vs[3][6] = { {0, 0, 0, 1, 1, 1},
{0, 1, 0, 1, 0, 1},
Index: inim/2009/binarization/binarization.hh
--- inim/2009/binarization/binarization.hh (revision 3947)
+++ inim/2009/binarization/binarization.hh (working copy)
@@ -16,18 +16,18 @@
namespace binarization
{
template<typename I, typename W>
- mln_concrete_ch_value(I, bool)
+ mln_ch_value(I, bool)
binarization(const Image<I>& input, const Window<W>& win, int strength);
# ifndef MLN_INCLUDE_ONLY
namespace impl
{
template<typename I, typename W>
- mln_concrete_ch_value(I, bool)
+ mln_ch_value(I, bool)
binarization_(const I& input, const W& win, int strength)
{
trace::entering("binarisation_");
- mln_concrete_ch_value(I, bool) output(input.domain());
+ mln_ch_value(I, bool) output(input.domain());
histo::data<mln_value(I)> hist = histo::compute (input);
image1d<std::size_t> hist_img = convert::to_image(hist);
@@ -58,13 +58,13 @@
}
template<typename I, typename W>
- mln_concrete_ch_value(I, bool)
+ mln_ch_value(I, bool)
binarization(const Image<I>& input, const Window<W>& win, int strength)
{
trace::entering("binarisation");
mln_precondition(exact(input).is_valid());
- mln_concrete_ch_value(I, bool) output(exact(input).domain());
+ mln_ch_value(I, bool) output(exact(input).domain());
output = impl::binarization_(exact(input), exact(win), strength);
trace::exiting("binarisation");
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
ChangeLog:
2009-06-02 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Add mean images output.
* fabien/igr/check_dist.sh: New script for testing dist_edges.
* fabien/igr/check_edges.sh: New script for testing
distance and watershed computation.
* fabien/igr/dist_edges.cc: Small update.
* fabien/igr/mean_median_label.cc: Output images.
* fabien/igr/tmax.sh: New script for testing.
* fabien/igr/wst_edges.cc: Small update.
---
check_dist.sh | 19 +++++++++++++++++
check_edges.sh | 43 ++++++++++++++++++++++++++++++++++++++
dist_edges.cc | 8 +++----
mean_median_label.cc | 57 +++++++++++++++++++++++++++++++--------------------
tmax.sh | 23 ++++++++++++++++++++
wst_edges.cc | 3 +-
6 files changed, 126 insertions(+), 27 deletions(-)
Index: trunk/milena/sandbox/fabien/igr/mean_median_label.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/mean_median_label.cc (revision 3946)
+++ trunk/milena/sandbox/fabien/igr/mean_median_label.cc (revision 3947)
@@ -86,6 +86,18 @@
filename);
}
+ template <typename I>
+ void io_save_edges_float(const I& input,
+ value::int_u8 bg,
+ const std::string& filename)
+ {
+ mln_ch_value(I, value::int_u8) output = data::stretch(int_u8(), input);
+ io::pgm::save(world::inter_pixel::display_edge(output.unmorph_(),
+ bg,
+ 3),
+ filename);
+ }
+
} // end of namespace mln
@@ -96,29 +108,34 @@
int usage(const char* bin)
{
- std::cout << "Usage: " << bin << " input.dump wst.dump" << std::endl;
+ std::cout << "Usage: " << bin << " dist.dump wst.dump nbasins" << std::endl;
return 1;
}
int main(int argc, char* argv[])
{
- if (argc != 3)
+ if (argc != 4)
return usage(argv[0]);
+ label_16 nbasins = atoi(argv[3]);
// Initialization.
typedef float input_type;
- image2d<input_type> input;
- io::dump::load(input, argv[1]);
- image2d<label_16> wst;
- io::dump::load(input`, argv[1]);
+ image2d<int_u12> dist_input;
+ io::dump::load(dist_input, argv[1]);
+ mln_VAR(dist, dist_input | world::inter_pixel::is_separator());
+
+ image2d<label_16> wst_input;
+ io::dump::load(wst_input, argv[2]);
+ mln_VAR(wst, wst_input | world::inter_pixel::is_separator());
+
// Mean distance.
- accu::mean<E_TYPE> accu_mean;
- util::array<float> means = labeling::compute(accu_mean, e, wst, nbasins);
+ accu::mean<input_type> accu_mean;
+ util::array<float> means = labeling::compute(accu_mean, dist, wst, nbasins);
// Display.
{
@@ -127,13 +144,12 @@
initialize(ima_means, wst);
data::paste(wst, ima_means);
for (unsigned i = 1; i < means.nelements(); ++i)
- data::fill((ima_means | pw::value(ima_means) == pw::cst(i)).rw(), means[i]);
- mln_VAR(display_means, world::inter_pixel::display_edge(ima_means.unmorph_(), 0.0, 3));
- io::pgm::save(level::stretch(int_u8(), display_means), "means.pgm");
+ data::fill((ima_means | pw::value(ima_means) == pw::cst(i)).rw(), (unsigned) means[i]);
+ io_save_edges_float(ima_means, 0u, "means.pgm");
}
- typedef accu::mean<int_u12,float,int_u12> A;
- util::array<int_u12> m = labeling::compute(A(), d, wst, nbasins);
+ typedef accu::mean<input_type> A;
+ util::array<input_type> m = labeling::compute(A(), dist, wst, nbasins);
{
util::array<int_u8> m_(nbasins.next());
@@ -141,14 +157,12 @@
for (unsigned l = 1; l <= nbasins; ++l)
{
m_[l] = m[l] / 16;
- if (m_[l] < 2) m_[l] == 2;
+ if (m_[l] < 2u)
+ m_[l] = 2u;
// basin <=> 2..255
}
- mln_VAR(d_m, level::transform(wst, m_));
- mln_VAR(out, world::inter_pixel::display_edge(d_m.unmorph_(),
- 0, // background <=> 0
- 3));
- io::pgm::save(out, "dist_mean.pgm");
+ mln_VAR(d_m, data::transform(wst, m_));
+ io_save_edges_float(d_m, 0u, "dist_mean.pgm");
}
@@ -157,7 +171,7 @@
util::array<accu::stat::deviation<float> > arr_dev;
for (unsigned i = 0; i < means.nelements(); ++i)
arr_dev.append(accu::stat::deviation<float> (means[i]));
- util::array<float> deviations = labeling::compute(arr_dev, e, wst, nbasins);
+ util::array<float> deviations = labeling::compute(arr_dev, dist, wst, nbasins);
// Display.
{
@@ -167,8 +181,7 @@
data::paste(wst, ima_dev);
for (unsigned i = 1; i < deviations.nelements(); ++i)
data::fill((ima_dev | pw::value(ima_dev) == pw::cst(i)).rw(), deviations[i]);
- mln_VAR(display_dev, world::inter_pixel::display_edge(ima_dev.unmorph_(), 0.0, 3));
- io::pgm::save(level::stretch(int_u8(), display_dev), "dev.pgm");
+ io_save_edges_float(ima_dev, 0u, "dev.pgm");
}
Index: trunk/milena/sandbox/fabien/igr/tmax.sh
===================================================================
--- trunk/milena/sandbox/fabien/igr/tmax.sh (revision 0)
+++ trunk/milena/sandbox/fabien/igr/tmax.sh (revision 3947)
@@ -0,0 +1,23 @@
+#!/bin/zsh
+
+
+process_file ()
+{
+ echo "Processing $1..." | cowsay
+ input=$1
+ dim=$2
+
+ ./crop $input 0 50 90 149 230 170 crop.dump
+ ./norm crop.dump norm.dump
+ ./time_max_norm norm.dump
+
+ convert tmax_max.pgm tmax_max.png
+ convert tmax_smooth_max.pgm tmax_smooth_max.png
+ convert tmax_time.pgm tmax_time.png
+ convert tmax_smooth_time.pgm tmax_smooth_time.png
+ rm tmax_*.pgm
+}
+
+# 3D (2D + t) images only
+make crop norm time_max_norm
+process_file "/Users/HiSoKa/Work/IGR/souris18/irm/IM_0052.dcm" 3 52
Property changes on: trunk/milena/sandbox/fabien/igr/tmax.sh
___________________________________________________________________
Name: svn:executable
+ *
Index: trunk/milena/sandbox/fabien/igr/check_edges.sh
===================================================================
--- trunk/milena/sandbox/fabien/igr/check_edges.sh (revision 0)
+++ trunk/milena/sandbox/fabien/igr/check_edges.sh (revision 3947)
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+
+process ()
+{
+ ./dist_edges $1 -1 $2 dist${2}.dump
+ if [ $? -gt 0 ]; then
+ echo "error: dist_edges failed"
+ exit
+ fi
+ nbasins=`./wst_edges dist${2}.dump $3`
+ if [ $? -gt 0 ]; then
+ echo "error: wst_edges failed"
+ exit
+ fi
+ ./mean_median_label dist${2}.dump watershed.dump $nbasins
+ if [ $? -gt 0 ]; then
+ echo "error: mean_median_label failed"
+ echo "nbasins: $nbasins"
+ exit
+ fi
+
+ convert dist.pgm dist${2}.png
+ convert watershed.ppm watershed${2}.png
+ convert means.pgm means${2}.png
+ convert dist_mean.pgm dist_mean${2}.png
+ convert dev.pgm dev${2}.png
+
+ cp watershed.dump watershed${2}.dump
+
+ # Cleanup.
+ rm *.pgm *.ppm
+}
+
+batch_process ()
+{
+ process $1 1 $2
+ process $1 2 $2
+ process $1 3 $2
+ process $1 4 $2
+}
+
+batch_process $1 $2
Property changes on: trunk/milena/sandbox/fabien/igr/check_edges.sh
___________________________________________________________________
Name: svn:executable
+ *
Index: trunk/milena/sandbox/fabien/igr/wst_edges.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/wst_edges.cc (revision 3946)
+++ trunk/milena/sandbox/fabien/igr/wst_edges.cc (revision 3947)
@@ -124,7 +124,8 @@
L nbasins;
mln_VAR(wst, morpho::watershed::flooding(d_clo, world::inter_pixel::e2e(), nbasins));
- std::cout << "nbasins: " << nbasins << std::endl;
+
+ std::cout << nbasins << std::endl;
mln_VAR(w_all, wst.unmorph_());
Index: trunk/milena/sandbox/fabien/igr/check_dist.sh
===================================================================
--- trunk/milena/sandbox/fabien/igr/check_dist.sh (revision 0)
+++ trunk/milena/sandbox/fabien/igr/check_dist.sh (revision 3947)
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+
+process ()
+{
+ ./dist_edges $1 -1 $2 dist${2}.dump
+ convert dist.pgm dist${2}.png
+ rm dist*.pgm
+}
+
+batch_process ()
+{
+ process $1 1
+ process $1 2
+ process $1 3
+ process $1 4
+}
+
+batch_process $1 $2
Property changes on: trunk/milena/sandbox/fabien/igr/check_dist.sh
___________________________________________________________________
Name: svn:executable
+ *
Index: trunk/milena/sandbox/fabien/igr/dist_edges.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/dist_edges.cc (revision 3946)
+++ trunk/milena/sandbox/fabien/igr/dist_edges.cc (revision 3947)
@@ -95,7 +95,7 @@
res /= std::max(sum_v1, sum_v2);
res = 1 - res;
- res = res * 4095;
+ res = (res * 4095) + 0.49;
return (int) res;
}
@@ -123,7 +123,7 @@
res = res / v1.nelements();
res = 1 - res;
- res = res * 4095;
+ res = (res * 4095) + 0.49;
return (int) res;
}
@@ -152,7 +152,7 @@
res = min / max;
res = 1 - res;
- res = res * 4095;
+ res = (res * 4095) + 0.49;
return (int) res;
}
@@ -181,7 +181,7 @@
res = res / v1.nelements();
//res = 1 - res;
- res = res * 4095;
+ res = (res * 4095) + 0.49;
return (int) res;
}
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix g++-3.4 warnings.
* mln/world/binary_2d/enlarge.hh (do_threshold): Fix.
Upgrade doc.
* mln/core/image/edge_image.hh: Likewise.
* mln/core/dpoint.hh: Likewise.
(dpoint): Fix implicit cast.
* mln/metal/converts_to.hh: Upgrade doc.
(converts_to): Add overloads to quiet g++-3.4.
* mln/level: Remove directory.
* mln/algebra/mat.hh: Upgrade doc.
(inverse): Fix; use float instead of T.
* mln/io/off/load.hh: Upgrade doc.
(read_face_data): Fix missing scaling to 255.
Add explicit conversion.
* tests/core/image/graph_image.cc,
* tests/core/image/edge_image.cc,
* tests/core/image/line_graph_image.cc,
* tests/core/image/vertex_image.cc: Upgrade doc.
(X): New.
(expected_fwd_nb, expected_bkd_nb): Update.
Fix negative value stored as unsigned.
mln/algebra/mat.hh | 15 +++++++------
mln/core/dpoint.hh | 12 +++++------
mln/core/image/edge_image.hh | 2 -
mln/io/off/load.hh | 13 ++++++-----
mln/metal/converts_to.hh | 38 ++++++++++++++++++++++++++++-------
mln/world/binary_2d/enlarge.hh | 4 +--
tests/core/image/edge_image.cc | 24 +++++++++++-----------
tests/core/image/graph_image.cc | 31 ++++++++++++++--------------
tests/core/image/line_graph_image.cc | 21 +++++++++++--------
tests/core/image/vertex_image.cc | 29 +++++++++++++-------------
10 files changed, 110 insertions(+), 79 deletions(-)
Index: mln/world/binary_2d/enlarge.hh
--- mln/world/binary_2d/enlarge.hh (revision 3945)
+++ mln/world/binary_2d/enlarge.hh (working copy)
@@ -30,7 +30,7 @@
/// \file mln/world/binary_2d/enlarge.hh
///
-/// Enlarge 2^n times a binary image.
+/// \brief Enlarge 2^n times a binary image.
///
/// \todo Make it much more generic.
@@ -97,7 +97,7 @@
int
do_threshold(float value)
{
- return 255.f * value;
+ return static_cast<int>(255.f * value);
}
} // end of namespace mln::world::binary_2d
Index: mln/core/image/edge_image.hh
--- mln/core/image/edge_image.hh (revision 3945)
+++ mln/core/image/edge_image.hh (working copy)
@@ -31,7 +31,7 @@
/// \file mln/core/image/edge_image.hh
///
-/// Image based on graph edges.
+/// \brief Image based on graph edges.
# include <mln/core/concept/graph.hh>
# include <mln/core/site_set/p_edges.hh>
Index: mln/core/dpoint.hh
--- mln/core/dpoint.hh (revision 3945)
+++ mln/core/dpoint.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
@@ -31,7 +31,7 @@
/// \file mln/core/dpoint.hh
///
-/// Definition of the generic delta-point class mln::dpoint.
+/// \brief Definition of the generic delta-point class mln::dpoint.
# include <mln/core/def/coord.hh>
# include <mln/core/concept/gdpoint.hh>
@@ -53,7 +53,7 @@
/// \}
- /// Generic delta-point class.
+ /// \brief Generic delta-point class.
///
/// Parameters are \c G the dimension of the space and \c C the
/// coordinate type in this space.
@@ -168,9 +168,9 @@
{
unsigned j = 0;
for (unsigned i = dim - 2; i < dim; ++i)
- coord_[i] = v[j++];
+ coord_[i] = static_cast<C>(v[j++]);
for (unsigned i = 2; i < dim; ++i, ++j)
- coord_[i-j] = v[j];
+ coord_[i-j] = static_cast<C>(v[j]);
}
}
Index: mln/metal/converts_to.hh
--- mln/metal/converts_to.hh (revision 3945)
+++ mln/metal/converts_to.hh (working copy)
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009a 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
@@ -31,10 +31,11 @@
/// \file mln/metal/converts_to.hh
///
-/// Definition of a type that means "converts to".
+/// \brief Definition of a type that means "converts to".
# include <mln/metal/is_a.hh>
# include <mln/metal/const.hh>
+# include <mln/core/def/coord.hh>
# define mlc_converts_to(T, U) mln::metal::converts_to< T, U >
@@ -44,6 +45,13 @@
namespace mln
{
+ // Forward declarations.
+ namespace value {
+ template <unsigned n> struct int_u;
+ template <unsigned n> struct int_s;
+ }
+
+
namespace metal
{
@@ -61,16 +69,14 @@
- /*! \brief "converts-to" check.
- *
- * FIXME: Doc!
- */
+ /// \brief "converts-to" check.
template <typename T, typename U>
struct converts_to : bool_<( sizeof(internal::helper_converts_to_<T, U>::selector(*internal::make_<mlc_const(T)>::ptr()) )
==
sizeof(internal::yes_) )>
{};
+
template <typename T, typename U>
struct converts_to<T*, U*> : converts_to<T, U>
{};
@@ -79,8 +85,26 @@
struct converts_to<T**, U**> : false_
{};
+
+
+ // Below, a few hacks to quiet g++-3.4 warnings:
+
+ template <> struct converts_to< float, int > : true_ {};
+ template <> struct converts_to< float, def::coord > : true_ {};
+ template <unsigned n> struct converts_to< float, value::int_u<n> > : true_ {};
+ template <unsigned n> struct converts_to< float, value::int_s<n> > : true_ {};
+
+ template <> struct converts_to< double, int > : true_ {};
+ template <> struct converts_to< double, def::coord > : true_ {};
+ template <unsigned n> struct converts_to< double, value::int_u<n> > : true_ {};
+ template <unsigned n> struct converts_to< double, value::int_s<n> > : true_ {};
+
+ // End of hacks.
+
} // end of namespace mln::metal
+
+
} // end of namespace mln
Index: mln/algebra/mat.hh
--- mln/algebra/mat.hh (revision 3945)
+++ mln/algebra/mat.hh (working copy)
@@ -31,7 +31,7 @@
/// \file mln/algebra/mat.hh
///
-/// Definition of a generic matrix class.
+/// \brief Definition of a generic matrix class.
# include <iostream>
@@ -547,28 +547,29 @@
return tmp;
}
+
namespace internal
{
template <typename T>
inline
- mat<2,2,T>
+ mat<2,2,float>
inverse(const mat<2,2,T>& m)
{
- T d = det(m);
+ float d = det(m);
mln_precondition(d != 0);
- return make<T>( + m(1,1) / d, - m(0,1) / d,
+ return make<float>( + m(1,1) / d, - m(0,1) / d,
- m(1,0) / d, + m(0,0) / d );
}
template <typename T>
inline
- mat<3,3,T>
+ mat<3,3,float>
inverse(const mat<3,3,T>& m)
{
- T d = det(m);
+ float d = det(m);
mln_precondition(d != 0);
- return make<T>( det(make(m(1,1), m(1,2),
+ return make<float>( det(make(m(1,1), m(1,2),
m(2,1), m(2,2))),
det(make(m(0,2), m(0,1),
Index: mln/io/off/load.hh
--- mln/io/off/load.hh (revision 3945)
+++ mln/io/off/load.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 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,20 +30,18 @@
# define MLN_IO_OFF_LOAD_HH
/// \file mln/io/off/load.hh
-/// Input loading function for OFF files.
+///
+/// \brief Input loading function for OFF files.
///
/// \see http://shape.cs.princeton.edu/benchmark/documentation/off_format.html
/// \see https://people.scs.fsu.edu/~burkardt/html/off_format.html
# include <cstdlib>
-
# include <iostream>
# include <fstream>
-
# include <string>
# include <mln/literal/black.hh>
-
# include <mln/core/concept/object.hh>
# include <mln/core/alias/complex_image.hh>
@@ -546,7 +545,9 @@
mln_assertion(0.0f <= g); mln_assertion(g <= 1.0f);
mln_assertion(0.0f <= b); mln_assertion(b <= 1.0f);
mln_assertion(0.0f <= a); mln_assertion(a <= 1.0f);
- face_value.push_back(value::rgb8(r, g, b));
+ face_value.push_back(value::rgb8(int(255 * r),
+ int(255 * g),
+ int(255 * b)));
}
/* \} */
Index: tests/core/image/graph_image.cc
--- tests/core/image/graph_image.cc (revision 3945)
+++ tests/core/image/graph_image.cc (working copy)
@@ -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
@@ -27,7 +28,7 @@
/// \file tests/core/image/graph_image.cc
///
-/// Tests on mln::graph_image.
+/// \brief Tests on mln::graph_image.
#include <vector>
@@ -37,16 +38,13 @@
#include <mln/core/concept/function.hh>
#include <mln/core/neighb.hh>
#include <mln/core/var.hh>
-
#include <mln/accu/bbox.hh>
-
#include <mln/fun/i2v/array.hh>
-
#include <mln/util/graph.hh>
-
#include <mln/debug/draw_graph.hh>
#include <mln/debug/println.hh>
+
/* The graph is as follows:
0 1 2 3 4
@@ -61,19 +59,22 @@
*/
+static const unsigned X = mln_max(unsigned); // Invalid id.
+
+
// Expected neighbors for forward and backward iteration.
-// -1 is an invalid id.
-static unsigned expected_fwd_nb[5][3] = { { 1, -1, -1 },
+// X is an invalid id.
+static unsigned expected_fwd_nb[5][3] = { { 1, X, X },
{ 0, 2, 3 },
- { 1, 4, -1 },
- { 1, 4, -1 },
- { 3, 2, -1 } };
+ { 1, 4, X },
+ { 1, 4, X },
+ { 3, 2, X } };
-static unsigned expected_bkd_nb[5][3] = { { 1, -1, -1 },
+static unsigned expected_bkd_nb[5][3] = { { 1, X, X },
{ 3, 2, 0 },
- { 4, 1, -1 },
- { 4, 1, -1 },
- { 2, 3, -1 } };
+ { 4, 1, X },
+ { 4, 1, X },
+ { 2, 3, X } };
int main()
Index: tests/core/image/edge_image.cc
--- tests/core/image/edge_image.cc (revision 3945)
+++ tests/core/image/edge_image.cc (working copy)
@@ -27,22 +27,19 @@
/// \file tests/core/image/edge_image.cc
///
-/// Tests on mln::edge_image.
+/// \brief Tests on mln::edge_image.
#include <vector>
#include <mln/core/image/edge_image.hh>
#include <mln/core/image/image2d.hh>
-
#include <mln/accu/bbox.hh>
-
#include <mln/fun/i2v/array.hh>
-
#include <mln/util/graph.hh>
#include <mln/util/site_pair.hh>
-
#include <mln/debug/draw_graph.hh>
+
/* The graph is as follows:
0 1 2 3 4
@@ -57,19 +54,22 @@
*/
+static const unsigned X = mln_max(unsigned); // Invalid id.
+
+
// Expected neighbors for forward and backward iteration.
-// -1 is an invalid id.
-static unsigned expected_fwd_nb[5][3] = { { 1, 2, -1 },
+// X is an invalid id.
+static unsigned expected_fwd_nb[5][3] = { { 1, 2, X },
{ 0, 2, 4 },
{ 0, 1, 3 },
- { 2, 4, -1 },
- { 1, 3, -1 } };
+ { 2, 4, X },
+ { 1, 3, X } };
-static unsigned expected_bkd_nb[5][3] = { { 2, 1, -1 },
+static unsigned expected_bkd_nb[5][3] = { { 2, 1, X },
{ 4, 2, 0 },
{ 3, 1, 0 },
- { 4, 2, -1 },
- { 3, 1, -1 } };
+ { 4, 2, X },
+ { 3, 1, X } };
int main()
Index: tests/core/image/line_graph_image.cc
--- tests/core/image/line_graph_image.cc (revision 3945)
+++ tests/core/image/line_graph_image.cc (working copy)
@@ -28,7 +28,7 @@
/// \file tests/core/image/line_graph_image.cc
///
-/// Tests on mln::line_graph_image.
+/// \brief Tests on mln::line_graph_image.
#include <mln/core/alias/point2d.hh>
@@ -59,18 +59,21 @@
*/
+static const unsigned X = mln_max(unsigned); // Invalid id.
+
+
// Expected neighbors for forward and backward iteration.
-static unsigned expected_fwd_nbh[5][3] = { { 1, -1, -1 },
+static unsigned expected_fwd_nbh[5][3] = { { 1, X, X },
{ 0, 2, 3 },
- { 1, 4, -1 },
- { 1, 4, -1 },
- { 3, 2, -1 } };
+ { 1, 4, X },
+ { 1, 4, X },
+ { 3, 2, X } };
-static unsigned expected_bkd_nbh[5][3] = { { 1, 0, -1 },
+static unsigned expected_bkd_nbh[5][3] = { { 1, 0, X },
{ 3, 2, 0 },
- { 4, 1, -1 },
- { 4, 1, -1 },
- { 2, 3, -1 } };
+ { 4, 1, X },
+ { 4, 1, X },
+ { 2, 3, X } };
int main()
Index: tests/core/image/vertex_image.cc
--- tests/core/image/vertex_image.cc (revision 3945)
+++ tests/core/image/vertex_image.cc (working copy)
@@ -27,22 +27,20 @@
/// \file tests/core/image/vertex_image.cc
///
-/// Tests on mln::vertex_image.
+/// \brief Tests on mln::vertex_image.
#include <vector>
#include <mln/core/image/vertex_image.hh>
#include <mln/make/vertex_image.hh>
#include <mln/core/image/image2d.hh>
-
#include <mln/accu/bbox.hh>
-
#include <mln/fun/i2v/array.hh>
-
#include <mln/util/graph.hh>
-
#include <mln/debug/draw_graph.hh>
+
+
/* The graph is as follows:
0 1 2 3 4
@@ -57,19 +55,22 @@
*/
+static const unsigned X = mln_max(unsigned); // Invalid id.
+
+
// Expected neighbors for forward and backward iteration.
-// -1 is an invalid id.
-static unsigned expected_fwd_nb[5][3] = { { 1, -1, -1 },
+// X is an invalid id.
+static unsigned expected_fwd_nb[5][3] = { { 1, X, X },
{ 0, 2, 3 },
- { 1, 4, -1 },
- { 1, 4, -1 },
- { 3, 2, -1 } };
+ { 1, 4, X },
+ { 1, 4, X },
+ { 3, 2, X } };
-static unsigned expected_bkd_nb[5][3] = { { 1, -1, -1 },
+static unsigned expected_bkd_nb[5][3] = { { 1, X, X },
{ 3, 2, 0 },
- { 4, 1, -1 },
- { 4, 1, -1 },
- { 2, 3, -1 } };
+ { 4, 1, X },
+ { 4, 1, X },
+ { 2, 3, X } };
int main()
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Several fixes.
* mln/fun/internal/selector.hh
(helper_selector_): Fix parameters order.
* mln/fun/internal/selector.hh (selector_p2_): Rename as...
(selector_from_result_): ...this.
* mln/pw/cst.hh,
* mln/pw/value.hh,
* mln/fun/p2v/ternary.hh: Update.
* tests/morpho/tree/compute_parent.cc: Layout.
* mln/value/shell.hh (set_): Fix double definition.
This is due to function concepts simplification. The fix
is to de-activate one version of set_; this is a hack
and the shell_ is now downgraded.
* tests/core/site_set/p_bgraph.cc: Move...
* trash/p_bgraph.cc: ...here.
Fix missing trashing.
* tests/core/site_set/Makefile.am: Update.
mln/fun/internal/selector.hh | 9 +++----
mln/fun/p2v/ternary.hh | 2 -
mln/pw/cst.hh | 2 -
mln/pw/value.hh | 6 ++--
mln/value/shell.hh | 44 ++++++++++++++----------------------
tests/core/site_set/Makefile.am | 2 -
tests/morpho/tree/compute_parent.cc | 4 ++-
7 files changed, 30 insertions(+), 39 deletions(-)
Property changes on: trash/p_bgraph.cc
___________________________________________________________________
Added: svn:mergeinfo
Index: mln/value/shell.hh
--- mln/value/shell.hh (revision 3944)
+++ mln/value/shell.hh (working copy)
@@ -33,15 +33,14 @@
# include <mln/core/concept/function.hh>
# include <mln/core/concept/image.hh>
+
namespace mln
{
// Forward declaration.
- namespace value
- {
- template <typename F, typename I>
- struct shell;
- } // end of namespace mln::value
+ namespace value {
+ template <typename F, typename I> struct shell;
+ }
namespace value
{
@@ -60,14 +59,6 @@
set_(I& ima, const mln_site(I)& s, mln_result(F) v);
};
-
- template <typename F, typename I>
- struct shell_<F, I, Function_v2v<void> >
- {
- const mln_value(I)&
- set_(I& ima, const mln_site(I)& s, mln_result(F) v);
- };
-
} // end of namespace mln::value::impl
@@ -112,11 +103,13 @@
# ifndef MLN_INCLUDE_ONLY
- // Ctor
-
+ // Constructor.
template <typename F, typename I>
shell<F,I>::shell(Image<I>& ima, const mln_site(I)& s)
- : ima_(exact(ima)), s_(s), v_(F()(exact(ima)(s)))
+ :
+ ima_(exact(ima)),
+ s_(s),
+ v_(F()(exact(ima)(s)))
{
}
@@ -158,16 +151,15 @@
return ima(s);
}
-
- template <typename F, typename I>
- const mln_value(I)&
- shell_<F, I, Function_v2v<void> >::set_(I& ima,
- const mln_site(I)& s,
- mln_result(F) v)
- {
- ima(s) = F().f_1(v, ima(s));
- return ima(s);
- }
+// template <typename F, typename I>
+// const mln_value(I)&
+// shell_<F, I, Function_v2v<void> >::set_(I& ima,
+// const mln_site(I)& s,
+// mln_result(F) v)
+// {
+// ima(s) = F().f_1(v, ima(s));
+// return ima(s);
+// }
} // end of namespace mln::value::impl
Index: mln/pw/cst.hh
--- mln/pw/cst.hh (revision 3944)
+++ mln/pw/cst.hh (working copy)
@@ -80,7 +80,7 @@
template <typename T>
struct cst_
- : fun::internal::selector_p2_<T, cst_<T> >::ret
+ : fun::internal::selector_from_result_<T, cst_<T> >::ret
{
typedef T result;
Index: mln/pw/value.hh
--- mln/pw/value.hh (revision 3944)
+++ mln/pw/value.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
@@ -49,7 +49,7 @@
template <typename I>
struct value_
- : fun::internal::selector_p2_< mln_value(I), value_<I> >::ret
+ : fun::internal::selector_from_result_< mln_value(I), value_<I> >::ret
{
typedef mln_value(I) result;
Index: mln/fun/p2v/ternary.hh
--- mln/fun/p2v/ternary.hh (revision 3944)
+++ mln/fun/p2v/ternary.hh (working copy)
@@ -47,7 +47,7 @@
template <typename P, typename T, typename F>
struct ternary_
- : fun::internal::selector_p2_<mln_result(T), ternary_<P,T,F> >::ret
+ : fun::internal::selector_from_result_<mln_result(T), ternary_<P,T,F> >::ret
{
typedef mln_result(T) result;
Index: mln/fun/internal/selector.hh
--- mln/fun/internal/selector.hh (revision 3944)
+++ mln/fun/internal/selector.hh (working copy)
@@ -48,14 +48,14 @@
{
- template <typename A, typename R, typename E>
+ template <typename R, typename A, typename E>
struct helper_selector_
{
typedef Function_v2v<E> ret;
};
template <typename A, typename E>
- struct helper_selector_< A, bool, E >
+ struct helper_selector_< bool, A, E >
{
typedef Function_v2b<E> ret;
};
@@ -71,12 +71,11 @@
selector_();
};
-
template <typename R_, typename E>
- struct selector_p2_ : selector_< R_, void, E >
+ struct selector_from_result_ : selector_< R_, void, E >
{
private:
- selector_p2_();
+ selector_from_result_();
};
} // end of namespace mln::fun::internal
Index: tests/core/site_set/Makefile.am
--- tests/core/site_set/Makefile.am (revision 3944)
+++ tests/core/site_set/Makefile.am (working copy)
@@ -5,7 +5,6 @@
check_PROGRAMS = \
operators \
p_array \
-## p_bgraph \
p_complex \
p_edges \
p_image \
@@ -20,7 +19,6 @@
operators_SOURCES = operators.cc
p_array_SOURCES = p_array.cc
-##p_bgraph_SOURCES = p_bgraph.cc
p_complex_SOURCES = p_complex.cc
p_image_SOURCES = p_image.cc
p_priority_queue_SOURCES = p_priority_queue.cc
Index: tests/morpho/tree/compute_parent.cc
--- tests/morpho/tree/compute_parent.cc (revision 3944)
+++ tests/morpho/tree/compute_parent.cc (working copy)
@@ -28,8 +28,9 @@
/// \file tests/morpho/tree/compute_parent.cc
///
-/// Tests on mln::morpho::tree::compute_parent.
+/// \brief Tests on mln::morpho::tree::compute_parent.
+#include <mln/core/var.hh>
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/core/image/dmorph/image_if.hh>
@@ -42,6 +43,7 @@
#include <mln/morpho/tree/compute_parent.hh>
+
static mln::image2d<mln::point2d> ref1()
{
using namespace mln;
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Propagate fun selector renaming.
* jardonnet/perl/test/p2v/ternary.hh,
* jardonnet/perl/test/internal/selector.hh
(selector_p2_): Rename as...
(selector_from_result_): ...this.
internal/selector.hh | 4 ++--
p2v/ternary.hh | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
Index: jardonnet/perl/test/p2v/ternary.hh
--- jardonnet/perl/test/p2v/ternary.hh (revision 3943)
+++ jardonnet/perl/test/p2v/ternary.hh (working copy)
@@ -47,7 +47,7 @@
template <typename P, typename T, typename F>
struct ternary_
- : fun::internal::selector_p2_<mln_result(T), ternary_<P,T,F> >::ret
+ : fun::internal::selector_from_result_<mln_result(T), ternary_<P,T,F> >::ret
{
typedef mln_result(T) result;
Index: jardonnet/perl/test/internal/selector.hh
--- jardonnet/perl/test/internal/selector.hh (revision 3943)
+++ jardonnet/perl/test/internal/selector.hh (working copy)
@@ -181,13 +181,13 @@
template <typename R_, typename E>
- struct selector_p2_
+ struct selector_from_result_
{
typedef mlc_unqualif(R_) R;
enum { res = tag_<R>::value };
typedef typename helper_selector_<p_, res, E>::ret ret;
private:
- selector_p2_();
+ selector_from_result_();
};
} // end of namespace mln::fun::internal
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Simplifying function concepts.
* mln/core/concept/function.hh: Remove all concepts except
Function, Function_v2v, Function_v2b, Function_vv2v, and
Function_vv2b.
* mln/data/transform.spe.hh: De-activate some implementation
routines and their related some dispatch routines.
(todo): New.
* mln/topo/is_simple_cell.hh,
* mln/topo/skeleton/breadth_first_thinning.hh,
* mln/topo/is_n_face.hh,
* mln/world/inter_pixel/is_separator.hh,
* mln/world/inter_pixel/is_pixel.hh,
* mln/world/inter_pixel/dim2/is_dot.hh,
* mln/world/inter_pixel/dim2/is_row_odd.hh,
* mln/world/inter_pixel/dim2/is_pixel.hh,
* mln/world/inter_pixel/dim2/is_edge.hh,
* mln/core/site_set/p_image.hh,
* mln/core/site_set/p_if.hh,
* mln/core/image/dmorph/image_if.hh,
* mln/core/image/dmorph/p2p_image.hh,
* mln/core/image/imorph/tr_image.hh,
* mln/core/image/edge_image.hh,
* mln/core/image/vertex_image.hh,
* mln/core/point.hh,
* mln/core/dpoint.hh,
* mln/metal/vec.hh,
* mln/metal/mat.hh,
* mln/data/transform.spe.hh,
* mln/value/shell.hh,
* mln/make/w_window.hh,
* mln/make/edge_image.hh,
* mln/make/vertex_image.hh,
* mln/test/predicate.hh,
* mln/pw/var.hh,
* mln/fun/p2b/chess.hh,
* mln/fun/p2b/big_chess.hh,
* mln/fun/p2b/antilogy.hh,
* mln/fun/p2b/tautology.hh,
* mln/fun/p2b/has.hh,
* mln/fun/meta/hue.hh,
* mln/fun/meta/inty.hh,
* mln/fun/meta/sat.hh,
* mln/fun/meta/blue.hh,
* mln/fun/meta/first.hh,
* mln/fun/meta/red.hh,
* mln/fun/meta/second.hh,
* mln/fun/meta/lum.hh,
* mln/fun/meta/green.hh,
* mln/fun/v2w2v/cos.hh,
* mln/fun/cast.hh,
* mln/fun/ops.hh,
* mln/fun/i2v/all_to.hh,
* mln/fun/i2v/array.hh,
* mln/fun/p2p/fold.hh,
* mln/fun/p2p/mirror.hh,
* mln/fun/p2p/translation.hh,
* mln/fun/p2v/elifs.hh,
* mln/fun/p2v/ternary.hh,
* mln/fun/p2v/iota.hh,
* mln/fun/internal/x2x_linear_impl.hh,
* mln/fun/internal/selector.hh,
* mln/fun/x2x/composed.hh,
* mln/fun/x2x/translation.hh,
* mln/fun/x2x/rotation.hh,
* mln/fun/v2w_w2v/norm.hh,
* mln/set/diff.hh,
* mln/algebra/mat.hh,
* mln/algebra/vec.hh,
* mln/morpho/tree/filter/min.hh,
* mln/morpho/tree/filter/max.hh,
* mln/morpho/tree/filter/filter.hh,
* mln/morpho/tree/filter/direct.hh,
* mln/morpho/tree/filter/subtractive.hh,
* mln/morpho/tree/propagate_if.hh,
* mln/util/internal/id2element.hh,
* mln/util/array.hh,
* tests/arith/minus_full.cc,
* tests/arith/times_full.cc,
* tests/arith/plus_full.cc,
* tests/arith/revert_full.cc,
* tests/data/compute_full.cc,
* tests/data/fill_full.cc,
* tests/data/abs_full.cc,
* tests/data/paste_full.cc,
* tests/data/compare_full.cc,
* tests/border/get_full.cc,
* tests/border/find_full.cc,
* tests/border/resize_sub_image.cc,
* tests/border/get.cc,
* tests/border/resize_image_if.cc,
* tests/make/w_window.cc,
* tests/test/positive.cc,
* tests/morpho/watershed/superpose.cc,
* tests/canvas/browsing/fwd.cc,
* tests/canvas/browsing/snake_fwd.cc,
* tests/canvas/browsing/snake_vert.cc,
* tests/canvas/browsing/snake_generic_2d_vert.cc,
* tests/canvas/browsing/snake_generic_2d_hori.cc,
* tests/canvas/browsing/snake_generic_3d_vert.cc,
* tests/canvas/browsing/snake_generic_3d_hori.cc,
* tests/canvas/browsing/hyper_directional.cc,
* tests/canvas/browsing/diagonal2d.cc,
* tests/canvas/browsing/backdiagonal2d.cc,
* doc/examples/trash/graph.cc,
* doc/examples/graph-data.cc,
* doc/examples/mln_var.cc,
* doc/examples/graph-iter.cc,
* doc/examples/extend.cc: Propagate update.
doc/examples/extend.cc | 2
doc/examples/graph-data.cc | 2
doc/examples/graph-iter.cc | 2
doc/examples/mln_var.cc | 2
doc/examples/trash/graph.cc | 2
mln/algebra/mat.hh | 4
mln/algebra/vec.hh | 4
mln/core/concept/function.hh | 417 ++-----------------------
mln/core/dpoint.hh | 4
mln/core/image/dmorph/image_if.hh | 23 -
mln/core/image/dmorph/p2p_image.hh | 8
mln/core/image/edge_image.hh | 24 -
mln/core/image/imorph/tr_image.hh | 2
mln/core/image/vertex_image.hh | 8
mln/core/point.hh | 4
mln/core/site_set/p_if.hh | 7
mln/core/site_set/p_image.hh | 5
mln/data/transform.spe.hh | 150 ++++----
mln/fun/cast.hh | 4
mln/fun/i2v/all_to.hh | 2
mln/fun/i2v/array.hh | 4
mln/fun/internal/selector.hh | 139 --------
mln/fun/internal/x2x_linear_impl.hh | 11
mln/fun/meta/blue.hh | 2
mln/fun/meta/first.hh | 2
mln/fun/meta/green.hh | 2
mln/fun/meta/hue.hh | 4
mln/fun/meta/inty.hh | 2
mln/fun/meta/lum.hh | 2
mln/fun/meta/red.hh | 2
mln/fun/meta/sat.hh | 4
mln/fun/meta/second.hh | 2
mln/fun/ops.hh | 45 --
mln/fun/p2b/antilogy.hh | 2
mln/fun/p2b/big_chess.hh | 2
mln/fun/p2b/chess.hh | 2
mln/fun/p2b/has.hh | 4
mln/fun/p2b/tautology.hh | 2
mln/fun/p2p/fold.hh | 2
mln/fun/p2p/mirror.hh | 2
mln/fun/p2p/translation.hh | 2
mln/fun/p2v/elifs.hh | 12
mln/fun/p2v/iota.hh | 2
mln/fun/p2v/ternary.hh | 24 -
mln/fun/v2w2v/cos.hh | 2
mln/fun/v2w_w2v/norm.hh | 6
mln/fun/x2x/composed.hh | 12
mln/fun/x2x/rotation.hh | 2
mln/fun/x2x/translation.hh | 2
mln/make/edge_image.hh | 8
mln/make/vertex_image.hh | 12
mln/make/w_window.hh | 4
mln/metal/mat.hh | 4
mln/metal/vec.hh | 4
mln/morpho/tree/filter/direct.hh | 10
mln/morpho/tree/filter/filter.hh | 10
mln/morpho/tree/filter/max.hh | 10
mln/morpho/tree/filter/min.hh | 10
mln/morpho/tree/filter/subtractive.hh | 10
mln/morpho/tree/propagate_if.hh | 74 ++--
mln/pw/var.hh | 2
mln/set/diff.hh | 2
mln/test/predicate.hh | 6
mln/topo/is_n_face.hh | 2
mln/topo/is_simple_cell.hh | 2
mln/topo/skeleton/breadth_first_thinning.hh | 8
mln/util/array.hh | 4
mln/util/internal/id2element.hh | 2
mln/value/shell.hh | 8
mln/world/inter_pixel/dim2/is_dot.hh | 2
mln/world/inter_pixel/dim2/is_edge.hh | 2
mln/world/inter_pixel/dim2/is_pixel.hh | 2
mln/world/inter_pixel/dim2/is_row_odd.hh | 2
mln/world/inter_pixel/is_pixel.hh | 2
mln/world/inter_pixel/is_separator.hh | 2
tests/arith/minus_full.cc | 6
tests/arith/plus_full.cc | 6
tests/arith/revert_full.cc | 6
tests/arith/times_full.cc | 6
tests/border/find_full.cc | 6
tests/border/get.cc | 2
tests/border/get_full.cc | 2
tests/border/resize_image_if.cc | 2
tests/border/resize_sub_image.cc | 2
tests/canvas/browsing/backdiagonal2d.cc | 2
tests/canvas/browsing/diagonal2d.cc | 2
tests/canvas/browsing/fwd.cc | 2
tests/canvas/browsing/hyper_directional.cc | 2
tests/canvas/browsing/snake_fwd.cc | 2
tests/canvas/browsing/snake_generic_2d_hori.cc | 2
tests/canvas/browsing/snake_generic_2d_vert.cc | 2
tests/canvas/browsing/snake_generic_3d_hori.cc | 2
tests/canvas/browsing/snake_generic_3d_vert.cc | 2
tests/canvas/browsing/snake_vert.cc | 2
tests/data/abs_full.cc | 6
tests/data/compare_full.cc | 6
tests/data/compute_full.cc | 6
tests/data/fill_full.cc | 6
tests/data/paste_full.cc | 6
tests/make/w_window.cc | 2
tests/morpho/watershed/superpose.cc | 2
tests/test/positive.cc | 2
102 files changed, 402 insertions(+), 873 deletions(-)
Index: mln/topo/is_simple_cell.hh
--- mln/topo/is_simple_cell.hh (revision 3942)
+++ mln/topo/is_simple_cell.hh (working copy)
@@ -54,7 +54,7 @@
The functor does not actually take a cell as input, but a face
that is expected to be a D-facet. */
template <typename I>
- class is_simple_cell : public mln::Function_p2b< is_simple_cell<I> >
+ class is_simple_cell : public mln::Function_v2b< is_simple_cell<I> >
{
public:
/// Dimension of the image (and therefore of the complex).
Index: mln/topo/skeleton/breadth_first_thinning.hh
--- mln/topo/skeleton/breadth_first_thinning.hh (revision 3942)
+++ mln/topo/skeleton/breadth_first_thinning.hh (working copy)
@@ -70,9 +70,9 @@
mln_concrete(I)
breadth_first_thinning(const Image<I>& input,
const Neighborhood<N>& nbh,
- Function_p2b<F>& is_simple,
+ Function_v2b<F>& is_simple,
G detach,
- const Function_p2b<H>& constraint =
+ const Function_v2b<H>& constraint =
fun::p2b::tautology());
@@ -83,9 +83,9 @@
mln_concrete(I)
breadth_first_thinning(const Image<I>& input_,
const Neighborhood<N>& nbh_,
- Function_p2b<F>& is_simple_,
+ Function_v2b<F>& is_simple_,
G detach,
- const Function_p2b<H>& constraint_)
+ const Function_v2b<H>& constraint_)
{
const I& input = exact(input_);
const N& nbh = exact(nbh_);
Index: mln/topo/is_n_face.hh
--- mln/topo/is_n_face.hh (revision 3942)
+++ mln/topo/is_n_face.hh (working copy)
@@ -47,7 +47,7 @@
/// 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> >
+ struct is_n_face : public mln::Function_v2b< is_n_face<N> >
{
typedef bool result;
Index: mln/world/inter_pixel/is_separator.hh
--- mln/world/inter_pixel/is_separator.hh (revision 3942)
+++ mln/world/inter_pixel/is_separator.hh (working copy)
@@ -48,7 +48,7 @@
namespace inter_pixel
{
- struct is_separator : public Function_p2b< is_separator >
+ struct is_separator : public Function_v2b< is_separator >
{
typedef bool result;
Index: mln/world/inter_pixel/is_pixel.hh
--- mln/world/inter_pixel/is_pixel.hh (revision 3942)
+++ mln/world/inter_pixel/is_pixel.hh (working copy)
@@ -46,7 +46,7 @@
namespace inter_pixel
{
- struct is_pixel : public Function_p2b< is_pixel >
+ struct is_pixel : public Function_v2b< is_pixel >
{
typedef bool result;
Index: mln/world/inter_pixel/dim2/is_dot.hh
--- mln/world/inter_pixel/dim2/is_dot.hh (revision 3942)
+++ mln/world/inter_pixel/dim2/is_dot.hh (working copy)
@@ -46,7 +46,7 @@
namespace dim2
{
- struct is_dot : public Function_p2b< is_dot >
+ struct is_dot : public Function_v2b< is_dot >
{
typedef bool result;
bool operator()(const point2d& p) const;
Index: mln/world/inter_pixel/dim2/is_row_odd.hh
--- mln/world/inter_pixel/dim2/is_row_odd.hh (revision 3942)
+++ mln/world/inter_pixel/dim2/is_row_odd.hh (working copy)
@@ -46,7 +46,7 @@
namespace dim2
{
- struct is_row_odd : public Function_p2b< is_row_odd >
+ struct is_row_odd : public Function_v2b< is_row_odd >
{
typedef bool result;
bool operator()(const point2d& p) const;
Index: mln/world/inter_pixel/dim2/is_pixel.hh
--- mln/world/inter_pixel/dim2/is_pixel.hh (revision 3942)
+++ mln/world/inter_pixel/dim2/is_pixel.hh (working copy)
@@ -46,7 +46,7 @@
namespace dim2
{
- struct is_pixel : public Function_p2b< is_pixel >
+ struct is_pixel : public Function_v2b< is_pixel >
{
typedef bool result;
bool operator()(const point2d& p) const;
Index: mln/world/inter_pixel/dim2/is_edge.hh
--- mln/world/inter_pixel/dim2/is_edge.hh (revision 3942)
+++ mln/world/inter_pixel/dim2/is_edge.hh (working copy)
@@ -46,7 +46,7 @@
namespace dim2
{
- struct is_edge : public Function_p2b< is_edge >
+ struct is_edge : public Function_v2b< is_edge >
{
typedef bool result;
bool operator()(const point2d& p) const;
Index: mln/core/site_set/p_image.hh
--- mln/core/site_set/p_image.hh (revision 3942)
+++ mln/core/site_set/p_image.hh (working copy)
@@ -29,10 +29,9 @@
#ifndef MLN_CORE_SITE_SET_P_IMAGE_HH
# define MLN_CORE_SITE_SET_P_IMAGE_HH
-
/// \file mln/core/site_set/p_image.hh
///
-/// Definition of a site set class based on an image of
+/// \brief Definition of a site set class based on an image of
/// Booleans.
///
/// \todo Add an init method (deferred initialization).
@@ -75,7 +74,7 @@
class p_image : public internal::site_set_base_< mln_psite(I), p_image<I> >
{
typedef mln_domain(I) S_;
- typedef fun::eq_p2b_expr_< pw::value_<I>, pw::cst_<bool> > F_;
+ typedef fun::eq_v2b_expr_< pw::value_<I>, pw::cst_<bool> > F_;
public:
/// Equivalent site_set type.
Index: mln/core/site_set/p_if.hh
--- mln/core/site_set/p_if.hh (revision 3942)
+++ mln/core/site_set/p_if.hh (working copy)
@@ -31,7 +31,8 @@
/// \file mln/core/site_set/p_if.hh
///
-/// Definition of the restriction of a site set w.r.t. a predicate.
+/// \brief Definition of the restriction of a site set w.r.t. a
+/// predicate.
///
/// \todo Change s_ attribute type to S*.
@@ -70,7 +71,7 @@
*/
template <typename S, typename F>
p_if<S, F>
- operator | (const Site_Set<S>& s, const Function_p2b<F>& f);
+ operator | (const Site_Set<S>& s, const Function_v2b<F>& f);
@@ -146,7 +147,7 @@
template <typename S, typename F>
inline
p_if<S, F>
- operator | (const Site_Set<S>& s, const Function_p2b<F>& f)
+ operator | (const Site_Set<S>& s, const Function_v2b<F>& f)
{
p_if<S, F> tmp(exact(s), exact(f));
return tmp;
Index: mln/core/image/dmorph/image_if.hh
--- mln/core/image/dmorph/image_if.hh (revision 3942)
+++ mln/core/image/dmorph/image_if.hh (working copy)
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 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
@@ -31,10 +31,8 @@
/// \file mln/core/image/dmorph/image_if.hh
///
-/// Definition of a image which domain is restricted by a
-/// function.
-///
-/// \todo Relax Function_p2b into Function_v2b.
+/// \brief Definition of a image which domain is restricted by a
+/// function 'site -> Boolean'.
# include <mln/core/internal/image_domain_morpher.hh>
# include <mln/core/site_set/p_if.hh>
@@ -89,7 +87,8 @@
- /// Image which domain is restricted by a function.
+ /// Image which domain is restricted by a function 'site ->
+ /// Boolean'.
///
/// \ingroup modimagedomainmorpher
//
@@ -121,21 +120,21 @@
// Operators.
- // Image | Function_p2b.
+ // Image | Function_v2b.
/// ima | f creates an image_if with the image ima and the function
/// f.
//
template <typename I, typename F>
image_if<I,F>
- operator | (Image<I>& ima, const Function_p2b<F>& f);
+ operator | (Image<I>& ima, const Function_v2b<F>& f);
/// ima | f creates an image_if with the image ima and the function
/// f.
//
template <typename I, typename F>
image_if<const I,F>
- operator | (const Image<I>& ima, const Function_p2b<F>& f);
+ operator | (const Image<I>& ima, const Function_v2b<F>& f);
@@ -234,7 +233,7 @@
template <typename I, typename F>
inline
image_if<I,F>
- operator | (Image<I>& ima, const Function_p2b<F>& f)
+ operator | (Image<I>& ima, const Function_v2b<F>& f)
{
image_if<I,F> tmp(exact(ima), exact(f));
return tmp;
@@ -243,7 +242,7 @@
template <typename I, typename F>
inline
image_if<const I, F>
- operator | (const Image<I>& ima, const Function_p2b<F>& f)
+ operator | (const Image<I>& ima, const Function_v2b<F>& f)
{
image_if<const I, F> tmp(exact(ima), exact(f));
return tmp;
Index: mln/core/image/dmorph/p2p_image.hh
--- mln/core/image/dmorph/p2p_image.hh (revision 3942)
+++ mln/core/image/dmorph/p2p_image.hh (working copy)
@@ -122,12 +122,12 @@
/// FIXME: Doc!
template <typename I, typename F>
p2p_image<I,F>
- apply_p2p(Image<I>& ima, const Function_p2p<F>& f);
+ apply_p2p(Image<I>& ima, const Function_v2v<F>& f);
/// FIXME: Doc!
template <typename I, typename F>
p2p_image<const I,F>
- apply_p2p(const Image<I>& ima, const Function_p2p<F>& f);
+ apply_p2p(const Image<I>& ima, const Function_v2v<F>& f);
@@ -241,7 +241,7 @@
template <typename I, typename F>
inline
p2p_image<I,F>
- apply_p2p(Image<I>& ima_, const Function_p2p<F>& f)
+ apply_p2p(Image<I>& ima_, const Function_v2v<F>& f)
{
mlc_is_a(mln_domain(I), Box)::check();
@@ -255,7 +255,7 @@
template <typename I, typename F>
inline
p2p_image<const I, F>
- apply_p2p(const Image<I>& ima_, const Function_p2p<F>& f)
+ apply_p2p(const Image<I>& ima_, const Function_v2v<F>& f)
{
mlc_is_a(mln_domain(I), Box)::check();
Index: mln/core/image/imorph/tr_image.hh
--- mln/core/image/imorph/tr_image.hh (revision 3942)
+++ mln/core/image/imorph/tr_image.hh (working copy)
@@ -226,7 +226,7 @@
inline
tr_image<S,I,T>
transposed_image(const Site_Set<S>& s, const Image<I>& ima,
- const Function_x2x<T>& t)
+ const Function_v2v<T>& t)
{
tr_image<S,I,T> tmp(exact(s), exact(ima), exact(t));
return tmp;
Index: mln/core/image/edge_image.hh
--- mln/core/image/edge_image.hh (revision 3942)
+++ mln/core/image/edge_image.hh (working copy)
@@ -159,20 +159,20 @@
edge_image();
edge_image(const p_edges<G, site_function_t>& pe);
edge_image(const Graph<G>& g,
- const Function_i2v< site_function_t >& edge_sites,
- const Function_i2v< fun::i2v::array<V> >& edge_values);
+ const Function_v2v< site_function_t >& edge_sites,
+ const Function_v2v< fun::i2v::array<V> >& edge_values);
edge_image(const p_edges<G, site_function_t >& pe,
- const Function_i2v< fun::i2v::array<V> >& edge_values);
+ const Function_v2v< fun::i2v::array<V> >& edge_values);
template <typename FP, typename FV>
edge_image(const Graph<G>& g,
- const Function_i2v<FP>& edge_sites,
- const Function_i2v<FV>& edge_values);
+ const Function_v2v<FP>& edge_sites,
+ const Function_v2v<FV>& edge_values);
template <typename FV>
edge_image(const p_edges<G,site_function_t>& pe,
- const Function_i2v<FV>& edge_values);
+ const Function_v2v<FV>& edge_values);
/// @}
/// Value accessors/operators overloads.
@@ -251,8 +251,8 @@
template <typename P, typename V, typename G>
inline
edge_image<P,V,G>::edge_image(const Graph<G>& g,
- const Function_i2v< site_function_t >& edge_sites,
- const Function_i2v< fun::i2v::array<V> >& edge_values)
+ const Function_v2v< site_function_t >& edge_sites,
+ const Function_v2v< fun::i2v::array<V> >& edge_values)
: super_(exact(edge_values),
p_edges<G,site_function_t>(g, exact(edge_sites)))
{
@@ -262,7 +262,7 @@
template <typename P, typename V, typename G>
inline
edge_image<P,V,G>::edge_image(const p_edges<G,site_function_t>& pe,
- const Function_i2v< fun::i2v::array<V> >& edge_values)
+ const Function_v2v< fun::i2v::array<V> >& edge_values)
: super_(exact(edge_values), pe)
{
}
@@ -272,8 +272,8 @@
template <typename FP, typename FV>
inline
edge_image<P,V,G>::edge_image(const Graph<G>& g,
- const Function_i2v<FP>& edge_sites,
- const Function_i2v<FV>& edge_values)
+ const Function_v2v<FP>& edge_sites,
+ const Function_v2v<FV>& edge_values)
: super_(convert::to<fun::i2v::array<V> >(exact(edge_values)),
p_edges<G,site_function_t>(g, exact(edge_sites)))
{
@@ -287,7 +287,7 @@
template <typename FV>
inline
edge_image<P,V,G>::edge_image(const p_edges<G,site_function_t>& pe,
- const Function_i2v<FV>& edge_values)
+ const Function_v2v<FV>& edge_values)
: super_(convert::to<fun::i2v::array<V> >(exact(edge_values)), pe)
{
mlc_equal(mln_result(FV),V)::check();
Index: mln/core/image/vertex_image.hh
--- mln/core/image/vertex_image.hh (revision 3942)
+++ mln/core/image/vertex_image.hh (working copy)
@@ -162,10 +162,10 @@
vertex_image();
vertex_image(const p_vertices<G, site_function_t>& pv);
vertex_image(const p_vertices<G, site_function_t>& pv,
- const Function_i2v< fun::i2v::array<V> >& vertex_values);
+ const Function_v2v< fun::i2v::array<V> >& vertex_values);
template <typename FV>
vertex_image(const p_vertices<G, site_function_t>& pv,
- const Function_i2v<FV>& vertex_values);
+ const Function_v2v<FV>& vertex_values);
/// @}
/// Value accessors/operators overloads.
@@ -246,7 +246,7 @@
template <typename P, typename V, typename G>
inline
vertex_image<P,V,G>::vertex_image(const p_vertices<G,site_function_t>& pv,
- const Function_i2v< fun::i2v::array<V> >& vertex_values)
+ const Function_v2v< fun::i2v::array<V> >& vertex_values)
: super_(exact(vertex_values), pv)
{
}
@@ -256,7 +256,7 @@
template <typename FV>
inline
vertex_image<P,V,G>::vertex_image(const p_vertices<G,site_function_t>& pv,
- const Function_i2v<FV>& vertex_values)
+ const Function_v2v<FV>& vertex_values)
: super_(convert::to<fun::i2v::array<V> >(exact(vertex_values)), pv)
{
mlc_equal(mln_result(FV),V)::check();
Index: mln/core/point.hh
--- mln/core/point.hh (revision 3942)
+++ mln/core/point.hh (working copy)
@@ -156,7 +156,7 @@
/// Constructor; coordinates are set by function \p f.
template <typename F>
- point(const Function_i2v<F>& f);
+ point(const Function_v2v<F>& f);
/// Set all coordinates to the value \p c.
void set_all(C c);
@@ -338,7 +338,7 @@
template <typename G, typename C>
template <typename F>
inline
- point<G,C>::point(const Function_i2v<F>& f_)
+ point<G,C>::point(const Function_v2v<F>& f_)
{
mlc_converts_to(mln_result(F), C)::check();
const F& f = exact(f_);
Index: mln/core/concept/function.hh
--- mln/core/concept/function.hh (revision 3942)
+++ mln/core/concept/function.hh (working copy)
@@ -31,7 +31,7 @@
/// \file mln/core/concept/function.hh
///
-/// Definition of several concepts of functions.
+/// \brief Definition of several concepts of functions.
# include <mln/core/concept/object.hh>
@@ -39,22 +39,14 @@
namespace mln
{
- // Fwd decls.
+ // Forward declarations.
template <typename E> struct Function;
template <typename E> struct Function_v2v;
- template <typename E> struct Function_v2w2v;
- template <typename E> struct Function_v2w_w2v;
- template <typename E> struct Function_i2b;
- template <typename E> struct Function_i2v;
- template <typename E> struct Function_p2v;
template <typename E> struct Function_v2b;
- template <typename E> struct Function_p2b;
- template <typename E> struct Function_p2p;
- template <typename E> struct Function_x2x;
-
template <typename E> struct Function_vv2v;
template <typename E> struct Function_vv2b;
+
/// Function category flag type.
template <>
struct Function<void>
@@ -63,19 +55,19 @@
};
- /// Base class for implementation of function-objects.
+ /// \brief Base class for implementation of function-objects.
///
/// The parameter \a E is the exact type.
///
+ /// \ingroup modfun
+ //
template <typename E>
struct Function : public Object<E>
{
typedef Function<void> category;
- /*
- ** An operator() has to be provided. Its signature depends
- ** on the particular function-object one considers.
- */
+ /// An operator() has to be provided. Its signature depends
+ /// on the particular function-object one considers.
protected:
Function();
@@ -90,6 +82,7 @@
template <>
struct Function_v2v<void> { typedef Function<void> super; };
+
/// \brief Base class for implementation of function-objects from
/// value to value.
///
@@ -108,149 +101,6 @@
};
- /*----------------------------.
- | Value <-> Value (Bijective) |
- `----------------------------*/
-
- // FIXME : should it also be a v2v function?
-
- template <>
- struct Function_v2w2v<void> { typedef Function<void> super; };
-
- /*!
- * \brief Base class for implementation of function-objects from
- * 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>
- {
- typedef Function_v2w2v<void> category;
-
- /*
- result operator() (value);
- value f_1 (result);
- */
-
- protected:
- Function_v2w2v();
- Function_v2w2v(const Function_v2w2v&);
- };
-
-
- /*---------------------------.
- | Value <-> Value (Two ways) |
- `---------------------------*/
-
- // FIXME : should it also be a v2v function?
-
- template <>
- struct Function_v2w_w2v<void> { typedef Function<void> super; };
-
- /*!
- * \brief Base class for implementation of function-objects from
- * value V to value W and from W to V thanks to the previous
- * value V.
- *
- * The parameter \a E is the exact type.
- *
- * 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>
- {
- typedef Function_v2w_w2v<void> category;
-
- /*
- result operator() (value);
- value f_1 (result, value);
- */
-
- protected:
- Function_v2w_w2v();
- Function_v2w_w2v(const Function_v2w_w2v&);
- };
-
-
- /*-----------------.
- | Index -> bool. |
- `-----------------*/
-
- template <>
- struct Function_i2b<void> { typedef Function_v2b<void> super; };
-
- /// Base class for implementation of function-objects from
- /// index to value.
- ///
- /// The parameter \a E is the exact type.
- ///
- /// \ingroup modfun
- //
- template <typename E>
- struct Function_i2b : public Function_v2b<E>
- {
- typedef Function_i2b<void> category;
- typedef bool result;
- protected:
- Function_i2b();
- Function_i2b(const Function_i2b&);
- };
-
-
- /*-----------------.
- | Index -> Value. |
- `-----------------*/
-
- template <>
- struct Function_i2v<void> { typedef Function_v2v<void> super; };
-
- /// Base class for implementation of function-objects from
- /// index to value.
- ///
- /// The parameter \a E is the exact type.
- ///
- /// \ingroup modfun
- //
- template <typename E>
- struct Function_i2v : public Function_v2v<E>
- {
- typedef Function_i2v<void> category;
- protected:
- Function_i2v();
- Function_i2v(const Function_i2v&);
- };
-
-
- /*-----------------.
- | Point -> Value. |
- `-----------------*/
-
- template <>
- struct Function_p2v<void> { typedef Function_v2v<void> super; };
-
- /// Base class for implementation of function-objects from point to
- /// value.
- ///
- /// The parameter \a E is the exact type.
- ///
- /// \ingroup modfun
- //
- template <typename E>
- struct Function_p2v : public virtual Function_v2v<E>
- {
- typedef Function_p2v<void> category;
- protected:
- Function_p2v();
- Function_p2v(const Function_p2v&);
- };
-
-
/*----------------.
| Value -> bool. |
`----------------*/
@@ -258,8 +108,9 @@
template <>
struct Function_v2b<void> { typedef Function_v2v<void> super; };
- /// Base class for implementation of function-objects from value to
- /// bool.
+
+ /// \brief Base class for implementation of function-objects from a
+ /// value to a Boolean.
///
/// The parameter \a E is the exact type.
///
@@ -276,112 +127,17 @@
};
- /*----------------.
- | Point -> bool. |
- `----------------*/
- template <>
- struct Function_p2b<void> { typedef Function_p2v<void> super; }; // FIXME
-
- /// Base class for implementation of function-objects from point to
- /// bool.
- ///
- /// The parameter \a E is the exact type.
- ///
- /// \ingroup modfun
- //
- template <typename E>
- struct Function_p2b : public Function_p2v<E>,
- public Function_v2b<E>
- {
- typedef Function_p2b<void> category;
- typedef bool result;
- protected:
- Function_p2b();
- Function_p2b(const Function_p2b&);
- };
-
-
- /*-----------------.
- | Point -> Point. |
- `-----------------*/
-
- template <>
- struct Function_p2p<void> { typedef Function_p2v<void> super; }; // FIXME
-
- /// Base class for implementation of function-objects from point to
- /// point.
- ///
- /// The parameter \a E is the exact type.
- ///
- /// \ingroup modfun
- //
- template <typename E>
- struct Function_p2p : public Function_p2v<E>
- {
- typedef Function_p2p<void> category;
- protected:
- Function_p2p();
- Function_p2p(const Function_p2p&);
- };
-
-
- /*-------------------.
- | Vector -> Vector. |
- `-------------------*/
-
- template <>
- struct Function_x2x<void> { typedef Function_v2v<void> super; }; // FIXME
-
- /// Base class for implementation of function-objects from vector to
- /// Vector.
- ///
- /// The parameter \a E is the exact type.
- ///
- /// \ingroup modfun
- //
- template <typename E>
- struct Function_x2x : public Function_v2v<E>
- {
- typedef Function_x2x<void> category;
- protected:
- Function_x2x();
- Function_x2x(const Function_x2x&);
- };
-
-
- /*--------------------.
- | Vector <-> Vector. |
- `--------------------*/
-
- /// Base class for implementation of bijective function-objects from
- /// vector to vector.
- ///
- /// The parameter \a E is the exact type.
- ///
- /// \ingroup modfun
- //
- template <typename E>
- struct Bijection_x2x : public Function_x2x< E >
- {
- /*
- typedef invert;
- invert inv() const;
- */
- protected:
- Bijection_x2x();
- };
-
-
- /*------------------------.
- | Value, Value -> Value. |
- `------------------------*/
+ /*--------------------------.
+ | (Value, Value) -> Value. |
+ `--------------------------*/
template <>
struct Function_vv2v<void> { typedef Function<void> super; };
- /// Base class for implementation of function-objects from
- /// a couple of values to a value.
+
+ /// \brief Base class for implementation of function-objects from a
+ /// couple of values to a value.
///
/// The parameter \a E is the exact type.
///
@@ -396,15 +152,17 @@
Function_vv2v(const Function_vv2v&);
};
- /*------------------------.
- | Value, Value -> Boolean.|
- `------------------------*/
+
+ /*--------------------------.
+ | (Value, Value) -> Boolean.|
+ `--------------------------*/
template <>
struct Function_vv2b<void> { typedef Function<void> super; };
- /// Base class for implementation of function-objects from
- /// a couple of values to a boolean.
+
+ /// \brief Base class for implementation of function-objects from a
+ /// couple of values to a Boolean.
///
/// The parameter \a E is the exact type.
///
@@ -421,8 +179,11 @@
};
+
# ifndef MLN_INCLUDE_ONLY
+ // Function.
+
template <typename E>
inline
Function<E>::Function()
@@ -437,6 +198,8 @@
{
}
+ // Function_v2v.
+
template <typename E>
inline
Function_v2v<E>::Function_v2v()
@@ -450,72 +213,7 @@
{
}
- template <typename E>
- inline
- Function_v2w2v<E>::Function_v2w2v()
- {
- }
-
- template <typename E>
- inline
- Function_v2w2v<E>::Function_v2w2v(const Function_v2w2v<E>& rhs)
- : Function<E>(rhs)
- {
- }
-
- template <typename E>
- inline
- Function_v2w_w2v<E>::Function_v2w_w2v()
- {
- }
-
- template <typename E>
- inline
- Function_v2w_w2v<E>::Function_v2w_w2v(const Function_v2w_w2v<E>& rhs)
- : Function<E>(rhs)
- {
- }
-
- template <typename E>
- inline
- Function_i2b<E>::Function_i2b()
- {
- }
-
- template <typename E>
- inline
- Function_i2b<E>::Function_i2b(const Function_i2b<E>& rhs)
- : Function_v2v<E>(rhs),
- Function_v2b<E>(rhs)
- {
- }
-
-
- template <typename E>
- inline
- Function_i2v<E>::Function_i2v()
- {
- }
-
- template <typename E>
- inline
- Function_i2v<E>::Function_i2v(const Function_i2v<E>& rhs)
- : Function_v2v<E>(rhs)
- {
- }
-
- template <typename E>
- inline
- Function_p2v<E>::Function_p2v()
- {
- }
-
- template <typename E>
- inline
- Function_p2v<E>::Function_p2v(const Function_p2v<E>& rhs)
- : Function_v2v<E>(rhs)
- {
- }
+ // Function_v2b.
template <typename E>
inline
@@ -530,56 +228,7 @@
{
}
- template <typename E>
- inline
- Function_p2b<E>::Function_p2b()
- {
- }
-
- template <typename E>
- inline
- Function_p2b<E>::Function_p2b(const Function_p2b<E>& rhs)
- : Function_v2v<E>(rhs),
- Function_p2v<E>(rhs),
- Function_v2b<E>(rhs)
- {
- }
-
- template <typename E>
- inline
- Function_p2p<E>::Function_p2p()
- {
- }
-
- template <typename E>
- inline
- Function_p2p<E>::Function_p2p(const Function_p2p<E>& rhs)
- : Function_v2v<E>(rhs),
- Function_p2v<E>(rhs)
- {
- }
-
- template <typename E>
- inline
- Function_x2x<E>::Function_x2x()
- {
- }
-
- template <typename E>
- inline
- Function_x2x<E>::Function_x2x(const Function_x2x<E>& rhs)
- : Function_v2v<E>(rhs)
- {
- }
-
- template <typename E>
- inline
- Bijection_x2x<E>::Bijection_x2x()
- {
- typedef typename E::invert invert;
- invert (E::*m)() const = & E::inv;
- m = 0;
- }
+ // Function_vv2v.
template <typename E>
inline
@@ -594,6 +243,8 @@
{
}
+ // Function_vv2b.
+
template <typename E>
inline
Function_vv2b<E>::Function_vv2b()
Index: mln/core/dpoint.hh
--- mln/core/dpoint.hh (revision 3942)
+++ mln/core/dpoint.hh (working copy)
@@ -115,7 +115,7 @@
/// Constructor; coordinates are set by function \p f.
template <typename F>
- dpoint(const Function_i2v<F>& f);
+ dpoint(const Function_v2v<F>& f);
/// Set all coordinates to the value \p c.
void set_all(C c);
@@ -238,7 +238,7 @@
template <typename G, typename C>
template <typename F>
inline
- dpoint<G,C>::dpoint(const Function_i2v<F>& f_)
+ dpoint<G,C>::dpoint(const Function_v2v<F>& f_)
{
mlc_converts_to(mln_result(F), C)::check();
const F& f = exact(f_);
Index: mln/metal/vec.hh
--- mln/metal/vec.hh (revision 3942)
+++ mln/metal/vec.hh (working copy)
@@ -206,7 +206,7 @@
/// Constructor; coordinates are set by function \p f.
template <typename F>
- vec(const Function_i2v<F>& f);
+ vec(const Function_v2v<F>& f);
/// Zero value.
static const vec<n, T> zero;
@@ -427,7 +427,7 @@
template <unsigned n, typename T>
template <typename F>
inline
- vec<n, T>::vec(const Function_i2v<F>& f_)
+ vec<n, T>::vec(const Function_v2v<F>& f_)
{
mlc_converts_to(mln_result(F), T)::check();
const F& f = exact(f_);
Index: mln/metal/mat.hh
--- mln/metal/mat.hh (revision 3942)
+++ mln/metal/mat.hh (working copy)
@@ -104,7 +104,7 @@
/// Constructor; coordinates are set by function \p f.
template <typename F>
- mat(const Function_i2v<F>& f);
+ mat(const Function_v2v<F>& f);
template <typename U>
mat& operator=(const mat<n,m,U>& rhs);
@@ -291,7 +291,7 @@
template <unsigned n, unsigned m, typename T>
template <typename F>
inline
- mat<n,m,T>::mat(const Function_i2v<F>& f_)
+ mat<n,m,T>::mat(const Function_v2v<F>& f_)
{
mlc_converts_to(mln_result(F), T)::check();
const F& f = exact(f_);
Index: mln/data/transform.spe.hh
--- mln/data/transform.spe.hh (revision 3942)
+++ mln/data/transform.spe.hh (working copy)
@@ -31,7 +31,13 @@
/// \file mln/data/transform.spe.hh
///
-/// Specializations for mln::data::transform.
+/// \brief Specializations for mln::data::transform.
+///
+/// \todo The implementation (and thus the dispatch) involving a lut
+/// has been de-activated; the patch of Z does not work anymore since
+/// we do not make the difference between i2v and v2v functions.
+/// Actually the patch was no acceptable solution to the lut problem
+/// (for some values, we cannot compute f(v) to put into the lut...)
# ifndef MLN_LEVEL_TRANSFORM_HH
# error "Forbidden inclusion of *.spe.hh"
@@ -96,37 +102,37 @@
}
- template <typename I, typename F>
- mln_ch_value(I, mln_result(F))
- transform_lowq_v2v(const Image<I>& input_, const Function_v2v<F>& f_)
- {
- trace::entering("data::impl::transform_lowq_v2v");
+// template <typename I, typename F>
+// mln_ch_value(I, mln_result(F))
+// transform_lowq_v2v(const Image<I>& input_, const Function_v2v<F>& f_)
+// {
+// trace::entering("data::impl::transform_lowq_v2v");
- mlc_is(mln_trait_image_pw_io(mln_ch_value(I, mln_result(F))),
- trait::image::pw_io::read_write)::check();
+// mlc_is(mln_trait_image_pw_io(mln_ch_value(I, mln_result(F))),
+// trait::image::pw_io::read_write)::check();
- const I& input = exact(input_);
- const F& f = exact(f_);
- data::internal::transform_tests(input, f);
+// const I& input = exact(input_);
+// const F& f = exact(f_);
+// data::internal::transform_tests(input, f);
- mln_ch_value(I, mln_result(F)) output;
- initialize(output, input);
+// mln_ch_value(I, mln_result(F)) output;
+// initialize(output, input);
- value::lut_vec<mln_vset(I), mln_result(F)>
- lut(input.values_eligible(), f);
+// value::lut_vec<mln_vset(I), mln_result(F)>
+// lut(input.values_eligible(), f);
- mln_piter(I) p(input.domain());
- for_all(p)
- output(p) = lut(input(p));
+// mln_piter(I) p(input.domain());
+// for_all(p)
+// output(p) = lut(input(p));
- trace::exiting("data::impl::transform_lowq_v2v");
- return output;
- }
+// trace::exiting("data::impl::transform_lowq_v2v");
+// return output;
+// }
template <typename I, typename F>
mln_ch_value(I, mln_result(F))
- transform_lowq_i2v(const Image<I>& input_, const Function_i2v<F>& f_)
+ transform_lowq_i2v(const Image<I>& input_, const Function_v2v<F>& f_)
{
trace::entering("data::impl::transform_lowq");
@@ -149,37 +155,37 @@
}
- template <typename I, typename F>
- mln_ch_value(I, mln_result(F))
- transform_taken_v2v(const Image<I>& input_, const Function_v2v<F>& f_)
- {
- trace::entering("data::impl::transform_taken_v2v");
+// template <typename I, typename F>
+// mln_ch_value(I, mln_result(F))
+// transform_taken_v2v(const Image<I>& input_, const Function_v2v<F>& f_)
+// {
+// trace::entering("data::impl::transform_taken_v2v");
- mlc_is(mln_trait_image_pw_io(mln_ch_value(I, mln_result(F))),
- trait::image::pw_io::read_write)::check();
+// mlc_is(mln_trait_image_pw_io(mln_ch_value(I, mln_result(F))),
+// trait::image::pw_io::read_write)::check();
- const I& input = exact(input_);
- const F& f = exact(f_);
- data::internal::transform_tests(input, f);
+// const I& input = exact(input_);
+// const F& f = exact(f_);
+// data::internal::transform_tests(input, f);
- mln_ch_value(I, mln_result(F)) output;
- initialize(output, input);
+// mln_ch_value(I, mln_result(F)) output;
+// initialize(output, input);
- value::lut_vec<mln_vset(I), mln_result(F)>
- lut(input.taken_values(), f);
+// value::lut_vec<mln_vset(I), mln_result(F)>
+// lut(input.taken_values(), f);
- mln_piter(I) p(input.domain());
- for_all(p)
- output(p) = lut(input(p));
+// mln_piter(I) p(input.domain());
+// for_all(p)
+// output(p) = lut(input(p));
- trace::exiting("data::impl::transform_taken_v2v");
- return output;
- }
+// trace::exiting("data::impl::transform_taken_v2v");
+// return output;
+// }
template <typename I, typename F>
mln_ch_value(I, mln_result(F))
- transform_taken_i2v(const Image<I>& input_, const Function_i2v<F>& f_)
+ transform_taken_i2v(const Image<I>& input_, const Function_v2v<F>& f_)
{
trace::entering("data::impl::transform_taken_i2v");
@@ -333,42 +339,42 @@
return data::impl::generic::transform(input, f);
}
- template <typename I, typename F>
- inline
- mln_ch_value(I, mln_result(F))
- transform_dispatch(trait::image::vw_set::uni,
- trait::image::quant::low,
- const Image<I>& input, const Function_v2v<F>& f)
- {
- return data::impl::transform_taken_v2v(input, f);
- }
+// template <typename I, typename F>
+// inline
+// mln_ch_value(I, mln_result(F))
+// transform_dispatch(trait::image::vw_set::uni,
+// trait::image::quant::low,
+// const Image<I>& input, const Function_v2v<F>& f)
+// {
+// return data::impl::transform_taken_v2v(input, f);
+// }
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
transform_dispatch(trait::image::vw_set::uni,
trait::image::quant::low,
- const Image<I>& input, const Function_i2v<F>& f)
+ const Image<I>& input, const Function_v2v<F>& f)
{
return data::impl::transform_taken_i2v(input, f);
}
- template <typename I, typename F>
- inline
- mln_ch_value(I, mln_result(F))
- transform_dispatch(trait::image::vw_set::any,
- trait::image::quant::low,
- const Image<I>& input, const Function_v2v<F>& f)
- {
- return data::impl::transform_lowq_v2v(input, f);
- }
+// template <typename I, typename F>
+// inline
+// mln_ch_value(I, mln_result(F))
+// transform_dispatch(trait::image::vw_set::any,
+// trait::image::quant::low,
+// const Image<I>& input, const Function_v2v<F>& f)
+// {
+// return data::impl::transform_lowq_v2v(input, f);
+// }
template <typename I, typename F>
inline
mln_ch_value(I, mln_result(F))
transform_dispatch(trait::image::vw_set::any,
trait::image::quant::low,
- const Image<I>& input, const Function_i2v<F>& f)
+ const Image<I>& input, const Function_v2v<F>& f)
{
return data::impl::transform_lowq_i2v(input, f);
}
@@ -393,15 +399,15 @@
return data::impl::transform_fast_lowq(input, f);
}
- template <typename I, typename F>
- inline
- mln_ch_value(I, mln_result(F))
- transform_dispatch(trait::image::quant::low,
- trait::image::value_access::direct,
- const Image<I>& input, const Function_i2v<F>& f)
- {
- return data::impl::transform_fast(input, f);
- }
+// template <typename I, typename F>
+// inline
+// mln_ch_value(I, mln_result(F))
+// transform_dispatch(trait::image::quant::low,
+// trait::image::value_access::direct,
+// const Image<I>& input, const Function_v2v<F>& f)
+// {
+// return data::impl::transform_fast(input, f);
+// }
template <typename I, typename F>
inline
Index: mln/value/shell.hh
--- mln/value/shell.hh (revision 3942)
+++ mln/value/shell.hh (working copy)
@@ -54,7 +54,7 @@
template <typename F, typename I>
- struct shell_<F, I, Function_v2w2v<void> >
+ struct shell_<F, I, Function_v2v<void> >
{
const mln_value(I)&
set_(I& ima, const mln_site(I)& s, mln_result(F) v);
@@ -62,7 +62,7 @@
template <typename F, typename I>
- struct shell_<F, I, Function_v2w_w2v<void> >
+ struct shell_<F, I, Function_v2v<void> >
{
const mln_value(I)&
set_(I& ima, const mln_site(I)& s, mln_result(F) v);
@@ -150,7 +150,7 @@
template <typename F, typename I>
const mln_value(I)&
- shell_<F, I, Function_v2w2v<void> >::set_(I& ima,
+ shell_<F, I, Function_v2v<void> >::set_(I& ima,
const mln_site(I)& s,
mln_result(F) v)
{
@@ -161,7 +161,7 @@
template <typename F, typename I>
const mln_value(I)&
- shell_<F, I, Function_v2w_w2v<void> >::set_(I& ima,
+ shell_<F, I, Function_v2v<void> >::set_(I& ima,
const mln_site(I)& s,
mln_result(F) v)
{
Index: mln/make/w_window.hh
--- mln/make/w_window.hh (revision 3942)
+++ mln/make/w_window.hh (working copy)
@@ -54,7 +54,7 @@
*/
template <typename W, typename F>
mln::w_window<mln_dpsite(W), mln_result(F)>
- w_window(const Window<W>& win, const Function_p2v<F>& wei);
+ w_window(const Window<W>& win, const Function_v2v<F>& wei);
# ifndef MLN_INCLUDE_ONLY
@@ -62,7 +62,7 @@
template <typename W, typename F>
inline
mln::w_window<mln_dpsite(W), mln_result(F)>
- w_window(const Window<W>& win_, const Function_p2v<F>& wei_)
+ w_window(const Window<W>& win_, const Function_v2v<F>& wei_)
{
trace::entering("make::w_window");
Index: mln/make/edge_image.hh
--- mln/make/edge_image.hh (revision 3942)
+++ mln/make/edge_image.hh (working copy)
@@ -69,8 +69,8 @@
template <typename FP, typename FV, typename G>
mln::edge_image<mln_result(FP),mln_result(FV),G>
edge_image(const Graph<G>& g_,
- const Function_i2v<FP>& fp,
- const Function_i2v<FV>& fv);
+ const Function_v2v<FP>& fp,
+ const Function_v2v<FV>& fv);
@@ -129,8 +129,8 @@
template <typename FP, typename FV, typename G>
mln::edge_image<mln_result(FP),mln_result(FV),G>
edge_image(const Graph<G>& g_,
- const Function_i2v<FP>& fp,
- const Function_i2v<FV>& fv)
+ const Function_v2v<FP>& fp,
+ const Function_v2v<FV>& fv)
{
trace::entering("make::edge_image");
const G& g = exact(g_);
Index: mln/make/vertex_image.hh
--- mln/make/vertex_image.hh (revision 3942)
+++ mln/make/vertex_image.hh (working copy)
@@ -53,7 +53,7 @@
//
template <typename G, typename FV>
mln::vertex_image<void,mln_result(FV),G>
- vertex_image(const Graph<G>& g, const Function_i2v<FV>& fv);
+ vertex_image(const Graph<G>& g, const Function_v2v<FV>& fv);
/// Construct a vertex image
@@ -67,8 +67,8 @@
template <typename FP, typename FV, typename G>
mln::vertex_image<mln_result(FP),mln_result(FV),G>
vertex_image(const Graph<G>& g_,
- const Function_i2v<FP>& fp,
- const Function_i2v<FV>& fv);
+ const Function_v2v<FP>& fp,
+ const Function_v2v<FV>& fv);
@@ -76,7 +76,7 @@
template <typename G, typename FV>
mln::vertex_image<void,mln_result(FV),G>
- vertex_image(const Graph<G>& g, const Function_i2v<FV>& fv)
+ vertex_image(const Graph<G>& g, const Function_v2v<FV>& fv)
{
trace::entering("make::vertex_image");
mln_precondition(exact(g).is_valid());
@@ -93,8 +93,8 @@
template <typename FP, typename FV, typename G>
mln::vertex_image<mln_result(FP),mln_result(FV),G>
vertex_image(const Graph<G>& g_,
- const Function_i2v<FP>& fp,
- const Function_i2v<FV>& fv)
+ const Function_v2v<FP>& fp,
+ const Function_v2v<FV>& fv)
{
trace::entering("make::vertex_image");
const G& g = exact(g_);
Index: mln/test/predicate.hh
--- mln/test/predicate.hh (revision 3942)
+++ mln/test/predicate.hh (working copy)
@@ -71,7 +71,7 @@
/// \param[in] f The predicate.
//
template <typename S, typename F>
- bool predicate(const Site_Set<S>& pset, const Function_p2b<F>& f);
+ bool predicate(const Site_Set<S>& pset, const Function_v2b<F>& f);
# ifndef MLN_INCLUDE_ONLY
@@ -112,7 +112,7 @@
template <typename S, typename F>
inline
void predicate_tests(const Site_Set<S>& pset,
- const Function_p2b<F>& f)
+ const Function_v2b<F>& f)
{
mln_precondition(exact(pset).is_valid());
(void) pset;
@@ -241,7 +241,7 @@
template <typename S, typename F>
inline
- bool predicate(const Site_Set<S>& pset, const Function_p2b<F>& f)
+ bool predicate(const Site_Set<S>& pset, const Function_v2b<F>& f)
{
trace::entering("test::predicate");
Index: mln/pw/var.hh
--- mln/pw/var.hh (revision 3942)
+++ mln/pw/var.hh (working copy)
@@ -45,7 +45,7 @@
{
template <typename V>
- struct var_ : public Function_p2v< var_<V> >
+ struct var_ : public Function_v2v< var_<V> >
{
typedef V result;
Index: mln/fun/p2b/chess.hh
--- mln/fun/p2b/chess.hh (revision 3942)
+++ mln/fun/p2b/chess.hh (working copy)
@@ -48,7 +48,7 @@
// FIXME: Doc!
- struct chess : public Function_p2b< chess >
+ struct chess : public Function_v2b< chess >
{
typedef bool result;
bool operator()(const point2d& p) const;
Index: mln/fun/p2b/big_chess.hh
--- mln/fun/p2b/big_chess.hh (revision 3942)
+++ mln/fun/p2b/big_chess.hh (working copy)
@@ -48,7 +48,7 @@
// FIXME: Doc!
template <typename B>
- struct big_chess : public Function_p2b< big_chess<B> >
+ struct big_chess : public Function_v2b< big_chess<B> >
{
typedef bool result;
typedef mln_psite(B) P;
Index: mln/fun/p2b/antilogy.hh
--- mln/fun/p2b/antilogy.hh (revision 3942)
+++ mln/fun/p2b/antilogy.hh (working copy)
@@ -49,7 +49,7 @@
///
/// A simpler name would be `false', but this is not a valid C++
/// identifier, as \c false is a keyword of the language.
- struct antilogy : public Function_p2b< antilogy >
+ struct antilogy : public Function_v2b< antilogy >
{
typedef bool result;
Index: mln/fun/p2b/tautology.hh
--- mln/fun/p2b/tautology.hh (revision 3942)
+++ mln/fun/p2b/tautology.hh (working copy)
@@ -49,7 +49,7 @@
///
/// A simpler name would be `true', but this is not a valid C++
/// identifier, as \c true is a keyword of the language.
- struct tautology : public Function_p2b< tautology >
+ struct tautology : public Function_v2b< tautology >
{
typedef bool result;
Index: mln/fun/p2b/has.hh
--- mln/fun/p2b/has.hh (revision 3942)
+++ mln/fun/p2b/has.hh (working copy)
@@ -54,7 +54,7 @@
template <typename I>
struct has
- : public Function_p2b< has<I> >,
+ : public Function_v2b< has<I> >,
private mlc_is_a(I, Image)::check_t
{
/// Result associated type.
@@ -79,7 +79,7 @@
private:
mlc_const(I) ima_;
- typedef Function_p2b< has<I> > super_;
+ typedef Function_v2b< has<I> > super_;
};
Index: mln/fun/meta/hue.hh
--- mln/fun/meta/hue.hh (revision 3942)
+++ mln/fun/meta/hue.hh (working copy)
@@ -53,7 +53,7 @@
template <class H, class S, class I>
struct function< meta::hue< value::hsi_<H, S, I> > >
- : public Function_v2w_w2v<function< meta::hue < value::hsi_<H, S, I> > > >
+ : public Function_v2v<function< meta::hue < value::hsi_<H, S, I> > > >
{
typedef value::hsi_<H, S, I> value;
@@ -66,7 +66,7 @@
template <class H, class S, class L>
struct function< meta::hue< value::hsl_<H, S, L> > >
- : public Function_v2w_w2v<function< meta::hue < value::hsl_<H, S, L> > > >
+ : public Function_v2v<function< meta::hue < value::hsl_<H, S, L> > > >
{
typedef value::hsl_<H, S, L> value;
Index: mln/fun/meta/inty.hh
--- mln/fun/meta/inty.hh (revision 3942)
+++ mln/fun/meta/inty.hh (working copy)
@@ -53,7 +53,7 @@
template <class H, class S, class I>
struct function< meta::inty< value::hsi_<H, S, I> > >
- : public Function_v2w_w2v<function< meta::inty < value::hsi_<H, S, I> > > >
+ : public Function_v2v<function< meta::inty < value::hsi_<H, S, I> > > >
{
typedef value::hsi_<H, S, I> value;
Index: mln/fun/meta/sat.hh
--- mln/fun/meta/sat.hh (revision 3942)
+++ mln/fun/meta/sat.hh (working copy)
@@ -54,7 +54,7 @@
template <class H, class S, class I>
struct function< meta::sat< value::hsi_<H, S, I> > >
- : public Function_v2w_w2v<function< meta::sat < value::hsi_<H, S, I> > > >
+ : public Function_v2v<function< meta::sat < value::hsi_<H, S, I> > > >
{
typedef value::hsi_<H, S, I> value;
@@ -68,7 +68,7 @@
template <class H, class S, class L>
struct function< meta::sat< value::hsl_<H, S, L> > >
- : public Function_v2w_w2v<function< meta::sat < value::hsl_<H, S, L> > > >
+ : public Function_v2v<function< meta::sat < value::hsl_<H, S, L> > > >
{
typedef value::hsl_<H, S, L> value;
Index: mln/fun/meta/blue.hh
--- mln/fun/meta/blue.hh (revision 3942)
+++ mln/fun/meta/blue.hh (working copy)
@@ -52,7 +52,7 @@
template <unsigned n>
struct function< meta::blue< value::rgb<n> > >
- : public Function_v2w_w2v<function< meta::blue < value::rgb<n> > > >
+ : public Function_v2v<function< meta::blue < value::rgb<n> > > >
{
typedef value::rgb<n> value;
Index: mln/fun/meta/first.hh
--- mln/fun/meta/first.hh (revision 3942)
+++ mln/fun/meta/first.hh (working copy)
@@ -53,7 +53,7 @@
template <typename T, typename U>
struct function< meta::first< util::couple<T,U> > >
- : public Function_v2w_w2v<function< meta::first < util::couple<T,U> > > >
+ : public Function_v2v<function< meta::first < util::couple<T,U> > > >
{
typedef util::couple<T,U> value;
Index: mln/fun/meta/red.hh
--- mln/fun/meta/red.hh (revision 3942)
+++ mln/fun/meta/red.hh (working copy)
@@ -53,7 +53,7 @@
template <unsigned n>
struct function< meta::red< value::rgb<n> > >
- : public Function_v2w_w2v<function< meta::red < value::rgb<n> > > >
+ : public Function_v2v<function< meta::red < value::rgb<n> > > >
{
typedef value::rgb<n> value;
Index: mln/fun/meta/second.hh
--- mln/fun/meta/second.hh (revision 3942)
+++ mln/fun/meta/second.hh (working copy)
@@ -53,7 +53,7 @@
template <typename T, typename U>
struct function< meta::second< util::couple<T,U> > >
- : public Function_v2w_w2v<function< meta::second < util::couple<T,U> > > >
+ : public Function_v2v<function< meta::second < util::couple<T,U> > > >
{
typedef util::couple<T,U> value;
Index: mln/fun/meta/lum.hh
--- mln/fun/meta/lum.hh (revision 3942)
+++ mln/fun/meta/lum.hh (working copy)
@@ -53,7 +53,7 @@
template <class H, class S, class I>
struct function< meta::lum< value::hsl_<H, S, I> > >
- : public Function_v2w_w2v<function< meta::lum < value::hsl_<H, S, I> > > >
+ : public Function_v2v<function< meta::lum < value::hsl_<H, S, I> > > >
{
typedef value::hsl_<H, S, I> value;
Index: mln/fun/meta/green.hh
--- mln/fun/meta/green.hh (revision 3942)
+++ mln/fun/meta/green.hh (working copy)
@@ -52,7 +52,7 @@
template <unsigned n>
struct function< meta::green< value::rgb<n> > >
- : public Function_v2w_w2v<function< meta::green < value::rgb<n> > > >
+ : public Function_v2v<function< meta::green < value::rgb<n> > > >
{
typedef value::rgb<n> value;
Index: mln/fun/v2w2v/cos.hh
--- mln/fun/v2w2v/cos.hh (revision 3942)
+++ mln/fun/v2w2v/cos.hh (working copy)
@@ -58,7 +58,7 @@
* \see mln::math::cos.
*/
template <typename V>
- struct cos : public Function_v2w2v< cos<V> >
+ struct cos : public Function_v2v< cos<V> >
{
typedef V result;
V operator()(const V& v) const;
Index: mln/fun/cast.hh
--- mln/fun/cast.hh (revision 3942)
+++ mln/fun/cast.hh (working copy)
@@ -44,7 +44,7 @@
// FIXME: Doc!
template <typename V, typename F>
- struct cast_p2v_expr_ : public Function_p2v< cast_p2v_expr_<V,F> >
+ struct cast_p2v_expr_ : public Function_v2v< cast_p2v_expr_<V,F> >
{
typedef V result;
@@ -69,7 +69,7 @@
template <typename V, typename F>
inline
cast_p2v_expr_<V, F>
- cast(const Function_p2v<F>& f)
+ cast(const Function_v2v<F>& f)
{
cast_p2v_expr_<V, F> tmp(exact(f));
return tmp;
Index: mln/fun/ops.hh
--- mln/fun/ops.hh (revision 3942)
+++ mln/fun/ops.hh (working copy)
@@ -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_OPS_HH
# define MLN_FUN_OPS_HH
-/*! \file mln/fun/ops.hh
- *
- * \brief FIXME.
- */
+/// \file mln/fun/ops.hh
+///
+/// \brief FIXME.
# include <mln/core/concept/function.hh>
# include <mln/fun/internal/selector.hh>
@@ -152,32 +152,6 @@
namespace mln
{
- // -> p2v
-
- mln_decl_binary_expr_(p2v, p2b, eq, ==);
- mln_decl_binary_expr_(p2v, p2b, neq, !=);
-
- mln_decl_binary_expr_(p2v, p2b, less, <);
- mln_decl_binary_expr_(p2v, p2b, leq , <=);
- mln_decl_binary_expr_(p2v, p2b, geq, >=);
- mln_decl_binary_expr_(p2v, p2b, greater, >);
-
- mln_decl_binary_expr_(p2b, p2b, and_, &&);
- mln_decl_binary_expr_(p2b, p2b, or_, ||);
- mln_decl_binary_expr_(p2b, p2b, xor_, ^);
-
- mln_decl_unary_expr_(p2b, p2b, not_, !);
-
- mln_decl_binary_expr_(p2v, p2v, plus, +);
- mln_decl_binary_expr_(p2v, p2v, minus, -);
- mln_decl_binary_expr_(p2v, p2v, times, *);
- mln_decl_binary_expr_(p2v, p2v, div, /);
- mln_decl_binary_expr_(p2v, p2v, mod, %);
-
- mln_decl_unary_expr_(p2v, p2v, uplus, +);
- mln_decl_unary_expr_(p2v, p2v, uminus, -);
-
- // -> v2b
mln_decl_binary_expr_(v2v, v2b, eq, ==);
mln_decl_binary_expr_(v2v, v2b, neq, !=);
@@ -193,6 +167,15 @@
mln_decl_unary_expr_(v2b, v2b, not_, !);
+ mln_decl_binary_expr_(v2v, v2v, plus, +);
+ mln_decl_binary_expr_(v2v, v2v, minus, -);
+ mln_decl_binary_expr_(v2v, v2v, times, *);
+ mln_decl_binary_expr_(v2v, v2v, div, /);
+ mln_decl_binary_expr_(v2v, v2v, mod, %);
+
+ mln_decl_unary_expr_(v2v, v2v, uplus, +);
+ mln_decl_unary_expr_(v2v, v2v, uminus, -);
+
} // end of namespace mln
Index: mln/fun/i2v/all_to.hh
--- mln/fun/i2v/all_to.hh (revision 3942)
+++ mln/fun/i2v/all_to.hh (working copy)
@@ -46,7 +46,7 @@
{
template <typename T>
- struct all_to : public Function_i2v< all_to<T> >
+ struct all_to : public Function_v2v< all_to<T> >
{
typedef T result;
all_to(T t);
Index: mln/fun/i2v/array.hh
--- mln/fun/i2v/array.hh (revision 3942)
+++ mln/fun/i2v/array.hh (working copy)
@@ -97,13 +97,13 @@
template <typename T, bool B = false >
struct array_selector_
- : public Function_i2v< i2v::array<T> >
+ : public Function_v2v< i2v::array<T> >
{
};
template <typename T>
struct array_selector_<T,true>
- : public Function_i2b< i2v::array<T> >
+ : public Function_v2b< i2v::array<T> >
{
};
Index: mln/fun/p2p/fold.hh
--- mln/fun/p2p/fold.hh (revision 3942)
+++ mln/fun/p2p/fold.hh (working copy)
@@ -57,7 +57,7 @@
int dir_0 = -1,
int dir_1 = -1,
int dir_2 = -1 >
- struct fold : Function_p2p< fold<P,dir_0,dir_1,dir_2> >
+ struct fold : Function_v2v< fold<P,dir_0,dir_1,dir_2> >
{
fold();
fold(const box<P>& b);
Index: mln/fun/p2p/mirror.hh
--- mln/fun/p2p/mirror.hh (revision 3942)
+++ mln/fun/p2p/mirror.hh (working copy)
@@ -45,7 +45,7 @@
{
template <typename B>
- struct mirror : public Function_p2p< mirror<B> >
+ struct mirror : public Function_v2v< mirror<B> >
{
typedef mln_psite(B) result;
Index: mln/fun/p2p/translation.hh
--- mln/fun/p2p/translation.hh (revision 3942)
+++ mln/fun/p2p/translation.hh (working copy)
@@ -47,7 +47,7 @@
{
template <typename P>
- struct translation_t : public Function_p2p< translation_t<P> >
+ struct translation_t : public Function_v2v< translation_t<P> >
{
typedef P result;
Index: mln/fun/p2v/elifs.hh
--- mln/fun/p2v/elifs.hh (revision 3942)
+++ mln/fun/p2v/elifs.hh (working copy)
@@ -50,9 +50,9 @@
typename O>
ternary_<T1, N1,
ternary_<T2, N2, O> >
- elifs(const Function_p2b<T1>& f_if_1, const Function_p2v<N1>& f_then_1,
- const Function_p2b<T2>& f_if_2, const Function_p2v<N2>& f_then_2,
- const Function_p2v<O>& f_otherwise);
+ elifs(const Function_v2b<T1>& f_if_1, const Function_v2v<N1>& f_then_1,
+ const Function_v2b<T2>& f_if_2, const Function_v2v<N2>& f_then_2,
+ const Function_v2v<O>& f_otherwise);
# ifndef MLN_INCLUDE_ONLY
@@ -63,9 +63,9 @@
inline
ternary_<T1, N1,
ternary_<T2, N2, O> >
- elifs(const Function_p2b<T1>& f_if_1, const Function_p2v<N1>& f_then_1,
- const Function_p2b<T2>& f_if_2, const Function_p2v<N2>& f_then_2,
- const Function_p2v<O>& f_otherwise)
+ elifs(const Function_v2b<T1>& f_if_1, const Function_v2v<N1>& f_then_1,
+ const Function_v2b<T2>& f_if_2, const Function_v2v<N2>& f_then_2,
+ const Function_v2v<O>& f_otherwise)
{
typedef ternary_<T2, N2, O> T2_N2_O;
T2_N2_O f_otherwise_1(f_if_2, f_then_2, f_otherwise);
Index: mln/fun/p2v/ternary.hh
--- mln/fun/p2v/ternary.hh (revision 3942)
+++ mln/fun/p2v/ternary.hh (working copy)
@@ -51,9 +51,9 @@
{
typedef mln_result(T) result;
- ternary_(const Function_p2b<P>& f_pred,
- const Function_p2v<T>& f_true,
- const Function_p2v<F>& f_false);
+ ternary_(const Function_v2b<P>& f_pred,
+ const Function_v2v<T>& f_true,
+ const Function_v2v<F>& f_false);
template <typename Pt>
result operator()(const Pt& p) const;
@@ -67,18 +67,18 @@
template <typename P, typename T, typename F>
ternary_<P, T, F>
- ternary(const Function_p2b<P>& f_pred,
- const Function_p2v<T>& f_true,
- const Function_p2v<F>& f_false);
+ ternary(const Function_v2b<P>& f_pred,
+ const Function_v2v<T>& f_true,
+ const Function_v2v<F>& f_false);
# ifndef MLN_INCLUDE_ONLY
template <typename P, typename T, typename F>
inline
- ternary_<P,T,F>::ternary_(const Function_p2b<P>& f_pred,
- const Function_p2v<T>& f_true,
- const Function_p2v<F>& f_false)
+ ternary_<P,T,F>::ternary_(const Function_v2b<P>& f_pred,
+ const Function_v2v<T>& f_true,
+ const Function_v2v<F>& f_false)
: f_pred_(exact(f_pred)),
f_true_(exact(f_true)),
f_false_(exact(f_false))
@@ -98,9 +98,9 @@
template <typename P, typename T, typename F>
inline
ternary_<P, T, F>
- ternary(const Function_p2b<P>& f_pred,
- const Function_p2v<T>& f_true,
- const Function_p2v<F>& f_false)
+ ternary(const Function_v2b<P>& f_pred,
+ const Function_v2v<T>& f_true,
+ const Function_v2v<F>& f_false)
{
ternary_<P, T, F> tmp(exact(f_pred),
exact(f_true),
Index: mln/fun/p2v/iota.hh
--- mln/fun/p2v/iota.hh (revision 3942)
+++ mln/fun/p2v/iota.hh (working copy)
@@ -45,7 +45,7 @@
namespace p2v
{
- struct iota : public Function_p2v< iota >
+ struct iota : public Function_v2v< iota >
{
typedef unsigned result;
Index: mln/fun/internal/x2x_linear_impl.hh
--- mln/fun/internal/x2x_linear_impl.hh (revision 3942)
+++ mln/fun/internal/x2x_linear_impl.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,10 @@
#ifndef MLN_FUN_INTERNAL_X2X_LINEAR_IMPL_HH
# define MLN_FUN_INTERNAL_X2X_LINEAR_IMPL_HH
-/*! \file mln/fun/internal/x2x_linear_impl.hh
- *
- * \brief Implementation class for every linear Function_x2x.
- */
+/// \file mln/fun/internal/x2x_linear_impl.hh
+///
+/// \brief Implementation class for every linear function from vector
+/// to vector in an homogeneous coordinates system.
# include <mln/core/concept/function.hh>
# include <mln/algebra/h_mat.hh>
Index: mln/fun/internal/selector.hh
--- mln/fun/internal/selector.hh (revision 3942)
+++ mln/fun/internal/selector.hh (working copy)
@@ -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,18 +29,13 @@
#ifndef MLN_FUN_INTERNAL_SELECTOR_HH
# define MLN_FUN_INTERNAL_SELECTOR_HH
-/*! \file mln/fun/internal/selector.hh
- *
- * \brief FIXME.
- */
+/// \file mln/fun/internal/selector.hh
+///
+/// \brief Select a concept (either Function_v2v or Function_v2b)
+/// depending on the result type.
# include <mln/core/concept/function.hh>
-# include <mln/core/concept/site.hh>
-# include <mln/core/concept/pseudo_site.hh>
# include <mln/metal/unqualif.hh>
-# include <mln/metal/if.hh>
-# include <mln/metal/is_a.hh>
-# include <mln/algebra/vec.hh>
namespace mln
@@ -51,119 +47,17 @@
namespace internal
{
- // Function_v2v
- // |
- // + ---------------------- Function_v2b
- // | |
- // + -- Function_i2v |
- // | |
- // + -- Function_x2x |
- // | |
- // + -- Function_p2v |
- // | |
- // + -- Function_p2b -- +
- // |
- // + -- Function_p2p
-
- enum
- {
- b_,
- i_,
- p_,
- v_,
- x_
- };
-
- template <int arg, int res, typename E> struct helper_selector_;
-
- // b2* => v2v type, except for v2b
- template <typename E>
- struct helper_selector_< b_, b_, E > { typedef Function_v2b<E> ret; };
- template <typename E>
- struct helper_selector_< b_, i_, E > { typedef Function_v2v<E> ret; };
- template <typename E>
- struct helper_selector_< b_, p_, E > { typedef Function_v2v<E> ret; };
- template <typename E>
- struct helper_selector_< b_, v_, E > { typedef Function_v2v<E> ret; };
- template <typename E>
- struct helper_selector_< b_, x_, E > { typedef Function_v2v<E> ret; };
-
- // i2* => i2v type
- template <typename E>
- struct helper_selector_< i_, b_, E > { typedef Function_i2v<E> ret; };
- template <typename E>
- struct helper_selector_< i_, i_, E > { typedef Function_i2v<E> ret; };
- template <typename E>
- struct helper_selector_< i_, p_, E > { typedef Function_i2v<E> ret; };
- template <typename E>
- struct helper_selector_< i_, v_, E > { typedef Function_i2v<E> ret; };
- template <typename E>
- struct helper_selector_< i_, x_, E > { typedef Function_i2v<E> ret; };
-
- // p2*
- template <typename E>
- struct helper_selector_< p_, b_, E > { typedef Function_p2b<E> ret; };
- template <typename E>
- struct helper_selector_< p_, i_, E > { typedef Function_p2v<E> ret; }; // no p2i type => p2v
- template <typename E>
- struct helper_selector_< p_, p_, E > { typedef Function_p2p<E> ret; };
- template <typename E>
- struct helper_selector_< p_, v_, E > { typedef Function_p2v<E> ret; };
- template <typename E>
- struct helper_selector_< p_, x_, E > { typedef Function_p2v<E> ret; };
-
- // v2* => v2v type, except for v2b
- template <typename E>
- struct helper_selector_< v_, b_, E > { typedef Function_v2b<E> ret; };
- template <typename E>
- struct helper_selector_< v_, i_, E > { typedef Function_v2v<E> ret; };
- template <typename E>
- struct helper_selector_< v_, p_, E > { typedef Function_v2v<E> ret; };
- template <typename E>
- struct helper_selector_< v_, v_, E > { typedef Function_v2v<E> ret; };
- template <typename E>
- struct helper_selector_< v_, x_, E > { typedef Function_v2v<E> ret; };
-
- // x2* => v2v type
- template <typename E>
- struct helper_selector_< x_, b_, E > { typedef Function_v2b<E> ret; };
- template <typename E>
- struct helper_selector_< x_, i_, E > { typedef Function_v2v<E> ret; };
- template <typename E>
- struct helper_selector_< x_, p_, E > { typedef Function_v2v<E> ret; };
- template <typename E>
- struct helper_selector_< x_, v_, E > { typedef Function_v2v<E> ret; };
- template <typename E>
- struct helper_selector_< x_, x_, E > { typedef Function_v2v<E> ret; };
-
- // tag_
-
- template <typename T> struct tag_;
-
- template <>
- struct tag_< bool >
- {
- enum { value = b_ };
- };
-
- template <>
- struct tag_< unsigned >
- {
- enum { value = i_ };
- };
- template <unsigned n, typename T>
- struct tag_< algebra::vec<n,T> >
+ template <typename A, typename R, typename E>
+ struct helper_selector_
{
- enum { value = x_ };
+ typedef Function_v2v<E> ret;
};
- template <typename T>
- struct tag_
+ template <typename A, typename E>
+ struct helper_selector_< A, bool, E >
{
- enum { value = (mlc_is_a(T, Site)::value || mlc_is_a(T, Pseudo_Site)::value)
- ? p_
- : v_ };
+ typedef Function_v2b<E> ret;
};
@@ -172,20 +66,15 @@
{
typedef mlc_unqualif(R_) R;
typedef mlc_unqualif(A_) A;
- enum { arg = tag_<A>::value,
- res = tag_<R>::value };
- typedef typename helper_selector_<arg, res, E>::ret ret;
+ typedef typename helper_selector_<R, A, E>::ret ret;
private:
selector_();
};
template <typename R_, typename E>
- struct selector_p2_
+ struct selector_p2_ : selector_< R_, void, E >
{
- typedef mlc_unqualif(R_) R;
- enum { res = tag_<R>::value };
- typedef typename helper_selector_<p_, res, E>::ret ret;
private:
selector_p2_();
};
Index: mln/fun/x2x/composed.hh
--- mln/fun/x2x/composed.hh (revision 3942)
+++ mln/fun/x2x/composed.hh (working copy)
@@ -64,7 +64,7 @@
template <typename T2, typename T1, typename E>
struct helper_composed_<T2,T1,E,true>
: public fun::internal::x2x_linear_impl_<mln_result(T2), E >,
- public Bijection_x2x<E>
+ public Function_v2v<E>
{
typedef fun::internal::x2x_linear_impl_<typename T2::result, E > super_;
@@ -102,7 +102,7 @@
template <typename T2, typename T1, typename E>
struct helper_composed_<T2,T1,E,false>
: public fun::internal::x2x_linear_impl_<mln_result(T2), E >,
- public Function_x2x<E>
+ public Function_v2v<E>
{
typedef fun::internal::x2x_linear_impl_<typename T2::result, E > super_;
@@ -138,8 +138,8 @@
template <typename T2, typename T1>
struct composed
: public internal::helper_composed_<T2,T1,composed<T2,T1>,
- mlc_is(T2, Bijection_x2x<T2>)::value &&
- mlc_is(T1, Bijection_x2x<T1>)::value>,
+ mlc_is(T2, Function_v2v<T2>)::value &&
+ mlc_is(T1, Function_v2v<T1>)::value>,
private metal::and_< metal::bool_<(T2::dim == T1::dim)>,
metal::is<mln_argument(T2), mln_result(T1)>
>::check_t
@@ -150,8 +150,8 @@
/// Constructor with the two transformation to be composed.
composed(const T2& f, const T1& g)
: internal::helper_composed_<T2,T1,composed<T2,T1>,
- mlc_is(T2, Bijection_x2x<T2>)::value &&
- mlc_is(T1, Bijection_x2x<T1>)::value>(f, g)
+ mlc_is(T2, Function_v2v<T2>)::value &&
+ mlc_is(T1, Function_v2v<T1>)::value>(f, g)
{}
};
Index: mln/fun/x2x/translation.hh
--- mln/fun/x2x/translation.hh (revision 3942)
+++ mln/fun/x2x/translation.hh (working copy)
@@ -51,7 +51,7 @@
template <unsigned n, typename C>
struct translation
: fun::internal::x2x_linear_impl_< algebra::vec<n,C>, translation<n,C> >
- , public Bijection_x2x< translation<n,C> >
+ , public Function_v2v< translation<n,C> >
{
typedef fun::internal::x2x_linear_impl_< algebra::vec<n,C>, translation<n,C> > super_;
Index: mln/fun/x2x/rotation.hh
--- mln/fun/x2x/rotation.hh (revision 3942)
+++ mln/fun/x2x/rotation.hh (working copy)
@@ -137,7 +137,7 @@
template <unsigned n, typename C>
struct rotation
: fun::internal::x2x_linear_impl_< algebra::vec<n,C>, rotation<n,C> >
- , public Bijection_x2x< rotation<n,C> >
+ , public Function_v2v< rotation<n,C> >
{
typedef fun::internal::x2x_linear_impl_< algebra::vec<n,C>, rotation<n,C> > super_;
Index: mln/fun/v2w_w2v/norm.hh
--- mln/fun/v2w_w2v/norm.hh (revision 3942)
+++ mln/fun/v2w_w2v/norm.hh (working copy)
@@ -56,7 +56,7 @@
///
/// \see mln::norm::l1.
template <typename V, typename R>
- struct l1_norm : public Function_v2w_w2v< l1_norm<V, R> >
+ struct l1_norm : public Function_v2v< l1_norm<V, R> >
{
typedef R result;
R operator()(const V& v) const;
@@ -69,7 +69,7 @@
///
/// \see mln::norm::l2.
template <typename V, typename R>
- struct l2_norm : public Function_v2w_w2v< l2_norm<V, R> >
+ struct l2_norm : public Function_v2v< l2_norm<V, R> >
{
typedef R result;
R operator()(const V& v) const;
@@ -82,7 +82,7 @@
///
/// \see mln::norm::linfty.
template <typename V, typename R>
- struct linfty_norm : public Function_v2w_w2v< linfty_norm<V, R> >
+ struct linfty_norm : public Function_v2v< linfty_norm<V, R> >
{
typedef R result;
R operator()(const V& v) const;
Index: mln/set/diff.hh
--- mln/set/diff.hh (revision 3942)
+++ mln/set/diff.hh (working copy)
@@ -34,7 +34,7 @@
/// Set theoretic difference (non-symmetrical) of a couple of
/// sets.
///
-/// \todo Add a diff(Site_Set& in_place, Function_p2b).
+/// \todo Add a diff(Site_Set& in_place, Function_v2b).
# include <algorithm>
# include <iterator>
Index: mln/algebra/mat.hh
--- mln/algebra/mat.hh (revision 3942)
+++ mln/algebra/mat.hh (working copy)
@@ -107,7 +107,7 @@
/// Constructor; coordinates are set by function \p f.
template <typename F>
- mat(const Function_i2v<F>& f);
+ mat(const Function_v2v<F>& f);
template <typename U>
mat& operator=(const mat<n,m,U>& rhs);
@@ -480,7 +480,7 @@
template <unsigned n, unsigned m, typename T>
template <typename F>
inline
- mat<n,m,T>::mat(const Function_i2v<F>& f_)
+ mat<n,m,T>::mat(const Function_v2v<F>& f_)
{
mlc_converts_to(mln_result(F), T)::check();
const F& f = exact(f_);
Index: mln/algebra/vec.hh
--- mln/algebra/vec.hh (revision 3942)
+++ mln/algebra/vec.hh (working copy)
@@ -241,7 +241,7 @@
/// Constructor; coordinates are set by function \p f.
template <typename F>
- vec(const Function_i2v<F>& f);
+ vec(const Function_v2v<F>& f);
/// Zero value.
static const vec<n, T> zero;
@@ -553,7 +553,7 @@
template <unsigned n, typename T>
template <typename F>
inline
- vec<n, T>::vec(const Function_i2v<F>& f_)
+ vec<n, T>::vec(const Function_v2v<F>& f_)
{
mlc_converts_to(mln_result(F), T)::check();
const F& f = exact(f_);
Index: mln/morpho/tree/filter/min.hh
--- mln/morpho/tree/filter/min.hh (revision 3942)
+++ mln/morpho/tree/filter/min.hh (working copy)
@@ -55,23 +55,23 @@
** @param[out] f_ Image to filter.
** @param[in] pred_ Filtering criterion.
*/
- template <typename T, typename F, typename P2B>
+ template <typename T, typename F, typename P>
inline
void
- min(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_);
+ min(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_);
# ifndef MLN_INCLUDE_ONLY
- template <typename T, typename F, typename P2B>
+ template <typename T, typename F, typename P>
inline
void
- min(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_)
+ min(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_)
{
F& f = exact(f_);
- const P2B& pred = exact(pred_);
+ const P& pred = exact(pred_);
trace::entering("mln::morpho::tree::filter::min");
Index: mln/morpho/tree/filter/max.hh
--- mln/morpho/tree/filter/max.hh (revision 3942)
+++ mln/morpho/tree/filter/max.hh (working copy)
@@ -54,23 +54,23 @@
** @param[out] f_ Image to filter.
** @param[in] pred_ Filtering criterion.
*/
- template <typename T, typename F, typename P2B>
+ template <typename T, typename F, typename P>
inline
void
- max(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_);
+ max(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_);
# ifndef MLN_INCLUDE_ONLY
- template <typename T, typename F, typename P2B>
+ template <typename T, typename F, typename P>
inline
void
- max(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_)
+ max(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_)
{
F& f = exact(f_);
- const P2B& pred = exact(pred_);
+ const P& pred = exact(pred_);
trace::entering("mln::morpho::tree::filter::max");
Index: mln/morpho/tree/filter/filter.hh
--- mln/morpho/tree/filter/filter.hh (revision 3942)
+++ mln/morpho/tree/filter/filter.hh (working copy)
@@ -55,21 +55,21 @@
** @param pred_ Predicate.
** @param v Value to propagate.
*/
- template <typename T, typename F, typename P2B>
+ template <typename T, typename F, typename P>
inline
void
- filter(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_, const mln_value(F)& v);
+ filter(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_, const mln_value(F)& v);
# ifndef MLN_INCLUDE_ONLY
- template <typename T, typename F, typename P2B>
+ template <typename T, typename F, typename P>
inline
void
- filter(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_, const mln_value(F)& v)
+ filter(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_, const mln_value(F)& v)
{
F& f = exact(f_);
- const P2B& pred = exact(pred_);
+ const P& pred = exact(pred_);
trace::entering("mln::morpho::tree::filter::filter");
Index: mln/morpho/tree/filter/direct.hh
--- mln/morpho/tree/filter/direct.hh (revision 3942)
+++ mln/morpho/tree/filter/direct.hh (working copy)
@@ -53,23 +53,23 @@
** @param[out] f_ Image to filter.
** @param[in] pred_ Filtering criterion.
*/
- template <typename T, typename F, typename P2B>
+ template <typename T, typename F, typename P>
inline
void
- direct(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_);
+ direct(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_);
# ifndef MLN_INCLUDE_ONLY
- template <typename T, typename F, typename P2B>
+ template <typename T, typename F, typename P>
inline
void
- direct(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_)
+ direct(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_)
{
F& f = exact(f_);
- const P2B& pred = exact(pred_);
+ const P& pred = exact(pred_);
trace::entering("mln::morpho::tree::filter::direct");
Index: mln/morpho/tree/filter/subtractive.hh
--- mln/morpho/tree/filter/subtractive.hh (revision 3942)
+++ mln/morpho/tree/filter/subtractive.hh (working copy)
@@ -57,23 +57,23 @@
** @param[out] f_ Image to filter.
** @param[in] pred_ Filtering criterion.
*/
- template <typename T, typename F, typename P2B>
+ template <typename T, typename F, typename P>
inline
void
- subtractive(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_);
+ subtractive(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_);
# ifndef MLN_INCLUDE_ONLY
- template <typename T, typename F, typename P2B>
+ template <typename T, typename F, typename P>
inline
void
- subtractive(const T& tree, Image<F>& f_, const Function_p2b<P2B>& pred_)
+ subtractive(const T& tree, Image<F>& f_, const Function_v2b<P>& pred_)
{
F& f = exact(f_);
- const P2B& pred = exact(pred_);
+ const P& pred = exact(pred_);
trace::entering("mln::morpho::tree::filter::subtractive");
Index: mln/morpho/tree/propagate_if.hh
--- mln/morpho/tree/propagate_if.hh (revision 3942)
+++ mln/morpho/tree/propagate_if.hh (working copy)
@@ -46,8 +46,8 @@
namespace morpho {
namespace tree {
- template <typename WP>
- struct way_of_propagation : Object< WP > { protected: way_of_propagation() {}; };
+ template <typename W>
+ struct way_of_propagation : Object< W > { protected: way_of_propagation() {}; };
struct desc_propagation : way_of_propagation <desc_propagation> {};
struct asc_propagation : way_of_propagation <asc_propagation> {};
@@ -63,22 +63,22 @@
** @param v Value to be propagated. (By default \p v is the value
** at the node being propagated).
*/
- template <typename T, typename A, typename P2B, typename WP>
+ template <typename T, typename A, typename P, typename W>
inline
void
propagate_if(const T& tree,
Image<A>& a_,
- const way_of_propagation<WP>&,
- const Function_p2b<P2B>& pred,
+ const way_of_propagation<W>&,
+ const Function_v2b<P>& pred,
const mln_value(A)& v);
- template <typename T, typename A, typename P2B>
+ template <typename T, typename A, typename P>
inline
void
propagate_if(const T& tree,
Image<A>& a_,
const desc_propagation&,
- const Function_p2b<P2B>& pred);
+ const Function_v2b<P>& pred);
/**
** Propagate nodes having the value v in the way
@@ -92,21 +92,21 @@
** @param v_prop Value to propagate (By default it is the value
** at the node being propagated).
*/
- template <typename T, typename A, typename WP>
+ template <typename T, typename A, typename W>
inline
void
propagate_if_value(const T& tree,
Image<A>& a_,
- const way_of_propagation<WP>&,
+ const way_of_propagation<W>&,
const mln_value(A)& v,
const mln_value(A)& v_prop);
- template <typename T, typename A, typename WP>
+ template <typename T, typename A, typename W>
inline
void
propagate_if_value(const T& tree,
Image<A>& a_,
- const way_of_propagation<WP>&,
+ const way_of_propagation<W>&,
const mln_value(A)& v);
@@ -116,11 +116,11 @@
namespace internal
{
- template <typename T, typename A, typename P2B>
+ template <typename T, typename A, typename P>
bool check_propagate_if(const T& t,
const A& a,
const asc_propagation& prop,
- const P2B& pred,
+ const P& pred,
const mln_value(A)& v)
{
(void) prop;
@@ -131,11 +131,11 @@
return true;
}
- template <typename T, typename A, typename P2B>
+ template <typename T, typename A, typename P>
bool check_propagate_if(const T& t,
const A& a,
const desc_propagation& prop,
- const P2B& pred,
+ const P& pred,
const mln_value(A)& v)
{
(void) prop;
@@ -146,11 +146,11 @@
return true;
}
- template <typename T, typename A, typename P2B>
+ template <typename T, typename A, typename P>
bool check_propagate_if(const T& t,
const A& a,
const desc_propagation& prop,
- const P2B& pred)
+ const P& pred)
{
(void) prop;
mln_node_piter(T) n(t);
@@ -160,13 +160,13 @@
return true;
}
- template <typename T, typename A, typename P2B>
+ template <typename T, typename A, typename P>
inline
void
propagate_if(const T& tree,
A& a,
const desc_propagation& prop,
- const P2B& pred,
+ const P& pred,
const mln_value(A)& v)
{
(void) prop;
@@ -190,13 +190,13 @@
mln_postcondition(check_propagate_if(tree, a, prop, pred, v));
}
- template <typename T, typename A, typename P2B>
+ template <typename T, typename A, typename P>
inline
void
propagate_if(const T& tree,
A& a,
const desc_propagation& prop,
- const P2B& pred)
+ const P& pred)
{
(void) prop;
@@ -220,13 +220,13 @@
}
- template <typename T, typename A, typename P2B>
+ template <typename T, typename A, typename P>
inline
void
propagate_if(const T& tree,
A& a,
const asc_propagation& prop,
- const P2B& pred,
+ const P& pred,
const mln_value(A)& v)
{
(void) prop;
@@ -256,62 +256,62 @@
/* Facades */
- template <typename T, typename A, typename WP>
+ template <typename T, typename A, typename W>
inline
void
propagate_if_value(const T& tree,
Image<A>& a_,
- const way_of_propagation<WP>& prop_,
+ const way_of_propagation<W>& prop_,
const mln_value(A)& v,
const mln_value(A)& v_prop)
{
A& a = exact(a_);
- const WP& prop = exact(prop_);
+ const W& prop = exact(prop_);
internal::propagate_if(tree, a, prop, pw::value(a) == pw::cst(v), v_prop);
}
- template <typename T, typename A, typename WP>
+ template <typename T, typename A, typename W>
inline
void
propagate_if_value(const T& tree,
Image<A>& a_,
- const way_of_propagation<WP>& prop_,
+ const way_of_propagation<W>& prop_,
const mln_value(A)& v)
{
A& a = exact(a_);
- const WP& prop = exact(prop_);
+ const W& prop = exact(prop_);
internal::propagate_if(tree, a, prop, pw::value(a) == pw::cst(v), v);
}
- template <typename T, typename A, typename P2B, typename WP>
+ template <typename T, typename A, typename P, typename W>
inline
void
propagate_if(const T& tree,
Image<A>& a_,
- const way_of_propagation<WP>& prop_,
- const Function_p2b<P2B>& pred_,
+ const way_of_propagation<W>& prop_,
+ const Function_v2b<P>& pred_,
const mln_value(A)& v)
{
A& a = exact(a_);
- const WP& prop = exact(prop_);
- const P2B& pred = exact(pred_);
+ const W& prop = exact(prop_);
+ const P& pred = exact(pred_);
internal::propagate_if(tree, a, prop, pred, v);
}
- template <typename T, typename A, typename P2B>
+ template <typename T, typename A, typename P>
inline
void
propagate_if(const T& tree,
Image<A>& a_,
const desc_propagation& prop,
- const Function_p2b<P2B>& pred_)
+ const Function_v2b<P>& pred_)
{
A& a = exact(a_);
- const P2B& pred = exact(pred_);
+ const P& pred = exact(pred_);
internal::propagate_if(tree, a, prop, pred);
}
Index: mln/util/internal/id2element.hh
--- mln/util/internal/id2element.hh (revision 3942)
+++ mln/util/internal/id2element.hh (working copy)
@@ -46,7 +46,7 @@
{
template <typename G, typename Elt>
- struct id2element : Function_i2v< id2element<G,Elt> >
+ struct id2element : Function_v2v< id2element<G,Elt> >
{
typedef Elt result;
Index: mln/util/array.hh
--- mln/util/array.hh (revision 3942)
+++ mln/util/array.hh (working copy)
@@ -93,7 +93,7 @@
/// \ingroup modutil
//
template <typename T>
- class array : public Function_i2v< mln::util::array<T> >
+ class array : public Function_v2v< mln::util::array<T> >
{
public:
@@ -101,7 +101,7 @@
typedef T element;
/// Returned value types.
- /// Related to the Function_i2v concept.
+ /// Related to the Function_v2v concept.
/// @{
typedef T result;
typedef typename std::vector<T>::reference mutable_result;
Index: tests/arith/minus_full.cc
--- tests/arith/minus_full.cc (revision 3942)
+++ tests/arith/minus_full.cc (working copy)
@@ -55,7 +55,7 @@
-struct f_box1d_t : mln::Function_p2b< f_box1d_t >
+struct f_box1d_t : mln::Function_v2b< f_box1d_t >
{
f_box1d_t(const mln::box1d& b)
: b_(b)
@@ -68,7 +68,7 @@
}
};
-struct f_box2d_t : mln::Function_p2b< f_box2d_t >
+struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
@@ -81,7 +81,7 @@
}
};
-struct f_box3d_t : mln::Function_p2b< f_box3d_t >
+struct f_box3d_t : mln::Function_v2b< f_box3d_t >
{
f_box3d_t(const mln::box3d& b)
: b_(b)
Index: tests/arith/times_full.cc
--- tests/arith/times_full.cc (revision 3942)
+++ tests/arith/times_full.cc (working copy)
@@ -50,7 +50,7 @@
-struct f_box1d_t : mln::Function_p2b< f_box1d_t >
+struct f_box1d_t : mln::Function_v2b< f_box1d_t >
{
f_box1d_t(const mln::box1d& b)
: b_(b)
@@ -63,7 +63,7 @@
}
};
-struct f_box2d_t : mln::Function_p2b< f_box2d_t >
+struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
@@ -76,7 +76,7 @@
}
};
-struct f_box3d_t : mln::Function_p2b< f_box3d_t >
+struct f_box3d_t : mln::Function_v2b< f_box3d_t >
{
f_box3d_t(const mln::box3d& b)
: b_(b)
Index: tests/arith/plus_full.cc
--- tests/arith/plus_full.cc (revision 3942)
+++ tests/arith/plus_full.cc (working copy)
@@ -49,7 +49,7 @@
-struct f_box1d_t : mln::Function_p2b< f_box1d_t >
+struct f_box1d_t : mln::Function_v2b< f_box1d_t >
{
f_box1d_t(const mln::box1d& b)
: b_(b)
@@ -62,7 +62,7 @@
}
};
-struct f_box2d_t : mln::Function_p2b< f_box2d_t >
+struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
@@ -75,7 +75,7 @@
}
};
-struct f_box3d_t : mln::Function_p2b< f_box3d_t >
+struct f_box3d_t : mln::Function_v2b< f_box3d_t >
{
f_box3d_t(const mln::box3d& b)
: b_(b)
Index: tests/arith/revert_full.cc
--- tests/arith/revert_full.cc (revision 3942)
+++ tests/arith/revert_full.cc (working copy)
@@ -50,7 +50,7 @@
-struct f_box1d_t : mln::Function_p2b< f_box1d_t >
+struct f_box1d_t : mln::Function_v2b< f_box1d_t >
{
f_box1d_t(const mln::box1d& b)
: b_(b)
@@ -63,7 +63,7 @@
}
};
-struct f_box2d_t : mln::Function_p2b< f_box2d_t >
+struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
@@ -76,7 +76,7 @@
}
};
-struct f_box3d_t : mln::Function_p2b< f_box3d_t >
+struct f_box3d_t : mln::Function_v2b< f_box3d_t >
{
f_box3d_t(const mln::box3d& b)
: b_(b)
Index: tests/data/compute_full.cc
--- tests/data/compute_full.cc (revision 3942)
+++ tests/data/compute_full.cc (working copy)
@@ -51,7 +51,7 @@
-struct f_box1d_t : mln::Function_p2b< f_box1d_t >
+struct f_box1d_t : mln::Function_v2b< f_box1d_t >
{
f_box1d_t(const mln::box1d& b)
: b_(b)
@@ -64,7 +64,7 @@
}
};
-struct f_box2d_t : mln::Function_p2b< f_box2d_t >
+struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
@@ -77,7 +77,7 @@
}
};
-struct f_box3d_t : mln::Function_p2b< f_box3d_t >
+struct f_box3d_t : mln::Function_v2b< f_box3d_t >
{
f_box3d_t(const mln::box3d& b)
: b_(b)
Index: tests/data/fill_full.cc
--- tests/data/fill_full.cc (revision 3942)
+++ tests/data/fill_full.cc (working copy)
@@ -62,7 +62,7 @@
-struct f_box1d_t : mln::Function_p2b< f_box1d_t >
+struct f_box1d_t : mln::Function_v2b< f_box1d_t >
{
f_box1d_t(const mln::box1d& b)
: b_(b)
@@ -75,7 +75,7 @@
}
};
-struct f_box2d_t : mln::Function_p2b< f_box2d_t >
+struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
@@ -88,7 +88,7 @@
}
};
-struct f_box3d_t : mln::Function_p2b< f_box3d_t >
+struct f_box3d_t : mln::Function_v2b< f_box3d_t >
{
f_box3d_t(const mln::box3d& b)
: b_(b)
Index: tests/data/abs_full.cc
--- tests/data/abs_full.cc (revision 3942)
+++ tests/data/abs_full.cc (working copy)
@@ -53,7 +53,7 @@
-struct f_box1d_t : mln::Function_p2b< f_box1d_t >
+struct f_box1d_t : mln::Function_v2b< f_box1d_t >
{
f_box1d_t(const mln::box1d& b)
: b_(b)
@@ -66,7 +66,7 @@
}
};
-struct f_box2d_t : mln::Function_p2b< f_box2d_t >
+struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
@@ -79,7 +79,7 @@
}
};
-struct f_box3d_t : mln::Function_p2b< f_box3d_t >
+struct f_box3d_t : mln::Function_v2b< f_box3d_t >
{
f_box3d_t(const mln::box3d& b)
: b_(b)
Index: tests/data/paste_full.cc
--- tests/data/paste_full.cc (revision 3942)
+++ tests/data/paste_full.cc (working copy)
@@ -56,7 +56,7 @@
-struct f_box1d_t : mln::Function_p2b< f_box1d_t >
+struct f_box1d_t : mln::Function_v2b< f_box1d_t >
{
f_box1d_t(const mln::box1d& b)
: b_(b)
@@ -69,7 +69,7 @@
}
};
-struct f_box2d_t : mln::Function_p2b< f_box2d_t >
+struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
@@ -82,7 +82,7 @@
}
};
-struct f_box3d_t : mln::Function_p2b< f_box3d_t >
+struct f_box3d_t : mln::Function_v2b< f_box3d_t >
{
f_box3d_t(const mln::box3d& b)
: b_(b)
Index: tests/data/compare_full.cc
--- tests/data/compare_full.cc (revision 3942)
+++ tests/data/compare_full.cc (working copy)
@@ -46,7 +46,7 @@
#include <mln/arith/minus.hh>
-struct f_box1d_t : mln::Function_p2b< f_box1d_t >
+struct f_box1d_t : mln::Function_v2b< f_box1d_t >
{
f_box1d_t(const mln::box1d& b)
: b_(b)
@@ -59,7 +59,7 @@
}
};
-struct f_box2d_t : mln::Function_p2b< f_box2d_t >
+struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
@@ -72,7 +72,7 @@
}
};
-struct f_box3d_t : mln::Function_p2b< f_box3d_t >
+struct f_box3d_t : mln::Function_v2b< f_box3d_t >
{
f_box3d_t(const mln::box3d& b)
: b_(b)
Index: tests/border/get_full.cc
--- tests/border/get_full.cc (revision 3942)
+++ tests/border/get_full.cc (working copy)
@@ -41,7 +41,7 @@
#include <mln/value/rgb8.hh>
-struct f_box2d_t : mln::Function_p2b< f_box2d_t >
+struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
Index: tests/border/find_full.cc
--- tests/border/find_full.cc (revision 3942)
+++ tests/border/find_full.cc (working copy)
@@ -48,7 +48,7 @@
#include <mln/core/routine/duplicate.hh>
-struct f_box1d_t : mln::Function_p2b< f_box1d_t >
+struct f_box1d_t : mln::Function_v2b< f_box1d_t >
{
f_box1d_t(const mln::box1d& b)
: b_(b)
@@ -61,7 +61,7 @@
}
};
-struct f_box2d_t : mln::Function_p2b< f_box2d_t >
+struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
@@ -74,7 +74,7 @@
}
};
-struct f_box3d_t : mln::Function_p2b< f_box3d_t >
+struct f_box3d_t : mln::Function_v2b< f_box3d_t >
{
f_box3d_t(const mln::box3d& b)
: b_(b)
Index: tests/border/resize_sub_image.cc
--- tests/border/resize_sub_image.cc (revision 3942)
+++ tests/border/resize_sub_image.cc (working copy)
@@ -39,7 +39,7 @@
#include <mln/literal/origin.hh>
#include <mln/border/resize.hh>
-struct my_box2d : mln::Function_p2b< my_box2d >
+struct my_box2d : mln::Function_v2b< my_box2d >
{
my_box2d(const mln::box2d& b)
: b_(b)
Index: tests/border/get.cc
--- tests/border/get.cc (revision 3942)
+++ tests/border/get.cc (working copy)
@@ -39,7 +39,7 @@
#include <mln/literal/origin.hh>
-struct f_box2d_t : mln::Function_p2b< f_box2d_t >
+struct f_box2d_t : mln::Function_v2b< f_box2d_t >
{
f_box2d_t(const mln::box2d& b)
: b_(b)
Index: tests/border/resize_image_if.cc
--- tests/border/resize_image_if.cc (revision 3942)
+++ tests/border/resize_image_if.cc (working copy)
@@ -39,7 +39,7 @@
#include <mln/literal/origin.hh>
#include <mln/border/resize.hh>
-struct my_box2d : mln::Function_p2b< my_box2d >
+struct my_box2d : mln::Function_v2b< my_box2d >
{
my_box2d(const mln::box2d& b)
: b_(b)
Index: tests/make/w_window.cc
--- tests/make/w_window.cc (revision 3942)
+++ tests/make/w_window.cc (working copy)
@@ -37,7 +37,7 @@
#include <mln/core/alias/w_window2d_int.hh>
-struct test : mln::Function_p2v<test>
+struct test : mln::Function_v2v<test>
{
typedef int result;
int operator()(const mln::point2d& p) const
Index: tests/test/positive.cc
--- tests/test/positive.cc (revision 3942)
+++ tests/test/positive.cc (working copy)
@@ -38,7 +38,7 @@
// both test routines can be called with a p2b function
template <typename F>
-void test_p2v(const mln::Function_p2v<F>&)
+void test_p2v(const mln::Function_v2v<F>&)
{
}
Index: tests/morpho/watershed/superpose.cc
--- tests/morpho/watershed/superpose.cc (revision 3942)
+++ tests/morpho/watershed/superpose.cc (working copy)
@@ -49,7 +49,7 @@
namespace mln
{
- struct ref_data : Function_p2v<ref_data>
+ struct ref_data : Function_v2v<ref_data>
{
typedef value::rgb8 result;
Index: tests/canvas/browsing/fwd.cc
--- tests/canvas/browsing/fwd.cc (revision 3942)
+++ tests/canvas/browsing/fwd.cc (working copy)
@@ -66,7 +66,7 @@
template <typename I, typename F, typename B>
void my_test(Image<I>& ima_,
- const Function_p2v<F>& f_,
+ const Function_v2v<F>& f_,
const Browsing<B>& browse_)
{
I& ima = exact(ima_);
Index: tests/canvas/browsing/snake_fwd.cc
--- tests/canvas/browsing/snake_fwd.cc (revision 3942)
+++ tests/canvas/browsing/snake_fwd.cc (working copy)
@@ -69,7 +69,7 @@
template <typename I, typename F, typename B>
void my_test(Image<I>& ima_,
- const Function_p2v<F>& f_,
+ const Function_v2v<F>& f_,
const Browsing<B>& browse_)
{
I& ima = exact(ima_);
Index: tests/canvas/browsing/snake_vert.cc
--- tests/canvas/browsing/snake_vert.cc (revision 3942)
+++ tests/canvas/browsing/snake_vert.cc (working copy)
@@ -70,7 +70,7 @@
template <typename I, typename F, typename B>
void my_test(Image<I>& ima_,
- const Function_p2v<F>& f_,
+ const Function_v2v<F>& f_,
const Browsing<B>& browse_)
{
I& ima = exact(ima_);
Index: tests/canvas/browsing/snake_generic_2d_vert.cc
--- tests/canvas/browsing/snake_generic_2d_vert.cc (revision 3942)
+++ tests/canvas/browsing/snake_generic_2d_vert.cc (working copy)
@@ -81,7 +81,7 @@
template <typename I, typename F, typename B>
void my_test(Image<I>& ima_,
- const Function_p2v<F>& f_,
+ const Function_v2v<F>& f_,
const Browsing<B>& browse_)
{
I& ima = exact(ima_);
Index: tests/canvas/browsing/snake_generic_2d_hori.cc
--- tests/canvas/browsing/snake_generic_2d_hori.cc (revision 3942)
+++ tests/canvas/browsing/snake_generic_2d_hori.cc (working copy)
@@ -81,7 +81,7 @@
template <typename I, typename F, typename B>
void my_test(Image<I>& ima_,
- const Function_p2v<F>& f_,
+ const Function_v2v<F>& f_,
const Browsing<B>& browse_)
{
I& ima = exact(ima_);
Index: tests/canvas/browsing/snake_generic_3d_vert.cc
--- tests/canvas/browsing/snake_generic_3d_vert.cc (revision 3942)
+++ tests/canvas/browsing/snake_generic_3d_vert.cc (working copy)
@@ -88,7 +88,7 @@
template <typename I, typename F, typename B>
void my_test(Image<I>& ima_,
- const Function_p2v<F>& f_,
+ const Function_v2v<F>& f_,
const Browsing<B>& browse_)
{
I& ima = exact(ima_);
Index: tests/canvas/browsing/snake_generic_3d_hori.cc
--- tests/canvas/browsing/snake_generic_3d_hori.cc (revision 3942)
+++ tests/canvas/browsing/snake_generic_3d_hori.cc (working copy)
@@ -88,7 +88,7 @@
template <typename I, typename F, typename B>
void my_test(Image<I>& ima_,
- const Function_p2v<F>& f_,
+ const Function_v2v<F>& f_,
const Browsing<B>& browse_)
{
I& ima = exact(ima_);
Index: tests/canvas/browsing/hyper_directional.cc
--- tests/canvas/browsing/hyper_directional.cc (revision 3942)
+++ tests/canvas/browsing/hyper_directional.cc (working copy)
@@ -74,7 +74,7 @@
template <typename I, typename F, typename B>
void my_test(Image<I>& ima_,
- const Function_p2v<F>& f_,
+ const Function_v2v<F>& f_,
const Browsing<B>& browse_,
int dir = 0)
{
Index: tests/canvas/browsing/diagonal2d.cc
--- tests/canvas/browsing/diagonal2d.cc (revision 3942)
+++ tests/canvas/browsing/diagonal2d.cc (working copy)
@@ -73,7 +73,7 @@
template <typename I, typename F, typename B>
void my_test(Image<I>& ima_,
- const Function_p2v<F>& f_,
+ const Function_v2v<F>& f_,
const Browsing<B>& browse_)
{
I& ima = exact(ima_);
Index: tests/canvas/browsing/backdiagonal2d.cc
--- tests/canvas/browsing/backdiagonal2d.cc (revision 3942)
+++ tests/canvas/browsing/backdiagonal2d.cc (working copy)
@@ -72,7 +72,7 @@
template <typename I, typename F, typename B>
void my_test(Image<I>& ima_,
- const Function_p2v<F>& f_,
+ const Function_v2v<F>& f_,
const Browsing<B>& browse_)
{
I& ima = exact(ima_);
Index: doc/examples/trash/graph.cc
--- doc/examples/trash/graph.cc (revision 3942)
+++ doc/examples/trash/graph.cc (working copy)
@@ -36,7 +36,7 @@
template <typename P>
-struct lg_vertex_values : public mln::Function_p2v< lg_vertex_values<P> >
+struct lg_vertex_values : public mln::Function_v2v< lg_vertex_values<P> >
{
typedef float result;
Index: doc/examples/graph-data.cc
--- doc/examples/graph-data.cc (revision 3942)
+++ doc/examples/graph-data.cc (working copy)
@@ -12,7 +12,7 @@
// \{
template <typename S>
-struct viota_t : public mln::Function_p2v< viota_t<S> >
+struct viota_t : public mln::Function_v2v< viota_t<S> >
{
typedef unsigned result;
Index: doc/examples/mln_var.cc
--- doc/examples/mln_var.cc (revision 3942)
+++ doc/examples/mln_var.cc (working copy)
@@ -4,7 +4,7 @@
#include <mln/pw/all.hh>
#include <mln/core/var.hh>
-struct my_values_t : mln::Function_p2v<my_values_t>
+struct my_values_t : mln::Function_v2v<my_values_t>
{
typedef int result;
Index: doc/examples/graph-iter.cc
--- doc/examples/graph-iter.cc (revision 3942)
+++ doc/examples/graph-iter.cc (working copy)
@@ -5,7 +5,7 @@
#include <doc/tools/sample_utils.hh>
-struct viota_t : public mln::Function_p2v< viota_t >
+struct viota_t : public mln::Function_v2v< viota_t >
{
typedef unsigned result;
Index: doc/examples/extend.cc
--- doc/examples/extend.cc (revision 3942)
+++ doc/examples/extend.cc (working copy)
@@ -39,7 +39,7 @@
namespace mln
{
- struct my_ext : public Function_p2v<my_ext>
+ struct my_ext : public Function_v2v<my_ext>
{
typedef value::rgb8 result;
1
0