* mln/convert/from_to.hxx,
* mln/core/routine/init.hxx: remove forward declarations related to
l2l::relabel.
* mln/fun/i2v/array.hh: do not inherit from array_base anymore.
* mln/fun/l2l/all.hh: do not include relabel.hh anymore.
* mln/labeling/relabel.hh,
* mln/make/relabelfun.hh: use i2v::array instead.
* mln/value/lut_vec.hh: remove a constructor overload for
l2l::relabel.
* mln/fun/internal/array_base.hh,
* mln/fun/l2l/relabel.hh: not used anymore. Removed.
---
milena/ChangeLog | 21 +++
milena/mln/convert/from_to.hxx | 27 +---
milena/mln/core/routine/init.hxx | 9 -
milena/mln/fun/i2v/array.hh | 155 +++++++++++++++----
milena/mln/fun/internal/array_base.hh | 246 ------------------------------
milena/mln/fun/l2l/all.hh | 1 -
milena/mln/fun/l2l/relabel.hh | 269 ---------------------------------
milena/mln/labeling/relabel.hh | 4 +-
milena/mln/make/relabelfun.hh | 14 +-
milena/mln/value/lut_vec.hh | 19 ---
10 files changed, 156 insertions(+), 609 deletions(-)
delete mode 100644 milena/mln/fun/internal/array_base.hh
delete mode 100644 milena/mln/fun/l2l/relabel.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index a52c977..99e16b5 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,26 @@
2009-04-09 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Remove l2l::relabel.
+
+ * mln/convert/from_to.hxx,
+ * mln/core/routine/init.hxx: remove forward declarations related to
+ l2l::relabel.
+
+ * mln/fun/i2v/array.hh: do not inherit from array_base anymore.
+
+ * mln/fun/l2l/all.hh: do not include relabel.hh anymore.
+
+ * mln/labeling/relabel.hh,
+ * mln/make/relabelfun.hh: use i2v::array instead.
+
+ * mln/value/lut_vec.hh: remove a constructor overload for
+ l2l::relabel.
+
+ * mln/fun/internal/array_base.hh,
+ * mln/fun/l2l/relabel.hh: not used anymore. Removed.
+
+2009-04-09 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
Add labeling::pack.
* mln/labeling/all.hh: include new header.
diff --git a/milena/mln/convert/from_to.hxx b/milena/mln/convert/from_to.hxx
index 38cb062..ded3998 100644
--- a/milena/mln/convert/from_to.hxx
+++ b/milena/mln/convert/from_to.hxx
@@ -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
@@ -76,10 +77,6 @@ namespace mln
namespace i2v {
template <typename T> class array;
}
-
- namespace l2l {
- template <typename T> class relabel;
- }
}
namespace histo {
@@ -373,26 +370,6 @@ namespace mln
- // util::array<T> -> fun::l2l::relabel<T>
- template <typename T>
- void
- from_to_(const util::array<T>& from, fun::l2l::relabel<T>&
to);
-
- // util::array<T> -> fun::l2l::relabel<U>
- template <typename T, typename U>
- void
- from_to_(const util::array<T>& from, fun::l2l::relabel<U>&
to);
-
- // std::vector<T> -> fun::l2l::relabel<T>
- template <typename T>
- void
- from_to_(const std::vector<T>& from, fun::l2l::relabel<T>&
to);
-
- // std::vector<T> -> fun::l2l::relabel<U>
- template <typename T, typename U>
- void
- from_to_(const std::vector<T>& from, fun::l2l::relabel<U>&
to);
-
// util::array<T1> -> util::array<T2>
template <typename T1, typename T2>
void
diff --git a/milena/mln/core/routine/init.hxx b/milena/mln/core/routine/init.hxx
index 46b4045..baaa9cd 100644
--- a/milena/mln/core/routine/init.hxx
+++ b/milena/mln/core/routine/init.hxx
@@ -39,7 +39,6 @@ namespace mln
// Forward declarations.
namespace fun { namespace i2v { template <typename T> class array; } }
- namespace fun { namespace l2l { template <typename T> class relabel; } }
namespace pw { namespace internal { template <typename F, typename S, typename E>
class image_base; } }
namespace pw { template <typename F, typename S> class image; }
template <typename I, typename F> class image_if;
@@ -85,14 +84,6 @@ namespace mln
fun::i2v::array<T1>& f,
const fun::i2v::array<T2>& model);
- /// Kind: function_t
- /// Type: fun::l2l::relabel<T1>
- /// From: fun::l2l::relabel<T2>
- template <typename T1, typename T2>
- void init_(tag::function_t,
- fun::l2l::relabel<T1>& f,
- const fun::l2l::relabel<T2>& model);
-
} // end of namespace mln
#endif // ! MLN_CORE_ROUTINE_INIT_HXX
diff --git a/milena/mln/fun/i2v/array.hh b/milena/mln/fun/i2v/array.hh
index 91fe792..4058e48 100644
--- a/milena/mln/fun/i2v/array.hh
+++ b/milena/mln/fun/i2v/array.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -31,35 +32,23 @@
/// \file mln/fun/i2v/array.hh
///
/// Function mapping an Id i to a value v.
-///
-/// \todo Change design so that there is no multiple inheritance:
-/// array<T> : internal::array_base<T, E==array<T> > :
Function_i2v<E>
-///
-/// \todo We should convert (with from_to) arrays that do not hold the
-/// same element type, e.g., int_u8 -> int or vec<3,f> -> rgb8.
# include <vector>
# include <algorithm>
# include <mln/core/concept/function.hh>
-# include <mln/fun/internal/array_base.hh>
# include <mln/util/array.hh>
# include <mln/metal/equal.hh>
+# include <mln/tag/init.hh>
+
namespace mln
{
/// Forward declaration.
- namespace fun
- {
-
- namespace i2v
- {
-
- template <typename T>
- class array;
-
+ namespace fun {
+ namespace i2v {
+ template <typename T> class array;
} // end of namespace mln::fun::i2v
-
} // end of namespace mln::fun
@@ -122,16 +111,14 @@ namespace mln
template <typename T>
- class array : public internal::array_selector_<T,mlc_equal(T,bool)::value>,
- public fun::internal::array_base<T>
+ class array : public internal::array_selector_<T,mlc_equal(T,bool)::value>
{
- typedef fun::internal::array_base<T> super_base_;
-
public:
- /// Mutable result type. The function results can be modified.
- typedef typename super_base_::mutable_result mutable_result;
- typedef typename fun::internal::array_base<T>::result result;
+ /// Returned value types
+ /// \{
+ typedef T result;
+ typedef typename std::vector<T>::reference mutable_result;
/// Constructors
/// \{
@@ -151,6 +138,36 @@ namespace mln
array(const std::vector<T>& from);
/// \}
+
+ /// Pre-allocate space.
+ void reserve(unsigned n);
+
+ /// Set the function size to \p n.
+ void resize(unsigned n);
+ /// Set the function size to \p n and initialize the value with
+ /// \p val.
+ void resize(unsigned n, const T& val);
+
+ /// Append a new value in the function.
+ void append(const T& val);
+
+ /// Return the number of values.
+ unsigned size() const;
+
+ /// Const access to the ith value.
+ result operator()(unsigned i) const;
+ /// Read-Write access to the ith value.
+ mutable_result operator()(unsigned i);
+
+ /// Initialize an empty function.
+ void init_(unsigned n);
+
+ /// Return the underlying std::vector.
+ const std::vector<T>& std_vector() const;
+
+ protected:
+ std::vector<T> v_;
+
};
} // end of namespace mln::fun::i2v
@@ -244,21 +261,21 @@ namespace mln
template <typename T>
inline
array<T>::array(unsigned n)
- : super_base_(n)
+ : v_(n)
{
}
template <typename T>
inline
array<T>::array(unsigned n, const T& val)
- : super_base_(n, val)
+ : v_(n, val)
{
}
template <typename T>
inline
array<T>::array(const util::array<T>& from)
- : super_base_(from)
+ : v_(from.std_vector())
{
}
@@ -266,20 +283,96 @@ namespace mln
template <typename T>
inline
array<T>::array(const std::vector<T>& from)
- : super_base_(from)
+ : v_(from)
{
}
+ template <typename T>
+ inline
+ void
+ array<T>::reserve(unsigned n)
+ {
+ v_.reserve(n);
+ }
+
+ template <typename T>
+ inline
+ void
+ array<T>::resize(unsigned n)
+ {
+ v_.resize(n);
+ }
+
+ template <typename T>
+ inline
+ void
+ array<T>::append(const T& val)
+ {
+ v_.push_back(val);
+ }
+
+ template <typename T>
+ inline
+ void
+ array<T>::resize(unsigned n, const T& val)
+ {
+ v_.resize(n, val);
+ }
+
+ template <typename T>
+ inline
+ unsigned
+ array<T>::size() const
+ {
+ return v_.size();
+ }
+
+ template <typename T>
+ inline
+ typename array<T>::result
+ array<T>::operator()(unsigned i) const
+ {
+ mln_precondition(i < v_.size());
+ return v_[i];
+ }
+
+ template <typename T>
+ inline
+ typename array<T>::mutable_result
+ array<T>::operator()(unsigned i)
+ {
+ mln_precondition(i < v_.size());
+ return v_[i];
+ }
+
+ template <typename T>
+ inline
+ void
+ array<T>::init_(unsigned n)
+ {
+ v_.resize(n);
+ }
+
+ template <typename T>
+ inline
+ const std::vector<T>&
+ array<T>::std_vector() const
+ {
+ return v_;
+ }
+
+
} // end of namespace mln::fun::i2v
} // end of namespace mln::fun
+
template <typename T>
inline
- fun::i2v::array<T> array(T t)
+ fun::i2v::array<T> array(unsigned n, const T& t)
{
- fun::i2v::array<T> tmp(t);
+ fun::i2v::array<T> tmp(n, t);
return tmp;
}
diff --git a/milena/mln/fun/internal/array_base.hh
b/milena/mln/fun/internal/array_base.hh
deleted file mode 100644
index 577b36f..0000000
--- a/milena/mln/fun/internal/array_base.hh
+++ /dev/null
@@ -1,246 +0,0 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of the Olena Library. This library is free
-// software; you can redistribute it and/or modify it under the terms
-// of the GNU General Public License version 2 as published by the
-// Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR 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_FUN_INTERNAL_ARRAY_BASE_HH
-# define MLN_FUN_INTERNAL_ARRAY_BASE_HH
-
-/// \file mln/fun/internal/array_base.hh
-///
-/// Function mapping an Id i to a value v.
-
-# include <vector>
-# include <algorithm>
-# include <mln/util/array.hh>
-# include <mln/tag/init.hh>
-
-
-namespace mln
-{
-
- namespace fun
- {
-
- namespace internal
- {
-
- template <typename T>
- class array_base
- {
- public:
-
- /// Returned value types
- /// \{
- typedef T result;
- typedef typename std::vector<T>::reference mutable_result;
-
- /// Pre-allocate space.
- void reserve(unsigned n);
-
- /// Set the function size to \p n.
- void resize(unsigned n);
- /// Set the function size to \p n and initialize the value with
- /// \p val.
- void resize(unsigned n, const T& val);
-
- /// Append a new value in the function.
- void append(const T& val);
-
- /// Return the number of values.
- unsigned size() const;
-
- /// Const access to the ith value.
- result operator()(unsigned i) const;
- /// Read-Write access to the ith value.
- mutable_result operator()(unsigned i);
-
- /// Initialize an empty function.
- void init_(unsigned n);
-
- /// Return the underlying std::vector.
- const std::vector<T>& std_vector() const;
-
- protected:
- std::vector<T> v_;
-
- /// Constructors
- /// \{
-
- /// Default.
- array_base();
- /// Constructs an array with \p nvalues.
- array_base(unsigned n);
-
- /// Constructs an array with \p nvalues and \p val as value.
- array_base(unsigned n, const T& val);
-
- /// Used in from_to(). Constructs that object from an util::array.
- /// Always prefer using from_to instead of this constructor.
- array_base(const util::array<T>& from);
- /// Used in from_to(). Constructs that object from an std::vector.
- /// Always prefer using from_to instead of this constructor.
- array_base(const std::vector<T>& from);
-
- /// \}
-
- };
-
- } // end of namespace mln::fun::internal
-
- } // end of namespace mln::fun
-
-
-# ifndef MLN_INCLUDE_ONLY
-
- /// fun::internal::array_base
-
- namespace fun
- {
-
- namespace internal
- {
-
- template <typename T>
- inline
- array_base<T>::array_base()
- {
- }
-
- template <typename T>
- inline
- array_base<T>::array_base(unsigned n)
- : v_(n)
- {
- }
-
- template <typename T>
- inline
- array_base<T>::array_base(unsigned n, const T& val)
- : v_(n, val)
- {
- }
-
- template <typename T>
- inline
- array_base<T>::array_base(const util::array<T>& from)
- : v_(from.std_vector())
- {
-
- }
-
- template <typename T>
- inline
- array_base<T>::array_base(const std::vector<T>& from)
- : v_(from)
- {
-
- }
-
- template <typename T>
- inline
- void
- array_base<T>::reserve(unsigned n)
- {
- v_.reserve(n);
- }
-
- template <typename T>
- inline
- void
- array_base<T>::resize(unsigned n)
- {
- v_.resize(n);
- }
-
- template <typename T>
- inline
- void
- array_base<T>::append(const T& val)
- {
- v_.push_back(val);
- }
-
- template <typename T>
- inline
- void
- array_base<T>::resize(unsigned n, const T& val)
- {
- v_.resize(n, val);
- }
-
- template <typename T>
- inline
- unsigned
- array_base<T>::size() const
- {
- return v_.size();
- }
-
- template <typename T>
- inline
- typename array_base<T>::result
- array_base<T>::operator()(unsigned i) const
- {
- mln_precondition(i < v_.size());
- return v_[i];
- }
-
- template <typename T>
- inline
- typename array_base<T>::mutable_result
- array_base<T>::operator()(unsigned i)
- {
- mln_precondition(i < v_.size());
- return v_[i];
- }
-
- template <typename T>
- inline
- void
- array_base<T>::init_(unsigned n)
- {
- v_.resize(n);
- }
-
- template <typename T>
- inline
- const std::vector<T>&
- array_base<T>::std_vector() const
- {
- return v_;
- }
-
- } // end of namespace mln::fun::internal
-
- } // end of namespace mln::fun
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
-} // end of namespace mln
-
-
-#endif // ! MLN_FUN_INTERNAL_ARRAY_BASE_HH
diff --git a/milena/mln/fun/l2l/all.hh b/milena/mln/fun/l2l/all.hh
index a3eccee..c6d2328 100644
--- a/milena/mln/fun/l2l/all.hh
+++ b/milena/mln/fun/l2l/all.hh
@@ -49,7 +49,6 @@ namespace mln
}
-# include <mln/fun/l2l/relabel.hh>
# include <mln/fun/l2l/wrap.hh>
diff --git a/milena/mln/fun/l2l/relabel.hh b/milena/mln/fun/l2l/relabel.hh
deleted file mode 100644
index ef03973..0000000
--- a/milena/mln/fun/l2l/relabel.hh
+++ /dev/null
@@ -1,269 +0,0 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of the Olena Library. This library is free
-// software; you can redistribute it and/or modify it under the terms
-// of the GNU General Public License version 2 as published by the
-// Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR 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_FUN_L2L_RELABEL_HH
-# define MLN_FUN_L2L_RELABEL_HH
-
-/// \file mln/fun/l2l/relabel.hh
-///
-/// Function mapping a label to a new one.
-/// \sa mln::labeling::relabel
-
-# include <vector>
-# include <algorithm>
-# include <mln/core/concept/function.hh>
-# include <mln/fun/internal/array_base.hh>
-# include <mln/util/array.hh>
-# include <mln/metal/converts_to.hh>
-
-
-namespace mln
-{
-
- /// Forward declaration.
- namespace fun
- {
-
- namespace l2l
- {
-
- template <typename L>
- class relabel;
-
- } // end of namespace mln::fun::l2l
-
- } // end of namespace mln::fun
-
-
-
- namespace convert
- {
-
- namespace over_load
- {
-
- template <typename L>
- inline
- void
- from_to_(const util::array<L>& from,
- fun::l2l::relabel<L>& to);
-
- template <typename T, typename L>
- inline
- void
- from_to_(const util::array<T>& from,
- fun::l2l::relabel<L>& to);
-
- template <typename L>
- inline
- void
- from_to_(const std::vector<L>& from,
- fun::l2l::relabel<L>& to);
-
- template <typename T, typename L>
- inline
- void
- from_to_(const std::vector<T>& from,
- fun::l2l::relabel<L>& to);
-
- } // end of namespace mln::convert::over_load
-
- } // end of namespace mln::convert
-
-
- namespace fun
- {
-
- namespace l2l
- {
-
- template <typename L>
- class relabel : public Function_l2l< relabel<L> >,
- public internal::array_base<L>
- {
- typedef internal::array_base<L> super_base_;
-
- public:
-
- /// Mutable result type. The function results can be modified.
- typedef typename super_base_::mutable_result mutable_result;
-
- /// Constructors
- /// \{
-
- /// Default.
- relabel();
- /// Constructs a function with \p nvalues.
- relabel(unsigned n);
- /// Constructs a function with \p nvalues and \p label as default label.
- relabel(unsigned n, const L& label);
-
- /// Used in from_to(). Constructs that function from an util::array.
- /// Always prefer using from_to instead of this constructor.
- relabel(const util::array<L>& from);
- /// Used in from_to(). Constructs that function from an std::vector.
- /// Always prefer using from_to instead of this constructor.
- relabel(const std::vector<L>& from);
- /// \}
-
- };
-
- } // end of namespace mln::fun::l2l
-
- } // end of namespace mln::fun
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
- // Init.
-
- template <typename T1, typename T2>
- void init_(tag::function_t,
- fun::l2l::relabel<T1>& f,
- const fun::l2l::relabel<T2>& model)
- {
- f.init_(model.size());
- }
-
-
- // convert::from_to
-
- namespace convert
- {
-
- namespace over_load
- {
-
- template <typename L>
- inline
- void
- from_to_(const util::array<L>& from, fun::l2l::relabel<L>& to)
- {
- to = fun::l2l::relabel<L>(from);
- }
-
- template <typename T, typename L>
- inline
- void
- from_to_(const util::array<T>& from, fun::l2l::relabel<L>& to)
- {
- mlc_converts_to(T,L)::check();
-
- to.reserve(from.nelements());
- for (unsigned i = 0; i < from.nelements(); ++i)
- to.append(convert::to<L>(from[i]));
- }
-
- template <typename L>
- inline
- void
- from_to_(const std::vector<L>& from, fun::l2l::relabel<L>& to)
- {
- to = fun::l2l::relabel<L>(from);
- }
-
- template <typename T, typename L>
- inline
- void
- from_to_(const std::vector<T>& from, fun::l2l::relabel<L>& to)
- {
- mlc_converts_to(T,L)::check();
-
- to.reserve(from.size());
- for (unsigned i = 0; i < from.size(); ++i)
- to.append(convert::to<L>(from[i]));
- }
-
- } // end of namespace mln::convert::over_load
-
- } // end of namespace mln::convert
-
-
-
- /// fun::l2l::relabel
-
- namespace fun
- {
-
- namespace l2l
- {
-
- template <typename L>
- inline
- relabel<L>::relabel()
- {
- // FIXME: Too restrictive?
- mlc_converts_to(L, unsigned)::check();
- }
-
- template <typename L>
- inline
- relabel<L>::relabel(unsigned n)
- : super_base_(n)
- {
- // FIXME: Too restrictive?
- mlc_converts_to(L, unsigned)::check();
- }
-
- template <typename L>
- inline
- relabel<L>::relabel(unsigned n, const L& label)
- : super_base_(n, label)
- {
- // FIXME: Too restrictive?
- mlc_converts_to(L, unsigned)::check();
- }
-
- template <typename L>
- inline
- relabel<L>::relabel(const util::array<L>& from)
- : super_base_(from)
- {
- // FIXME: Too restrictive?
- mlc_converts_to(L, unsigned)::check();
- }
-
- template <typename L>
- inline
- relabel<L>::relabel(const std::vector<L>& from)
- : super_base_(from)
- {
- // FIXME: Too restrictive?
- mlc_converts_to(L, unsigned)::check();
- }
-
- } // end of namespace mln::fun::l2l
-
- } // end of namespace mln::fun
-
-# endif // ! MLN_INCLUDE_ONLY
-
-} // end of namespace mln
-
-
-#endif // ! MLN_FUN_L2L_RELABEL_HH
diff --git a/milena/mln/labeling/relabel.hh b/milena/mln/labeling/relabel.hh
index e811db1..a775bfa 100644
--- a/milena/mln/labeling/relabel.hh
+++ b/milena/mln/labeling/relabel.hh
@@ -208,7 +208,7 @@ namespace mln
internal::relabel_tests(label, nlabels, new_nlabels, fv2b);
- typedef fun::l2l::relabel<mln_value(I)> fv2v_t;
+ typedef fun::i2v::array<mln_value(I)> fv2v_t;
fv2v_t fv2v = make::relabelfun(fv2b, nlabels, new_nlabels);
mln_concrete(I) output = labeling::relabel(label, new_nlabels, fv2v);
@@ -246,7 +246,7 @@ namespace mln
internal::relabel_inplace_tests(label, nlabels, fv2b);
- typedef fun::l2l::relabel<mln_value(I)> fv2v_t;
+ typedef fun::i2v::array<mln_value(I)> fv2v_t;
fv2v_t fv2v = make::relabelfun(fv2b, nlabels, nlabels);
labeling::relabel_inplace(label, nlabels, fv2v);
diff --git a/milena/mln/make/relabelfun.hh b/milena/mln/make/relabelfun.hh
index 612e3a6..0e0ff3e 100644
--- a/milena/mln/make/relabelfun.hh
+++ b/milena/mln/make/relabelfun.hh
@@ -33,7 +33,7 @@
/// Routines to construct a function in order to relabel a labeled image.
# include <mln/core/concept/function.hh>
-# include <mln/fun/l2l/relabel.hh>
+# include <mln/fun/i2v/array.hh>
# include <mln/value/label.hh>
namespace mln
@@ -51,7 +51,7 @@ namespace mln
///
/// \sa mln::labeling::relabel
template <unsigned n, typename F>
- fun::l2l::relabel< value::label<n> >
+ fun::i2v::array< value::label<n> >
relabelfun(const Function_v2b<F>& fv2b,
const value::label<n>& nlabels,
value::label<n>& new_nlabels);
@@ -65,7 +65,7 @@ namespace mln
///
/// \sa mln::labeling::relabel
template <unsigned n, typename F>
- fun::l2l::relabel< value::label<n> >
+ fun::i2v::array< value::label<n> >
relabelfun(const Function_v2v<F>& fv2v,
const value::label<n>& nlabels,
value::label<n>& new_nlabels);
@@ -75,7 +75,7 @@ namespace mln
template <unsigned n, typename F>
inline
- fun::l2l::relabel< value::label<n> >
+ fun::i2v::array< value::label<n> >
relabelfun(const Function_v2b<F>& fv2b_,
const value::label<n>& nlabels,
value::label<n>& new_nlabels)
@@ -86,7 +86,7 @@ namespace mln
value::label<n> tmp_nlabels = literal::zero;
typedef value::label<n> label_t;
- fun::l2l::relabel<label_t> fl2l(nlabels.next(), literal::zero);
+ fun::i2v::array<label_t> fl2l(nlabels.next(), literal::zero);
for (label_t i = 1; i <= nlabels; ++i)
if (fv2b(i))
{
@@ -100,7 +100,7 @@ namespace mln
template <unsigned n, typename F>
inline
- fun::l2l::relabel< value::label<n> >
+ fun::i2v::array< value::label<n> >
relabelfun(const Function_v2v<F>& fv2v_,
const value::label<n>& nlabels,
value::label<n>& new_nlabels)
@@ -111,7 +111,7 @@ namespace mln
value::label<n> tmp_nlabels = literal::zero;
typedef value::label<n> label_t;
- fun::l2l::relabel<label_t> fl2l(nlabels.next(), literal::zero);
+ fun::i2v::array<label_t> fl2l(nlabels.next(), literal::zero);
for (label_t i = 1; i < nlabels.next(); ++i)
if (fl2l(fv2v(i)) == literal::zero)
{
diff --git a/milena/mln/value/lut_vec.hh b/milena/mln/value/lut_vec.hh
index 6aa2e32..8c817a2 100644
--- a/milena/mln/value/lut_vec.hh
+++ b/milena/mln/value/lut_vec.hh
@@ -50,9 +50,6 @@ namespace mln
namespace i2v {
template <typename T> class array;
} // end of namespace mln::fun::i2v
- namespace l2l {
- template <typename L> class relabel;
- } // end of namespace mln::fun::l2l
} // end of namespace mln::fun
namespace value
@@ -104,10 +101,6 @@ namespace mln
template <typename V>
lut_vec(const S& vset, const Function_v2v< fun::i2v::array<V>
>& f);
- /// Ctor. FIXME!
- template <typename V>
- lut_vec(const S& vset, const Function_v2v< fun::l2l::relabel<V>
>& f);
-
protected:
const S& vset_;
@@ -166,17 +159,6 @@ namespace mln
}
template <typename S, typename T>
- template <typename V>
- inline
- lut_vec<S,T>::lut_vec(const S& vset, const Function_v2v<
fun::l2l::relabel<V> >& f)
- : vset_(vset)
- {
- const fun::l2l::relabel<V>& f_ = exact(f);
- n_ = f_.size();
- vec_ = f_.std_vector();
- }
-
- template <typename S, typename T>
inline
T
lut_vec<S,T>::operator()(const mln_value(S)& val) const
@@ -202,7 +184,6 @@ namespace mln
return vec_.size();
}
-
template <typename S, typename T>
inline
std::ostream&
--
1.5.6.5