---
milena/ChangeLog | 5 ++
milena/mln/transform/internal/distance_functor.hh | 55 ++++++++++++++++++--
2 files changed, 54 insertions(+), 6 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index fcbfd26..2689703 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,10 @@
2009-07-06 Guillaume Lazzara <guillaume.lazzara(a)lrde.epita.fr>
+ * mln/transform/internal/distance_functor.hh: Split declaration and
+ implementation.
+
+2009-07-06 Guillaume Lazzara <guillaume.lazzara(a)lrde.epita.fr>
+
Fix few tests.
* tests/core/other/var.cc: Does nothing if compiled with gcc 3.x.
diff --git a/milena/mln/transform/internal/distance_functor.hh
b/milena/mln/transform/internal/distance_functor.hh
index afa0790..ffe1044 100644
--- a/milena/mln/transform/internal/distance_functor.hh
+++ b/milena/mln/transform/internal/distance_functor.hh
@@ -58,16 +58,19 @@ namespace mln
void process(const P&, const P&);
- void init_(const I&) {}
- bool inqueue_p_wrt_input_p_(const V& input_p) { return input_p == true; }
- void init_p_(unsigned) {}
- bool inqueue_p_wrt_input_n_(const V& input_n) { return input_n == false; }
- void process_(unsigned, unsigned) {}
+ void init_(const I&);
+ bool inqueue_p_wrt_input_p_(const V& input_p);
+ void init_p_(unsigned);
+ bool inqueue_p_wrt_input_n_(const V& input_n);
+ void process_(unsigned, unsigned);
};
# ifndef MLN_INCLUDE_ONLY
+
+ // Generic implementation.
+
template <typename I>
inline
void
@@ -86,7 +89,7 @@ namespace mln
template <typename I>
inline
void
- distance_functor<I>::init_p(const P&)
+ distance_functor<I>::init_p(const mln_site(I)&)
{
}
@@ -104,6 +107,46 @@ namespace mln
{
}
+
+
+ // Fastest implementation.
+
+ template <typename I>
+ inline
+ void
+ distance_functor<I>::init_(const I&)
+ {
+ }
+
+ template <typename I>
+ inline
+ bool
+ distance_functor<I>::inqueue_p_wrt_input_p_(const V& input_p)
+ {
+ return input_p == true;
+ }
+
+ template <typename I>
+ inline
+ void
+ distance_functor<I>::init_p_(unsigned)
+ {
+ }
+
+ template <typename I>
+ inline
+ bool
+ distance_functor<I>::inqueue_p_wrt_input_n_(const V& input_n)
+ {
+ return input_n == false;
+ }
+
+ template <typename I>
+ inline
+ void distance_functor<I>::process_(unsigned, unsigned)
+ {
+ }
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::transform::internal
--
1.5.6.5
Show replies by date