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
June 2009
- 9 participants
- 356 discussions
URL: https://svn.lrde.epita.fr/svn/oln/trunk
ChangeLog:
2009-06-03 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Add script shell for tests/ hierarchy checking.
* build-aux/check_test_hierarchy.sh: New test for checking tests/
hierarchy.
* milena/mln/labeling/compute.hh: Remove warning of unused variable.
---
build-aux/check_test_hierarchy.sh | 57 ++++++++++++++++++++++++++++++++++++++
milena/mln/labeling/compute.hh | 1
2 files changed, 58 insertions(+)
Index: trunk/build-aux/check_test_hierarchy.sh
===================================================================
--- trunk/build-aux/check_test_hierarchy.sh (revision 0)
+++ trunk/build-aux/check_test_hierarchy.sh (revision 3954)
@@ -0,0 +1,57 @@
+#! /bin/sh
+
+failed_tests=0
+all_tests=0
+
+check_directory ()
+{
+ echo "Current directories: $1 $2"
+ for file in `ls $1`; do
+
+ source_file=${file%.cc}.hh
+ if [ -f ${1}/$file ]; then
+ all_tests=$(($all_tests + 1))
+ if [ -f ${2}/$source_file ]; then
+ echo "\t\e[0;32mOK\e[m $file <-> $source_file"
+ else
+# FIXME: Manage exceptions.
+ if [ "$file" != "Makefile.am" ]; then
+ echo "\t\e[0;31mFAIL\e[m $source_file source does not exist."
+ failed_tests=$(($failed_tests + 1))
+ fi
+ fi
+ fi
+
+ if [ -d ${1}/$file ]; then
+ if [ -d ${2}/$file ]; then
+ echo ""
+ check_directory ${1}/$file ${2}/$file
+ else
+# FIXME: Manage exceptions.
+ echo "\e[0;31mFAIL\e[m ${1}/$file source directory does not exist."
+ fi
+ fi
+
+ done
+}
+
+if [ $# -ne 2 ]; then
+ echo "Usage: ./check_test_hierarchy tests/ mln/"
+ exit 1
+fi
+
+echo "Test directory: $1"
+echo "Source directory: $2"
+echo "---"
+
+if [ -d ${1} ]; then
+ if [ -d ${2} ]; then
+ check_directory ${1} ${2}
+ else
+ echo "\e[0;31mFAIL\e[m ${1} source directory does not exist."
+ fi
+fi
+
+echo "\n====="
+echo "Uncorrect tests: $failed_tests"
+
Property changes on: trunk/build-aux/check_test_hierarchy.sh
___________________________________________________________________
Name: svn:executable
+ *
Index: trunk/milena/mln/labeling/compute.hh
===================================================================
--- trunk/milena/mln/labeling/compute.hh (revision 3953)
+++ trunk/milena/mln/labeling/compute.hh (revision 3954)
@@ -258,6 +258,7 @@
//const A& a = exact(a_);
const I& input = exact(input_);
const L& label = exact(label_);
+ (void) nlabels;
// FIXME: Check accus size with nlabels.
//util::array<A> accus(static_cast<unsigned>(nlabels) + 1, a);
1
0
* 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