Olena-patches
  Threads by month 
                
            - ----- 2025 -----
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2024 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2023 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2022 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2021 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2020 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2019 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2018 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2017 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2016 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2015 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2014 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2013 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2012 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2011 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2010 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2009 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2008 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2007 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2006 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2005 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 - February
 - January
 - ----- 2004 -----
 - December
 - November
 - October
 - September
 - August
 - July
 - June
 - May
 - April
 - March
 
- 9625 discussions
 
                        
                            
                                
                            
                            cleanup-2008 2406: Conversions from proxies keep	the possible reference.
                        
                        
by Thierry Geraud 25 Sep '08
                    by Thierry Geraud 25 Sep '08
25 Sep '08
                    
                        https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from  Thierry Geraud  <thierry.geraud(a)lrde.epita.fr>
	Conversions from proxies keep the possible reference.
	* mln/core/concept/proxy.hxx
	(get_proxy_impl::operator): New overload (mutable) conversion
	towards the immediate subject.
	Keep ref or ptr in conversion return type.
	* mln/core/concept/site_proxy.hh (operator site): De-activate
	the static check of its presence since "site" can be either a
	ref, a const ref, or a plain type.
	* mln/core/concept/accumulator.hh (result_): Update.
	* mln/core/dpoints_pixter.hh (get_adr): Replace by conversion.
	Add a static check about the p_ref argument type.
	* mln/core/internal/site_relative_iterator_base.hh: Likewise.
	* mln/metal/fix_return.hh: New.
 core/concept/accumulator.hh                  |    5 +-
 core/concept/proxy.hxx                       |   14 +++++
 core/concept/site_proxy.hh                   |    5 +-
 core/dpoints_pixter.hh                       |    6 ++
 core/internal/site_relative_iterator_base.hh |    6 +-
 metal/fix_return.hh                          |   64 +++++++++++++++++++++++++++
 6 files changed, 90 insertions(+), 10 deletions(-)
Index: mln/core/concept/proxy.hxx
--- mln/core/concept/proxy.hxx	(revision 2405)
+++ mln/core/concept/proxy.hxx	(working copy)
@@ -37,6 +37,7 @@
 # include <mln/metal/unconst.hh>
 # include <mln/metal/is_not_ref.hh>
 # include <mln/metal/ref.hh>
+# include <mln/metal/fix_return.hh>
 
 
 namespace mln
@@ -265,7 +266,9 @@
     struct get_proxy_impl : helper_get_proxy_impl< Subject, E,
 						   mlc_is_a(Subject, Proxy)::value >
     {
-      operator mlc_unqualif(Subject) () const;
+    public:
+      operator mlc_fix_return(Subject) ();
+      operator mlc_fix_return(mlc_const_return(Subject)) () const;
     };
 
     template <typename Subject, typename E>
@@ -378,7 +381,7 @@
 
     template <typename Subject, typename E>
     inline
-    get_proxy_impl<Subject, E>::operator mlc_unqualif(Subject) () const
+    get_proxy_impl<Subject, E>::operator mlc_fix_return(mlc_const_return(Subject)) () const
     {
       return mln::internal::force_exact<const E>(*this).unproxy_();
       
@@ -391,6 +394,13 @@
       // 	return *adr;
     }
 
+    template <typename Subject, typename E>
+    inline
+    get_proxy_impl<Subject, E>::operator mlc_fix_return(Subject) ()
+    {
+      return mln::internal::force_exact<E>(*this).unproxy_();
+    }
+
 
     // get_adr
 
Index: mln/core/concept/site_proxy.hh
--- mln/core/concept/site_proxy.hh	(revision 2405)
+++ mln/core/concept/site_proxy.hh	(working copy)
@@ -86,8 +86,9 @@
     const site& (E::*m1)() const = & E::to_site;
     m1 = 0;
 
-    site (E::*m2)() const = & E::operator site;
-    m2 = 0;
+    // De-activate because sometimes it returns a "const site&"...
+//     site (E::*m2)() const = & E::operator site;
+//     m2 = 0;
   }
 
 # endif // ! MLN_INCLUDE_ONLY
Index: mln/core/concept/accumulator.hh
--- mln/core/concept/accumulator.hh	(revision 2405)
+++ mln/core/concept/accumulator.hh	(working copy)
@@ -34,7 +34,8 @@
  */
 
 # include <mln/core/concept/proxy.hh>
-# include <mln/metal/unqualif.hh>
+# include <mln/metal/fix_return.hh>
+# include <mln/metal/const.hh>
 
 
 namespace mln
@@ -104,7 +105,7 @@
     result (E::*m4)() const = & E::to_result;
     m4 = 0;
 
-    typedef mlc_unqualif(result) result_;
+    typedef mlc_fix_return(mlc_const_return(result)) result_;
     result_ (E::*m5)() const = & E::operator result_;
     m5 = 0;
   }
Index: mln/core/dpoints_pixter.hh
--- mln/core/dpoints_pixter.hh	(revision 2405)
+++ mln/core/dpoints_pixter.hh	(working copy)
@@ -38,6 +38,7 @@
 
 # include <mln/core/concept/pixel_iterator.hh>
 # include <mln/core/internal/pixel_impl.hh>
+# include <mln/metal/converts_to.hh>
 
 
 namespace mln
@@ -225,7 +226,10 @@
     : super_(image)
   {
     mln_precondition(image.has_data());
-    internal::get_adr(p_ref_, p_ref);
+
+    mlc_converts_to(Pref, const mln_psite(I)&)::check();
+    p_ref_ = & static_cast< const mln_psite(I)& >(p_ref);
+
     value_ref_ = 0;
     init_(dps);
   }
Index: mln/core/internal/site_relative_iterator_base.hh
--- mln/core/internal/site_relative_iterator_base.hh	(revision 2405)
+++ mln/core/internal/site_relative_iterator_base.hh	(working copy)
@@ -41,6 +41,7 @@
 
 # include <vector>
 # include <mln/core/internal/site_iterator_base.hh>
+# include <mln/metal/converts_to.hh>
 
 
 namespace mln
@@ -138,9 +139,8 @@
     void
     site_relative_iterator_base<S,E>::center_at(const P& c)
     {
-      internal::get_adr(c_, c);
-      mln_precondition(c_ != 0);
-      // c_ == 0 means that the center c does not have the expected type.
+      mlc_converts_to(P, const mln_psite(S)&)::check();
+      c_ = & static_cast< const mln_psite(S)& >(c);
       this->invalidate();
     }
 
Index: mln/metal/fix_return.hh
--- mln/metal/fix_return.hh	(revision 0)
+++ mln/metal/fix_return.hh	(revision 0)
@@ -0,0 +1,64 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library.  This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction.  Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License.  This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_METAL_FIX_RETURN_HH
+# define MLN_METAL_FIX_RETURN_HH
+
+/*!
+ * \file  mln/metal/fix_return.hh
+ *
+ * \brief FIXME.
+ */
+
+
+# define mlc_fix_return(T) typename mln::metal::fix_return< T >::ret
+
+
+namespace mln
+{
+
+  namespace metal
+  {
+
+    // No-op.
+    template <typename T> struct fix_return             { typedef       T  ret; };
+    template <typename T> struct fix_return<       T& > { typedef       T& ret; };
+    template <typename T> struct fix_return< const T& > { typedef const T& ret; };
+    template <typename T> struct fix_return<       T* > { typedef       T* ret; };
+    template <typename T> struct fix_return< const T* > { typedef const T* ret; };
+
+    // Remove const.
+    template <typename T> struct fix_return< const T >        { typedef       T  ret; };
+    template <typename T> struct fix_return<       T* const > { typedef       T* ret; };
+    template <typename T> struct fix_return< const T* const > { typedef const T* ret; };
+
+  } // end of namespace mln::metal
+
+} // end of namespace mln
+
+
+#endif // ! MLN_METAL_FIX_RETURN_HH
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    25 Sep '08
                    
                        https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from  Ugo Jardonnet  <ugo.jardonnet(a)lrde.epita.fr>
	Update interpolated and tr_image morphers.
	* mln/core/image/tr_image.hh: Update (traits ...) .
	* mln/core/image/interpolated.hh (operator()): Add non const version.
 interpolated.hh |   14 ++++--
 tr_image.hh     |  117 ++++++++++++++++++++++++++++++++++----------------------
 2 files changed, 81 insertions(+), 50 deletions(-)
Index: mln/core/image/tr_image.hh
--- mln/core/image/tr_image.hh	(revision 2404)
+++ mln/core/image/tr_image.hh	(working copy)
@@ -46,35 +46,49 @@
 {
 
   // Fwd decl.
-  template <typename T, typename I> struct tr_image;
+  template <typename S, typename I, typename T> struct tr_image;
 
   namespace internal
   {
 
     /// Data structure for \c mln::tr_image<T,I>.
-    template <typename T, typename I>
-    struct data< tr_image<T,I> >
+    template <typename S, typename I, typename T>
+    struct data< tr_image<S,I,T> >
     {
-      data(I& ima, T& tr);
+      data(const S& s,I& ima, const T& tr);
 
       I ima_;
       T tr_;
+      S s_;
     };
 
   } // end of namespace mln::internal
 
+  namespace trait
+  {
+
+    template <typename S, typename I, typename T>
+    struct image_< tr_image<S,I,T> >
+      : public image_<I> // Same as I except...
+    {
+      // ...these changes.
+      typedef trait::image::value_io::read_only value_io;
+    };
+
+  } // end of namespace mln::trait
+
   /*! \brief Morpher that makes an image become transformed by a given
    *  transformation.
    *
    */
-  template <typename T, typename I>
+  template <typename S, typename I, typename T>
   struct tr_image :
-    public mln::internal::image_identity< I, mln_pset(I), tr_image<T,I> >
+    public mln::internal::image_identity< I, mln_pset(I), tr_image<S,I,T> >
   {
 
     /// Super type.
     typedef
-    mln::internal::image_identity< I, mln_pset(I), tr_image<T,I> > super_;
+    mln::internal::image_identity< I, mln_pset(I), tr_image<S,I,T> > super_;
 
     /// Point_Site associated type.
     typedef mln_psite(I) psite;
@@ -89,11 +103,11 @@
     typedef mln_rvalue(I) rvalue;
 
     /// Skeleton.
-    typedef tr_image< T, tag::image_<I> > skeleton;
+    typedef tr_image< S, tag::image_<I>, T> skeleton;
 
 
     /// Constructors.
-    tr_image(I& ima, T& tr);
+    tr_image(const S& s, I& ima, const T& tr);
     /* FIXME: What's the purpose of this ctor?  AFAIK, morphers
        objects (and images in general) cannot have their structure /
        core data altered after they're built.  Here, there's a
@@ -103,6 +117,8 @@
     tr_image();
 
 
+    void init_(const S& s, I& ima, const T& tr);
+
     /// Test if this image has been initialized.
     bool has_data() const;
 
@@ -110,18 +126,14 @@
     using super_::has;
 
     /// Test if a pixel value is accessible at \p v.
-    bool has(const mln::algebra::vec<I::point::dim, float>& v) const;
-
-    using super_::has;
-
-    /// Test if a pixel value is belonging to image at \p v.
-    bool has(const mln::algebra::vec<I::point::dim, float>& v) const;
+    bool has(const mln::algebra::vec<I::psite::dim, float>& v) const;
 
     /// Read-only access of pixel value at point site \p p.
     /// Mutable access is only OK for reading (not writing).
     using super_::operator();
 
-    mln_value(I) operator()(const mln::algebra::vec<I::point::dim, float>& v) const;
+    mln_value(I) operator()(const psite& p);
+    mln_value(I) operator()(const psite& p) const;
 
     void set_tr(T& tr);
   };
@@ -135,41 +147,50 @@
 
     // internal::data< tr_image<I,S> >
 
-    template <typename T, typename I>
+    template <typename S, typename I, typename T>
     inline
-    data< tr_image<T,I> >::data(I& ima, T& tr)
+    data< tr_image<S,I,T> >::data(const S& s, I& ima, const T& tr)
       : ima_(ima),
-	tr_(tr)
+	tr_(tr),
+        s_(s)
     {
     }
 
   } // end of namespace mln::internal
 
-  template <typename T, typename I>
+  template <typename S, typename I, typename T>
+  inline
+  tr_image<S,I,T>::tr_image(const S& s, I& ima, const T& tr)
+  {
+    mln_precondition(ima.has_data());
+    this->data_ = new internal::data< tr_image<S,I,T> >(s, ima, tr);
+  }
+
+  template <typename S, typename I, typename T>
   inline
-  tr_image<T,I>::tr_image(I& ima, T& tr)
+  void tr_image<S,I,T>::init_(const S& s, I& ima, const T& tr)
   {
     mln_precondition(ima.has_data());
-    this->data_ = new internal::data< tr_image<T,I> >(ima, tr);
+    this->data_ = new internal::data< tr_image<S,I,T> >(s, ima, tr);
   }
 
-  template <typename T, typename I>
+  template <typename S, typename I, typename T>
   inline
-  tr_image<T,I>::tr_image()
+  tr_image<S,I,T>::tr_image()
   {
   }
 
-  template <typename T, typename I>
+  template <typename S, typename I, typename T>
   inline
-  bool tr_image<T,I>::has_data() const
+  bool tr_image<S,I,T>::has_data() const
   {
     mln_invariant(this->delegatee_()->has_data());
     return true;
   }
 
-  template <typename T, typename I>
+  template <typename S, typename I, typename T>
   inline
-  bool tr_image<T,I>::has(const algebra::vec<I::point::dim, float>& v) const
+  bool tr_image<S,I,T>::has(const algebra::vec<I::psite::dim, float>& v) const
   {
     mln_psite(I) p;
     algebra::vec<I::point::dim, float> v2 = this->data_->tr_.inv()(v);
@@ -178,38 +199,44 @@
     return this->delegatee_().has(p);
   }
 
-  template <typename T, typename I>
+
+  template <typename S, typename I, typename T>
   inline
-  bool tr_image<T,I>::has(const algebra::vec<I::point::dim, float>& v) const
+  mln_value(I)
+  tr_image<S,I,T>::operator()(const psite& p) 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]));
-    return this->delegatee_()->domain().has(p);
+    std::cout << "yay" << std::endl;
+    algebra::vec<I::psite::dim, float> v = p;
+    return this->data_->ima_(this->data_->tr_.inv()(v));
   }
 
-  template <typename T, typename I>
+  template <typename S, typename I, typename T>
   inline
   mln_value(I)
-  tr_image<T,I>::operator()(const algebra::vec<I::point::dim, float>& v) const
+  tr_image<S,I,T>::operator()(const psite& p)
   {
-    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]));
-    mln_assertion(this->delegatee_()->has(p));
-    return (*this->delegatee_())(p);
+    std::cout << "yay" << std::endl;
+    algebra::vec<I::psite::dim, float> v = p;
+    return this->data_->ima_(this->data_->tr_.inv()(v));
   }
 
-  template <typename T, typename I>
+  template <typename S, typename I, typename T>
   inline
   void
-  tr_image<T,I>::set_tr(T& tr)
+  tr_image<S,I,T>::set_tr(T& tr)
   {
     this->data_->tr_ = tr;
   }
 
+  template <typename S, typename I, typename T>
+  inline
+  tr_image<S,I,T>
+  transposed_image(const Site_Set<S>& s, Image<I>& ima, const Function_x2x<T>& t)
+  {
+    tr_image<S,I,T> tmp(exact(s), exact(ima), exact(t));
+    return tmp;
+  }
+
 # endif // ! MLN_INCLUDE_ONLY
 
 } // end of namespace mln
Index: mln/core/image/interpolated.hh
--- mln/core/image/interpolated.hh	(revision 2404)
+++ mln/core/image/interpolated.hh	(working copy)
@@ -126,6 +126,7 @@
     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);
 
     const F<I> fun_;
   };
@@ -195,11 +196,14 @@
   mln_value(I)
   interpolated<I,F>::operator()(const mln::algebra::vec<I::psite::dim, float>& v) const
   {
-    // mln_psite(I) p;
-    //     for (unsigned i = 0; i < I::point::dim; ++i)
-    //       p[i] = static_cast<int>(round(v[i]));
-    //     mln_assertion(this->data_->ima_.has(p));
-    //     return this->data_->ima_(p);
+    return fun_(v);
+  }
+
+  template <typename I, template <class> class F>
+  inline
+  mln_value(I)
+  interpolated<I,F>::operator()(const mln::algebra::vec<I::psite::dim, float>& v)
+  {
     return fun_(v);
   }
 
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            cleanup-2008 2404: Sandbox: Add basic test for	tr_image over interpolated.
                        
                        
by Ugo Jardonnet 25 Sep '08
                    by Ugo Jardonnet 25 Sep '08
25 Sep '08
                    
                        https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena/sandbox
Index: ChangeLog
from  Ugo Jardonnet  <ugo.jardonnet(a)lrde.epita.fr>
	Sandbox: Add basic test for tr_image over interpolated.
	* jardonnet/virtual/access.cc: Instanciate and use updated morphers.
 access.cc |   29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)
Index: jardonnet/virtual/access.cc
--- jardonnet/virtual/access.cc	(revision 2403)
+++ jardonnet/virtual/access.cc	(working copy)
@@ -11,6 +11,9 @@
 #include <mln/border/fill.hh>
 #include <mln/literal/all.hh>
 #include <mln/core/image/interpolated.hh>
+#include <mln/core/image/tr_image.hh>
+#include <mln/core/var.hh>
+#include <mln/level/fill.hh>
 
 template < template <class> class N,
            typename I, typename T>
@@ -42,8 +45,18 @@
   for_all(p)
   {
     mln::algebra::vec<2,float> v = mln::point2d(p);
-    mln::algebra::vec<2,float> tip = t.inv()(v);
-    output(p) = interp(tip);
+    output(p) = interp(t.inv()(v));
+  }
+}
+
+template <typename I, typename O>
+void
+test3(const I& tr_ima, O& output)
+{
+  mln_piter(I) p(output.domain());
+  for_all(p)
+  {
+    output(p) = tr_ima(p);
   }
 }
 
@@ -64,13 +77,19 @@
   interpolated< image2d< value::rgb<8> >, interpolation::bilinear>
     interp(input);
 
-  //border::adjust(interp, 20);
-
   //transformation
   fun::x2x::translation<2,float> t(make::vec(20,20));
   fun::x2x::rotation<2,float> r(0.12, make::vec(0,1));
+  mln_VAR(rt,  compose(r,t));
+  mln_VAR(tr_ima, transposed_image(interp.domain(), interp, rt));
+
+  //  level::fill(output, tr_ima);
+
+
+  //border::adjust(interp, 20);
 
-  test1<interpolation::bilinear>(input, output, compose(r,t));
+  //test1<interpolation::bilinear>(input, output, compose(r,t));
   //test2(interp, output, compose(r,t));
+  test3(tr_ima, output);
   mln::io::ppm::save(output,"./out.ppm");
 }
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                    
                        #166: Revamp util::complex
-------------------------+--------------------------------------------------
 Reporter:  levill_r     |       Owner:  levill_r 
     Type:  enhancement  |      Status:  new      
 Priority:  major        |   Milestone:  Olena 1.0
Component:  Milena       |     Version:  1.0      
 Keywords:               |  
-------------------------+--------------------------------------------------
 * As for images, use a `tracked_ptr` to handle the data of the complex,
 i.e. split the `complex` classe in two:
    * the complex « shell(s) », holding `tracked_ptr` to shared data; and
    * the actual complex data (vertices and egdes).
  Also, handle complexes directly from `p_complex` instead of using a
 `tracked_ptr`, as copying complexes will become cheap (as for images).
  * Move complex-related types and routines from `mln/core/` to
 `mln/topo/`.
-- 
Ticket URL: <https://trac.lrde.org/olena/ticket/166>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            3
                            
                          
                          
                            
    
                          
                        
                    24 Sep '08
                    
                        	* mln/core/complex_psite.hh: Move...
	* mln/core/site_set/complex_psite.hh: ...here.
	Adjust headers guard and documentation.
	* mln/core/image/complex_image.hh,
	* mln/core/site_set/p_complex.hh:
	Adjust paths.
---
 milena/ChangeLog                                |   11 +++++++++++
 milena/mln/core/image/complex_image.hh          |    2 +-
 milena/mln/core/{ => site_set}/complex_psite.hh |    8 ++++----
 milena/mln/core/site_set/p_complex.hh           |    2 +-
 4 files changed, 17 insertions(+), 6 deletions(-)
 rename milena/mln/core/{ => site_set}/complex_psite.hh (98%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index e782fee..72e9ec6 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,16 @@
 2008-09-24  Roland Levillain  <roland(a)lrde.epita.fr>
 
+	Move mln/core/complex_psite.hh to mln/core/site_set/.
+
+	* mln/core/complex_psite.hh: Move...
+	* mln/core/site_set/complex_psite.hh: ...here.
+	Adjust headers guard and documentation.
+	* mln/core/image/complex_image.hh,
+	* mln/core/site_set/p_complex.hh:
+	Adjust paths.
+
+2008-09-24  Roland Levillain  <roland(a)lrde.epita.fr>
+
 	* tests/core/site_set/Makefile.am (p_bgraph_SOURCES): Disable.
 
 2008-09-24  Roland Levillain  <roland(a)lrde.epita.fr>
diff --git a/milena/mln/core/image/complex_image.hh b/milena/mln/core/image/complex_image.hh
index 09d6e13..a9cea01 100644
--- a/milena/mln/core/image/complex_image.hh
+++ b/milena/mln/core/image/complex_image.hh
@@ -38,7 +38,7 @@
 # include <mln/core/internal/image_primary.hh>
 # include <mln/metal/vec.hh>
 # include <mln/core/site_set/p_complex.hh>
-# include <mln/core/complex_psite.hh>
+# include <mln/core/site_set/complex_psite.hh>
 # include <mln/value/set.hh>
 
 
diff --git a/milena/mln/core/complex_psite.hh b/milena/mln/core/site_set/complex_psite.hh
similarity index 98%
rename from milena/mln/core/complex_psite.hh
rename to milena/mln/core/site_set/complex_psite.hh
index d6692e7..71dd84e 100644
--- a/milena/mln/core/complex_psite.hh
+++ b/milena/mln/core/site_set/complex_psite.hh
@@ -25,10 +25,10 @@
 // reasons why the executable file might be covered by the GNU General
 // Public License.
 
-#ifndef MLN_CORE_COMPLEX_PSITE_HH
-# define MLN_CORE_COMPLEX_PSITE_HH
+#ifndef MLN_CORE_SITE_SET_COMPLEX_PSITE_HH
+# define MLN_CORE_SITE_SET_COMPLEX_PSITE_HH
 
-/// \file mln/core/complex_psite.hh
+/// \file mln/core/site_set/complex_psite.hh
 /// \brief Definition of a complex-based point site.
 
 # include <mln/core/internal/pseudo_site_base.hh>
@@ -370,4 +370,4 @@ namespace mln
 
 } // end of mln
 
-#endif // MLN_CORE_COMPLEX_PSITE_HH
+#endif // MLN_CORE_SITE_SET_COMPLEX_PSITE_HH
diff --git a/milena/mln/core/site_set/p_complex.hh b/milena/mln/core/site_set/p_complex.hh
index ecbc0fa..206cd34 100644
--- a/milena/mln/core/site_set/p_complex.hh
+++ b/milena/mln/core/site_set/p_complex.hh
@@ -35,7 +35,7 @@
 
 # include <mln/topo/complex.hh>
 
-# include <mln/core/complex_psite.hh>
+# include <mln/core/site_set/complex_psite.hh>
 # include <mln/core/site_set/p_complex_piter.hh>
 # include <mln/core/site_set/p_complex_faces_piter.hh>
 
-- 
1.6.0.1
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    24 Sep '08
                    
                        ---
 milena/ChangeLog                       |    4 ++++
 milena/tests/core/site_set/Makefile.am |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 6db7873..e782fee 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,9 @@
 2008-09-24  Roland Levillain  <roland(a)lrde.epita.fr>
 
+	* tests/core/site_set/Makefile.am (p_bgraph_SOURCES): Disable.
+
+2008-09-24  Roland Levillain  <roland(a)lrde.epita.fr>
+
 	Update complex-based images w.r.t. the creation of mln/topo/.
 
 	* mln/core/faces_psite.hh,
diff --git a/milena/tests/core/site_set/Makefile.am b/milena/tests/core/site_set/Makefile.am
index c8059d9..c1f1e14 100644
--- a/milena/tests/core/site_set/Makefile.am
+++ b/milena/tests/core/site_set/Makefile.am
@@ -13,7 +13,7 @@ check_PROGRAMS =				\
   pset_if
 
 p_array_SOURCES = p_array.cc
-p_bgraph_SOURCES = p_bgraph.cc
+##p_bgraph_SOURCES = p_bgraph.cc
 p_image_SOURCES = p_image.cc
 p_priority_queue_SOURCES = p_priority_queue.cc
 p_queue_SOURCES = p_queue.cc
-- 
1.6.0.1
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    24 Sep '08
                    
                        	* mln/core/faces_psite.hh,
	* mln/core/complex_psite.hh,
	* mln/core/site_set/p_complex.hh,
	* mln/core/site_set/p_complex_faces_piter.hh,
	* mln/core/site_set/p_complex_piter.hh,
	* mln/core/site_set/p_faces.hh,
	* mln/core/site_set/p_faces_piter.hh,
	* tests/core/image/complex_image.cc:
	Adjust names.
---
 milena/ChangeLog                                  |   14 +++++++++++
 milena/mln/core/complex_psite.hh                  |   13 +++++-----
 milena/mln/core/faces_psite.hh                    |   12 +++++-----
 milena/mln/core/site_set/p_complex.hh             |   17 ++++++-------
 milena/mln/core/site_set/p_complex_faces_piter.hh |   11 ++++-----
 milena/mln/core/site_set/p_complex_piter.hh       |   11 ++++-----
 milena/mln/core/site_set/p_faces.hh               |   19 +++++++--------
 milena/mln/core/site_set/p_faces_piter.hh         |   11 ++++-----
 milena/tests/core/image/complex_image.cc          |   26 ++++++++++----------
 9 files changed, 72 insertions(+), 62 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 0963983..6db7873 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,19 @@
 2008-09-24  Roland Levillain  <roland(a)lrde.epita.fr>
 
+	Update complex-based images w.r.t. the creation of mln/topo/.
+
+	* mln/core/faces_psite.hh,
+	* mln/core/complex_psite.hh,
+	* mln/core/site_set/p_complex.hh,
+	* mln/core/site_set/p_complex_faces_piter.hh,
+	* mln/core/site_set/p_complex_piter.hh,
+	* mln/core/site_set/p_faces.hh,
+	* mln/core/site_set/p_faces_piter.hh,
+	* tests/core/image/complex_image.cc:
+	Adjust names.
+
+2008-09-24  Roland Levillain  <roland(a)lrde.epita.fr>
+
 	Move complex-related entities to mln/topo/.
 
 	* mln/topo/: New directory.
diff --git a/milena/mln/core/complex_psite.hh b/milena/mln/core/complex_psite.hh
index 2a9a0e7..d6692e7 100644
--- a/milena/mln/core/complex_psite.hh
+++ b/milena/mln/core/complex_psite.hh
@@ -33,7 +33,7 @@
 
 # include <mln/core/internal/pseudo_site_base.hh>
 
-# include <mln/core/complex.hh>
+# include <mln/topo/complex.hh>
 
 // FIXME: There's a circular dependency issue between complex_psite
 // and p_complex (likewise for faces_psite and p_faces): they have to
@@ -72,7 +72,8 @@ namespace mln
     /// \{
     complex_psite();
     /// \pre pc.cplx() == face.cplx().
-    complex_psite(const p_complex<D, P>& pc, const any_face_handle<D>& face);
+    complex_psite(const p_complex<D, P>& pc,
+		  const topo::any_face_handle<D>& face);
     complex_psite(const p_complex<D, P>& pc, unsigned n, unsigned face_id);
     /// \}
 
@@ -106,7 +107,7 @@ namespace mln
     /// Face handle manipulators.
     /// \{
     /// Return the face handle of this point site.
-    any_face_handle<D> face() const;
+    topo::any_face_handle<D> face() const;
 
     /// Return the dimension of the face of this psite.
     unsigned n() const;
@@ -141,7 +142,7 @@ namespace mln
     /// The mln::p_faces this point site belongs to.
     const target* pc_;
     /// The handle of the face this psite is pointing towards.
-    any_face_handle<D> face_;
+    topo::any_face_handle<D> face_;
     /// \}
   };
 
@@ -208,7 +209,7 @@ namespace mln
   template <unsigned D, typename P>
   inline
   complex_psite<D, P>::complex_psite(const p_complex<D, P>& pc,
-				     const any_face_handle<D>& face)
+				     const topo::any_face_handle<D>& face)
     : pc_(&pc),
       face_(face)
   {
@@ -288,7 +289,7 @@ namespace mln
 
   template <unsigned D, typename P>
   inline
-  any_face_handle<D>
+  topo::any_face_handle<D>
   complex_psite<D, P>::face() const
   {
     return face_;
diff --git a/milena/mln/core/faces_psite.hh b/milena/mln/core/faces_psite.hh
index 102394b..dd213b6 100644
--- a/milena/mln/core/faces_psite.hh
+++ b/milena/mln/core/faces_psite.hh
@@ -34,7 +34,7 @@
 
 # include <mln/core/internal/pseudo_site_base.hh>
 
-# include <mln/core/complex.hh>
+# include <mln/topo/complex.hh>
 
 // FIXME: Factor complex_psite and faces_psite?
 
@@ -66,7 +66,7 @@ namespace mln
     /// \{
     faces_psite();
     /// \pre pf.cplx() == face.cplx().
-    faces_psite(const p_faces<N, D, P>& pf, const face_handle<N, D>& face);
+    faces_psite(const p_faces<N, D, P>& pf, const topo::face_handle<N, D>& face);
     faces_psite(const p_faces<N, D, P>& pf, unsigned face_id);
     /// \}
 
@@ -100,7 +100,7 @@ namespace mln
     /// Face handle manipulators.
     /// \{
     /// Return the face handle of this point site.
-    face_handle<N, D> face() const;
+    topo::face_handle<N, D> face() const;
 
     /// Return the dimension of the face of this psite.
     unsigned n() const;
@@ -134,7 +134,7 @@ namespace mln
     /// The mln::p_faces this point site belongs to.
     const target* pf_;
     /// The handle of the face this psite is pointing towards.
-    face_handle<N, D> face_;
+    topo::face_handle<N, D> face_;
     /// \}
   };
 
@@ -199,7 +199,7 @@ namespace mln
   template <unsigned N, unsigned D, typename P>
   inline
   faces_psite<N, D, P>::faces_psite(const p_faces<N, D, P>& pf,
-				    const face_handle<N, D>& face)
+				    const topo::face_handle<N, D>& face)
     : pf_(&pf),
       face_(face)
   {
@@ -285,7 +285,7 @@ namespace mln
 
   template <unsigned N, unsigned D, typename P>
   inline
-  face_handle<N, D>
+  topo::face_handle<N, D>
   faces_psite<N, D, P>::face() const
   {
     return face_;
diff --git a/milena/mln/core/site_set/p_complex.hh b/milena/mln/core/site_set/p_complex.hh
index de6e0ad..ecbc0fa 100644
--- a/milena/mln/core/site_set/p_complex.hh
+++ b/milena/mln/core/site_set/p_complex.hh
@@ -33,7 +33,7 @@
 
 # include <mln/core/internal/site_set_base.hh>
 
-# include <mln/core/complex.hh>
+# include <mln/topo/complex.hh>
 
 # include <mln/core/complex_psite.hh>
 # include <mln/core/site_set/p_complex_piter.hh>
@@ -105,7 +105,7 @@ namespace mln
     /// \brief Construct a complex psite set from a complex.
     ///
     /// \param gr The complex upon which the complex psite set is built.
-    p_complex (const complex<D>& cplx);
+    p_complex (const topo::complex<D>& cplx);
 
     /// Associated types.
     /// \{
@@ -158,10 +158,10 @@ namespace mln
     /// version)
     /* FIXME: Move back the const qualifier on this return type (see
        comment below on cplx_). */
-    complex<D>& cplx() const;
+    topo::complex<D>& cplx() const;
     /// Return the complex associated to the p_complex domain (mutable
     /// version).
-    complex<D>& cplx();
+    topo::complex<D>& cplx();
     /// \}
 
   private:
@@ -179,7 +179,7 @@ namespace mln
          on a complex, leading to a design of complexes similar to
          graphs, where vertex and edge handles (named `id's) are not
          tied to a specific graph.  */
-    mutable complex<D> cplx_;
+    mutable topo::complex<D> cplx_;
   };
 
 
@@ -209,7 +209,7 @@ namespace mln
 
   template <unsigned D, typename P>
   inline
-  p_complex<D, P>::p_complex(const complex<D>& cplx)
+  p_complex<D, P>::p_complex(const topo::complex<D>& cplx)
     : cplx_(cplx)
   {
   }
@@ -262,7 +262,7 @@ namespace mln
   }
 
   template <unsigned D, typename P>
-  complex<D>&
+  topo::complex<D>&
   p_complex<D, P>::cplx() const
   {
     mln_precondition(is_valid());
@@ -270,7 +270,7 @@ namespace mln
   }
 
   template <unsigned D, typename P>
-  complex<D>&
+  topo::complex<D>&
   p_complex<D, P>::cplx()
   {
     mln_precondition(is_valid());
@@ -304,5 +304,4 @@ namespace mln
 
 } // end of mln
 
-
 #endif // MLN_CORE_SITE_SET_P_COMPLEX_HH
diff --git a/milena/mln/core/site_set/p_complex_faces_piter.hh b/milena/mln/core/site_set/p_complex_faces_piter.hh
index ef77272..de10d54 100644
--- a/milena/mln/core/site_set/p_complex_faces_piter.hh
+++ b/milena/mln/core/site_set/p_complex_faces_piter.hh
@@ -37,7 +37,7 @@
 
 # include <mln/core/site_set/p_complex.hh>
 # include <mln/core/internal/p_complex_piter_base.hh>
-# include <mln/core/complex_faces_iter.hh>
+# include <mln/topo/complex_faces_iter.hh>
 
 /* FIXME: p_complex_faces_fwd_piter_ and p_complex_faces_bkd_piter_
    are really long names: find something shorter.  */
@@ -61,13 +61,13 @@ namespace mln
   /// mln::p_complex<D, P>.
   template <unsigned N, unsigned D, typename P>
   class p_complex_faces_fwd_piter_
-    : public internal::p_complex_piter_base_< complex_faces_fwd_iter_<N, D>,
+    : public internal::p_complex_piter_base_< topo::complex_faces_fwd_iter_<N, D>,
 					      p_complex<D, P>,
 					      P,
 					      p_complex_faces_fwd_piter_<N, D, P> >
   {
     typedef p_complex_faces_fwd_piter_<N, D, P> self_;
-    typedef internal::p_complex_piter_base_< complex_faces_fwd_iter_<N, D>,
+    typedef internal::p_complex_piter_base_< topo::complex_faces_fwd_iter_<N, D>,
 					     p_complex<D, P>,
 					     P,
 					     self_ > super_;
@@ -91,13 +91,13 @@ namespace mln
   class p_complex_faces_bkd_piter_
   /* FIXME: Rename internal::p_complex_piter_base_ to something else,
      as it is also used for p_faces piters! */
-    : public internal::p_complex_piter_base_< complex_faces_bkd_iter_<N, D>,
+    : public internal::p_complex_piter_base_< topo::complex_faces_bkd_iter_<N, D>,
 					      p_complex<D, P>,
 					      P,
 					      p_complex_faces_bkd_piter_<N, D, P> >
   {
     typedef p_complex_faces_bkd_piter_<N, D, P> self_;
-    typedef internal::p_complex_piter_base_< complex_faces_bkd_iter_<N, D>,
+    typedef internal::p_complex_piter_base_< topo::complex_faces_bkd_iter_<N, D>,
 					     p_complex<D, P>,
 					     P,
 					     self_ > super_;
@@ -153,5 +153,4 @@ namespace mln
 
 } // end of mln
 
-
 #endif // ! MLN_CORE_SITE_SET_P_COMPLEX_FACES_PITER_HH
diff --git a/milena/mln/core/site_set/p_complex_piter.hh b/milena/mln/core/site_set/p_complex_piter.hh
index 114eed6..996b637 100644
--- a/milena/mln/core/site_set/p_complex_piter.hh
+++ b/milena/mln/core/site_set/p_complex_piter.hh
@@ -36,7 +36,7 @@
 
 # include <mln/core/site_set/p_complex.hh>
 # include <mln/core/internal/p_complex_piter_base.hh>
-# include <mln/core/complex_iter.hh>
+# include <mln/topo/complex_iter.hh>
 
 namespace mln
 {
@@ -55,13 +55,13 @@ namespace mln
   /// \brief Forward iterator on (all) the faces of an mln::p_complex<D, P>.
   template <unsigned D, typename P>
   class p_complex_fwd_piter_
-    : public internal::p_complex_piter_base_< complex_fwd_iter_<D>,
+    : public internal::p_complex_piter_base_< topo::complex_fwd_iter_<D>,
 					      p_complex<D, P>,
 					      P,
 					      p_complex_fwd_piter_<D, P> >
   {
     typedef p_complex_fwd_piter_<D, P> self_;
-    typedef internal::p_complex_piter_base_< complex_fwd_iter_<D>,
+    typedef internal::p_complex_piter_base_< topo::complex_fwd_iter_<D>,
 					     p_complex<D, P>,
 					     P,
 					     self_ > super_;
@@ -82,13 +82,13 @@ namespace mln
   /// \brief Backward iterator on (all) the faces of an mln::p_complex<D, P>.
   template <unsigned D, typename P>
   class p_complex_bkd_piter_
-    : public internal::p_complex_piter_base_< complex_bkd_iter_<D>,
+    : public internal::p_complex_piter_base_< topo::complex_bkd_iter_<D>,
 					      p_complex<D, P>,
 					      P,
 					      p_complex_bkd_piter_<D, P> >
   {
     typedef p_complex_bkd_piter_<D, P> self_;
-    typedef internal::p_complex_piter_base_< complex_bkd_iter_<D>,
+    typedef internal::p_complex_piter_base_< topo::complex_bkd_iter_<D>,
 					     p_complex<D, P>,
 					     P,
 					     self_ > super_;
@@ -144,5 +144,4 @@ namespace mln
 
 } // end of mln
 
-
 #endif // ! MLN_CORE_SITE_SET_P_COMPLEX_PITER_HH
diff --git a/milena/mln/core/site_set/p_faces.hh b/milena/mln/core/site_set/p_faces.hh
index 21cd898..b17f85a 100644
--- a/milena/mln/core/site_set/p_faces.hh
+++ b/milena/mln/core/site_set/p_faces.hh
@@ -34,7 +34,7 @@
 
 # include <mln/core/internal/site_set_base.hh>
 
-# include <mln/core/complex.hh>
+# include <mln/topo/complex.hh>
 
 # include <mln/core/faces_psite.hh>
 # include <mln/core/site_set/p_faces_piter.hh>
@@ -71,7 +71,7 @@ namespace mln
   template <unsigned N, unsigned D, typename P>
   struct p_faces
     : public internal::site_set_base_< faces_psite<N, D, P>,
-					p_faces<N, D, P> >
+				       p_faces<N, D, P> >
   {
     typedef p_faces<N, D, P> self_;
     typedef internal::site_set_base_< faces_psite<N, D, P>, self_ > super_;
@@ -79,7 +79,7 @@ namespace mln
     /// \brief Construct a faces psite set from an mln::complex.
     ///
     /// \param gr The complex upon which the complex psite set is built.
-    p_faces(const complex<D>& cplx);
+    p_faces(const topo::complex<D>& cplx);
 
     /// \brief Construct a faces psite set from an mln::p_complex.
     ///
@@ -140,10 +140,10 @@ namespace mln
     /// version).
     /* FIXME: Move back the const qualifier on this return type (see
        comment below on cplx_). */
-    complex<D>& cplx() const;
+    topo::complex<D>& cplx() const;
     /// Return the complex associated to the p_faces domain (mutable
     /// version).
-    complex<D>& cplx();
+    topo::complex<D>& cplx();
     /// \}
 
   private:
@@ -160,7 +160,7 @@ namespace mln
          on a complex, leading to a design of complexes similar to
          graphs, where vertex and edge handles (named `id's) are not
          tied to a specific graph.  */
-    mutable complex<D> cplx_;
+    mutable topo::complex<D> cplx_;
   };
 
 
@@ -190,7 +190,7 @@ namespace mln
 
   template <unsigned N, unsigned D, typename P>
   inline
-  p_faces<N, D, P>::p_faces(const complex<D>& cplx)
+  p_faces<N, D, P>::p_faces(const topo::complex<D>& cplx)
     : cplx_(cplx)
   {
     // Ensure N is compatible with D.
@@ -254,7 +254,7 @@ namespace mln
   }
 
   template <unsigned N, unsigned D, typename P>
-  complex<D>&
+  topo::complex<D>&
   p_faces<N, D, P>::cplx() const
   {
     mln_precondition(is_valid());
@@ -262,7 +262,7 @@ namespace mln
   }
 
   template <unsigned N, unsigned D, typename P>
-  complex<D>&
+  topo::complex<D>&
   p_faces<N, D, P>::cplx()
   {
     mln_precondition(is_valid());
@@ -296,5 +296,4 @@ namespace mln
 
 } // end of mln
 
-
 #endif // MLN_CORE_SITE_SET_P_FACES_HH
diff --git a/milena/mln/core/site_set/p_faces_piter.hh b/milena/mln/core/site_set/p_faces_piter.hh
index 65f07fd..bfd1031 100644
--- a/milena/mln/core/site_set/p_faces_piter.hh
+++ b/milena/mln/core/site_set/p_faces_piter.hh
@@ -36,7 +36,7 @@
 
 # include <mln/core/site_set/p_faces.hh>
 # include <mln/core/internal/p_complex_piter_base.hh>
-# include <mln/core/faces_iter.hh>
+# include <mln/topo/faces_iter.hh>
 
 
 namespace mln
@@ -57,13 +57,13 @@ namespace mln
   /// mln::p_faces<N, D, P>.
   template <unsigned N, unsigned D, typename P>
   class p_faces_fwd_piter_
-    : public internal::p_complex_piter_base_< faces_fwd_iter_<N, D>,
+    : public internal::p_complex_piter_base_< topo::faces_fwd_iter_<N, D>,
 					      p_faces<N, D, P>,
 					      P,
 					      p_faces_fwd_piter_<N, D, P> >
   {
     typedef p_faces_fwd_piter_<N, D, P> self_;
-    typedef internal::p_complex_piter_base_< faces_fwd_iter_<N, D>,
+    typedef internal::p_complex_piter_base_< topo::faces_fwd_iter_<N, D>,
 					     p_faces<N, D, P>,
 					     P,
 					     self_ > super_;
@@ -87,13 +87,13 @@ namespace mln
   class p_faces_bkd_piter_
   /* FIXME: Rename internal::p_complex_piter_base_ to something else,
      as it is also used for p_faces piters! */
-    : public internal::p_complex_piter_base_< faces_bkd_iter_<N, D>,
+    : public internal::p_complex_piter_base_< topo::faces_bkd_iter_<N, D>,
 					      p_faces<N, D, P>,
 					      P,
 					      p_faces_bkd_piter_<N, D, P> >
   {
     typedef p_faces_bkd_piter_<N, D, P> self_;
-    typedef internal::p_complex_piter_base_< faces_bkd_iter_<N, D>,
+    typedef internal::p_complex_piter_base_< topo::faces_bkd_iter_<N, D>,
 					     p_faces<N, D, P>,
 					     P,
 					     self_ > super_;
@@ -149,5 +149,4 @@ namespace mln
 
 } // end of mln
 
-
 #endif // ! MLN_CORE_SITE_SET_P_FACES_PITER_HH
diff --git a/milena/tests/core/image/complex_image.cc b/milena/tests/core/image/complex_image.cc
index 24f0a2c..3b40fba 100644
--- a/milena/tests/core/image/complex_image.cc
+++ b/milena/tests/core/image/complex_image.cc
@@ -65,24 +65,24 @@ int main()
 
   const unsigned D = 2;
 
-  complex<D> c;
+  topo::complex<D> c;
 
   // 0-faces (points).
-  face_handle<0, D> v0 = c.add_face();
-  face_handle<0, D> v1 = c.add_face();
-  face_handle<0, D> v2 = c.add_face();
-  face_handle<0, D> v3 = c.add_face();
+  topo::face_handle<0, D> v0 = c.add_face();
+  topo::face_handle<0, D> v1 = c.add_face();
+  topo::face_handle<0, D> v2 = c.add_face();
+  topo::face_handle<0, D> v3 = c.add_face();
  
   // 1-faces (segments).
-  face_handle<1, D> e0 = c.add_face(v0 + v1);
-  face_handle<1, D> e1 = c.add_face(v0 + v2);
-  face_handle<1, D> e2 = c.add_face(v1 + v2);
-  face_handle<1, D> e3 = c.add_face(v0 + v3);
-  face_handle<1, D> e4 = c.add_face(v2 + v3);
+  topo::face_handle<1, D> e0 = c.add_face(v0 + v1);
+  topo::face_handle<1, D> e1 = c.add_face(v0 + v2);
+  topo::face_handle<1, D> e2 = c.add_face(v1 + v2);
+  topo::face_handle<1, D> e3 = c.add_face(v0 + v3);
+  topo::face_handle<1, D> e4 = c.add_face(v2 + v3);
 
   // 2-faces (triangles).
-  face_handle<2, D> t0 = c.add_face(e0 + e1 + e2);
-  face_handle<2, D> t1 = c.add_face(e1 + e3 + e4);
+  topo::face_handle<2, D> t0 = c.add_face(e0 + e1 + e2);
+  topo::face_handle<2, D> t1 = c.add_face(e1 + e3 + e4);
 
   
   /*---------------------.
@@ -91,7 +91,7 @@ int main()
 
   // A pset.
   p_complex<D, point2d> pc(c);
-  any_face_handle<D> af(e0);
+  topo::any_face_handle<D> af(e0);
   // An associated psite.
   complex_psite<D, point2d> cs(pc, af);
 
-- 
1.6.0.1
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    24 Sep '08
                    
                        ---
 ChangeLog    |    4 ++++
 configure.ac |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 65f114b..c0f3a0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-09-24  Roland Levillain  <roland(a)lrde.epita.fr>
+
+	* configure.ac: Configure milena/tests/topo/Makefile.
+
 2008-09-22  Thierry Geraud  <thierry.geraud(a)lrde.epita.fr>
 
 	Update test on extension fill.
diff --git a/configure.ac b/configure.ac
index 7c1462e..c6dcd24 100644
--- a/configure.ac
+++ b/configure.ac
@@ -216,6 +216,7 @@ AC_CONFIG_FILES([
     milena/tests/subsampling/Makefile
     milena/tests/tag/Makefile
     milena/tests/test/Makefile
+    milena/tests/topo/Makefile
     milena/tests/trace/Makefile
     milena/tests/trait/Makefile
       milena/tests/trait/image/Makefile
-- 
1.6.0.1
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                    
                        	* mln/topo/: New directory.
	* tests/topo/: New directory.
	* mln/core/complex.hh,
	* mln/core/complex_faces_iter.hh,
	* mln/core/face.hh,
	* mln/core/faces_iter.hh,
	* mln/core/internal/complex_iter_base.hh,
	* tests/core/other/complex.cc:
	Move...
	* mln/topo/complex.hh,
	* mln/topo/complex_faces_iter.hh,
	* mln/topo/face.hh,
	* mln/topo/faces_iter.hh,
	* mln/topo/internal/complex_iter_base.hh,
	* tests/topo/complex.cc:
	...here.
	Adjust.
	* tests/core/other/Makefile.am
	(check_PROGRAM): Remove complex.
	(complex_SOURCES): Remove.
	* tests/topo/Makefile.am: New.
	(check_PROGRAM): Add complex.
	(complex_SOURCES, TESTS): New.
	* tests/Makefile.am (SUBDIRS): Add topo.
---
 milena/ChangeLog                              |   29 +
 milena/mln/core/complex.hh                    |  853 ------------------------
 milena/mln/core/complex_faces_iter.hh         |  262 --------
 milena/mln/core/complex_iter.hh               |  270 --------
 milena/mln/core/face.hh                       |  729 ---------------------
 milena/mln/core/faces_iter.hh                 |  247 -------
 milena/mln/core/internal/complex_iter_base.hh |  202 ------
 milena/mln/topo/complex.hh                    |  857 +++++++++++++++++++++++++
 milena/mln/topo/complex_faces_iter.hh         |  266 ++++++++
 milena/mln/topo/complex_iter.hh               |  275 ++++++++
 milena/mln/topo/face.hh                       |  733 +++++++++++++++++++++
 milena/mln/topo/faces_iter.hh                 |  251 ++++++++
 milena/mln/topo/internal/complex_iter_base.hh |  208 ++++++
 milena/tests/Makefile.am                      |    1 +
 milena/tests/core/other/Makefile.am           |    2 -
 milena/tests/topo/Makefile.am                 |   10 +
 milena/tests/{core/other => topo}/complex.cc  |   54 +-
 17 files changed, 2657 insertions(+), 2592 deletions(-)
 delete mode 100644 milena/mln/core/complex.hh
 delete mode 100644 milena/mln/core/complex_faces_iter.hh
 delete mode 100644 milena/mln/core/complex_iter.hh
 delete mode 100644 milena/mln/core/face.hh
 delete mode 100644 milena/mln/core/faces_iter.hh
 delete mode 100644 milena/mln/core/internal/complex_iter_base.hh
 create mode 100644 milena/mln/topo/complex.hh
 create mode 100644 milena/mln/topo/complex_faces_iter.hh
 create mode 100644 milena/mln/topo/complex_iter.hh
 create mode 100644 milena/mln/topo/face.hh
 create mode 100644 milena/mln/topo/faces_iter.hh
 create mode 100644 milena/mln/topo/internal/complex_iter_base.hh
 create mode 100644 milena/tests/topo/Makefile.am
 rename milena/tests/{core/other => topo}/complex.cc (79%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index aa7dc82..0963983 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,32 @@
+2008-09-24  Roland Levillain  <roland(a)lrde.epita.fr>
+
+	Move complex-related entities to mln/topo/.
+
+	* mln/topo/: New directory.
+	* tests/topo/: New directory.
+	* mln/core/complex.hh,
+	* mln/core/complex_faces_iter.hh,
+	* mln/core/face.hh,
+	* mln/core/faces_iter.hh,
+	* mln/core/internal/complex_iter_base.hh,
+	* tests/core/other/complex.cc:
+	Move...
+	* mln/topo/complex.hh,
+	* mln/topo/complex_faces_iter.hh,
+	* mln/topo/face.hh,
+	* mln/topo/faces_iter.hh,
+	* mln/topo/internal/complex_iter_base.hh,
+	* tests/topo/complex.cc:
+	...here.
+	Adjust.
+	* tests/core/other/Makefile.am
+	(check_PROGRAM): Remove complex.
+	(complex_SOURCES): Remove.
+	* tests/topo/Makefile.am: New.
+	(check_PROGRAM): Add complex.
+	(complex_SOURCES, TESTS): New.
+	* tests/Makefile.am (SUBDIRS): Add topo.
+
 2008-09-24  Thierry Geraud  <thierry.geraud(a)lrde.epita.fr>
 
 	Make w_window tests pass with from_to instead of to_w_window.
diff --git a/milena/mln/core/complex.hh b/milena/mln/core/complex.hh
deleted file mode 100644
index 2329a71..0000000
--- a/milena/mln/core/complex.hh
+++ /dev/null
@@ -1,853 +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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
-
-#ifndef MLN_CORE_COMPLEX_HH
-# define MLN_CORE_COMPLEX_HH
-
-/// \file mln/core/complex.hh
-/// \brief Structures for general complexes.
-///
-/// A complex defines a topological space which can be used as a
-/// support for an image (i.e., as site sets).
-
-# include <cstddef>
-
-# include <limits>
-# include <iosfwd>
-
-# include <mln/metal/bool.hh>
-
-# include <mln/util/tracked_ptr.hh>
-
-# include <mln/core/face.hh>
-
-# include <mln/core/complex_iter.hh>
-# include <mln/core/faces_iter.hh>
-# include <mln/core/complex_faces_iter.hh>
-
-
-namespace mln
-{
-
-  // Forward declarations.
-  namespace internal
-  {
-    template <unsigned D>
-    struct complex_data;
-
-    template <unsigned N, unsigned D>
-    struct faces_set_mixin;
-  }
-  template <unsigned D> class complex_fwd_iter_;
-  template <unsigned D> class complex_bkd_iter_;
-  template <unsigned N, unsigned D> class faces_fwd_iter_;
-  template <unsigned N, unsigned D> class faces_bkd_iter_;
-
-
-  /*----------.
-  | Complex.  |
-  `----------*/
-
-  /// \brief General complex of dimension \p D.
-  template <unsigned D>
-  class complex
-  {
-  public:
-    /// Forward mln::Iterator type iterating on all faces.
-    typedef complex_fwd_iter_<D> fwd_citer;
-    /// Backward mln::Iterator type iterating on all faces.
-    typedef complex_bkd_iter_<D> bkd_citer;
-
-    /// Forward mln::Iterator type iterating on \p N-faces.
-    template <unsigned N>
-    struct fwd_fiter { typedef faces_fwd_iter_<N, D> ret; };
-    /// Backward mln::Iterator type iterating on \p N-faces.
-    template <unsigned N>
-    struct bkd_fiter { typedef faces_bkd_iter_<N, D> ret; };
-
-    /// Complex construction.
-    /// \{
-    /// Create a new \p D-complex.
-    complex();
-
-    /// \brief Add a 0-face to the complex.
-    face_handle<0u, D> add_face();
-
-    /// \brief Add a \p (N+1)-face to the complex (with \p N >= 0).
-    ///
-    /// \param adjacent_faces The (\p N-1)-faces adjacent to the new
-    /// \p N-face.
-    template <unsigned N>
-    face_handle<N + 1, D> add_face(const faces_set<N, D>& adjacent_faces);
-    /// \}
-
-    /// \brief Static manipulators.
-    ///
-    /// These methods use statically-known input.
-    /// \{
-    /// \brief Return the total number of faces, whatever their
-    /// dimension.
-    std::size_t nfaces() const;
-
-    /// \brief Return the number of \p N-faces.
-    template <unsigned N>
-    std::size_t nfaces() const;
-    /// \}
-
-    /// \brief Dynamic manipulators.
-    ///
-    /// These methods use input know as run time.
-    /// \{
-    /// \brief Return the number of \a n-faces.
-    ///
-    /// Warning, this function has a complexity linear in term of N,
-    /// since each faces_set is checked (the present implementation
-    /// does not provide a direct access to faces_set through a
-    /// dynamic value of the dimension).
-    std::size_t nfaces(unsigned n) const;
-    /// \}
-
-    /// Pretty-printing.
-    /// \{
-    /// Print the complex.
-    void print(std::ostream& ostr) const;
-    /// Print the faces of dimension \p N.
-    template <unsigned N>
-    void print_faces(std::ostream& ostr) const;
-    /// \}
-
-  private:
-    /// The actual data of the complex.
-    util::tracked_ptr< internal::complex_data<D> > data_;
-
-    template <unsigned D_>
-    friend bool operator==(const complex<D_>& lhs, const complex<D_>& rhs);
-
-    /// Accessors.
-    /// \{
-    template <unsigned N, unsigned D_> friend class face_handle;
-    template <unsigned D_> friend class any_face_handle;
-
-    template <unsigned N>
-    face<N, D>& face_(unsigned face_id);
-
-    template <unsigned N>
-    const face<N, D>& face_(unsigned face_id) const;
-    /// \}
-
-    /// Functional meta-manipulators.
-    /// \{
-    /* FIXME: Use something more constraining than the STL's
-       UnaryFunction/BinaryFunction.  Use Function or Function_v2v?
-       Or a new subclass of Function?  */
-
-    /* FIXME: Replace F and ACCU by a Milena accumulator?  */
-
-    /** \brief Apply a kind of static fold left operator to the
-        implicit list of faces_set using a functor \a f and a value \a
-        accu.
-
-	Argument \a is called an "accumulator", but with a slightly
-        different meaning than mln:accu members.
-
-	We might want to use TypeLists or something similar, is they
-	provide an explicit static fold left operator.  */
-    template <typename BinaryFunction, typename T>
-    T fold_left_(const BinaryFunction& f, const T& accu) const;
-
-    /// \brief Apply a functor \a f to this list of \a n-faces.
-    template <typename UnaryFunction>
-    typename UnaryFunction::result_type
-    apply_if_dim_matches_(unsigned n, const UnaryFunction& f) const;
-    /// \}
-
-    /// \brief connect two faces.
-    ///
-    /// \param f1 A face of dimension \p N
-    /// \param f2 A face of dimension \p N + 1
-    ///
-    /// \pre \p N must be lower or equal to \p D.
-    template <unsigned N>
-    void connect_(const face_handle<N, D>& f1,
-		  const face_handle<N + 1, D>& f2);
-  };
-
-
-  /// Compare two complexes for equality.
-  template <unsigned D>
-  bool
-  operator==(const complex<D>& lhs, const complex<D>& rhs);
-
-
-  /// Pretty print a complex.
-  template <unsigned D>
-  std::ostream&
-  operator<<(std::ostream& ostr, const complex<D>& c);
-
-
-  /*---------------.
-  | Complex data.  |
-  `---------------*/
-
-  namespace internal
-  {
-    // Forward declarations.
-    template <unsigned N, unsigned D>
-    struct faces_set_mixin;
-    
-    /// \brief Complex data.
-    template <unsigned D>
-    struct complex_data : faces_set_mixin<D, D>
-    {
-      // Data is contained in super classes.
-    };
-    
-  } // end of namespace mln::internal::complex
-
-
-  /*---------------------.
-  | Faces of a complex.  |
-  `---------------------*/
-
-  /// The sets of n-faces of a complex are recursively aggregated as
-  /// mixins.
-  namespace internal
-  {
-
-    // Forward declarations.
-    template <unsigned N, unsigned D> struct lower_dim_faces_set_mixin;
-    template <unsigned N, unsigned D> struct higher_dim_faces_set_mixin;
-
-    // -------------------------------- //
-    // mln::internal::faces_set_mixin.  //
-    // -------------------------------- //
-
-    /// \brief Recursive mixins of set of faces.
-    /// \{
-    template <unsigned N, unsigned D> struct faces_set_mixin;
-
-    /// Faces of highest dimension (\p D).
-    template <unsigned D>
-    struct faces_set_mixin<D, D> : public faces_set_mixin<D - 1, D>,
-				   public lower_dim_faces_set_mixin<D, D>
-    {
-      std::vector< face<D, D> > faces_;
-
-      /// Pretty-printing.
-      /// \{
-      /// Print the faces of dimension \p D.
-      void print(std::ostream& ostr) const;
-      void print_rec_asc(std::ostream& ostr) const;
-      /// \}
-
-      /// Functional meta-manipulators.
-      /// \{
-      /// \brief Fold left.
-      /// \see mln::complex<D>::fold_left_.
-      template <typename BinaryFunction, typename T>
-      T fold_left_(const BinaryFunction& f, const T& accu) const;
-      /// \brief Apply a functor \a f to the list of faces if \a n == \p D.
-      /// \see mln::complex<D>::apply_if_dim_matches_.
-      template <typename UnaryFunction>
-      typename UnaryFunction::result_type
-      apply_if_dim_matches_(unsigned n, const UnaryFunction& f) const;
-      /// \}
-    };
-
-    /// Faces of intermediate dimension (greater than 0, lower than \p D).
-    template <unsigned N, unsigned D>
-    struct faces_set_mixin : public faces_set_mixin<N - 1, D>,
-                             public lower_dim_faces_set_mixin<N, D>,
-                             public higher_dim_faces_set_mixin<N, D>
-    {
-      std::vector< face<N, D> > faces_;
-
-      /// Pretty-printing.
-      /// \{
-      /// Print the faces of dimension \p N.
-      void print(std::ostream& ostr) const;
-      /// Recursively print the faces of dimensions 0 to \p N
-      /// (in ascending dimension).
-      void print_rec_asc(std::ostream& ostr) const;
-      /// \}
-
-      /// Functional meta-manipulators.
-      /// \{
-      /// \brief Fold left.
-      /// \see mln::complex<D>::fold_left_.
-      template <typename BinaryFunction, typename T>
-      T fold_left_(const BinaryFunction& f, const T& accu) const;
-      /// \brief Apply a functor \a f to the list of faces if \a n == \p N.
-      /// \see mln::complex<D>::apply_if_dim_matches_.
-      template <typename UnaryFunction>
-      typename UnaryFunction::result_type
-      apply_if_dim_matches_(unsigned n, const UnaryFunction& f) const;
-      /// \}
-    };
-
-    /// Faces of lowest dimension (0).
-    template <unsigned D>
-    struct faces_set_mixin<0u, D> : public higher_dim_faces_set_mixin<0u, D>
-    {
-      std::vector< face<0u, D> > faces_;
-
-      /// Pretty-printing.
-      /// \{
-      /// Print the faces of dimension 0.
-      void print(std::ostream& ostr) const;
-      void print_rec_asc(std::ostream& ostr) const;
-      /// \}
-
-      /// Functional meta-manipulators.
-      /// \{
-      /// \brief Fold left.
-      /// \see mln::complex<D>::fold_left_.
-      template <typename BinaryFunction, typename T>
-      T fold_left_(const BinaryFunction& f, const T& accu) const;
-      /// \brief Apply a functor \a f to the list of faces if \a n == 0.
-      /// \see mln::complex<D>::apply_if_dim_matches_.
-      template <typename UnaryFunction>
-      typename UnaryFunction::result_type
-      apply_if_dim_matches_(unsigned n, const UnaryFunction& f) const;
-      /// \}
-    };
-
-    /// Faces of a 0-complex.
-    template <>
-    struct faces_set_mixin<0u, 0u>
-    {
-      std::vector< face<0u, 0u> > faces_;
-
-      /// Pretty-printing.
-      /// \{
-      /// Print the faces of dimension \p D.
-      void print(std::ostream& ostr) const;
-      void print_rec_asc(std::ostream& ostr) const;
-      /// \}
-
-      /// Functional meta-manipulators.
-      /// \{
-      /// \brief Fold left.
-      /// \see mln::complex<D>::fold_left_.
-      template <typename BinaryFunction, typename T>
-      T fold_left_(const BinaryFunction& f, const T& accu) const;
-      /// \brief Apply a functor \a f to the list of faces if \a n == 0.
-      /// \see mln::complex<D>::apply_if_dim_matches_.
-      template <typename UnaryFunction>
-      typename UnaryFunction::result_type
-      apply_if_dim_matches_(unsigned n, const UnaryFunction& f) const;
-      /// \}
-    };
-    /// \}
-
-
-    // ------------------------------------------- //
-    // mln::internal::lower_dim_faces_set_mixin.   //
-    // mln::internal::higher_dim_faces_set_mixin.  //
-    // ------------------------------------------- //
-
-    /// Mixins of mixin mln::faces_set_mixin.
-    /// \{
-    template <unsigned N, unsigned D>
-    struct lower_dim_faces_set_mixin
-    {
-      void print(std::ostream& ostr, const face<N, D>& f) const;
-    };
-
-    template <unsigned N, unsigned D>
-    struct higher_dim_faces_set_mixin
-    {
-      void print(std::ostream& ostr, const face<N, D>& f) const;
-    };
-    /// \}
-
-  } // end of namespace mln::internal
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-  /*-----------------------.
-  | Complex construction.  |
-  `-----------------------*/
-
-  template <unsigned D>
-  complex<D>::complex()
-    // Allocate data for this complex.
-    : data_(new internal::complex_data<D>())
-  {
-  }
-
-  template <unsigned D>
-  face_handle<0u, D>
-  complex<D>::add_face()
-  {
-    /* FIXME: This is not thread-proof (these two lines should
-       form an atomic section).  */
-    data_->internal::faces_set_mixin<0u, D>::faces_.push_back(face<0u, D>());
-    unsigned id = nfaces<0u>() - 1;
-
-    return face_handle<0u, D>(*this, id);
-  }
-
-  template <unsigned D>
-  template <unsigned N>
-  face_handle<N + 1, D>
-  complex<D>::add_face(const faces_set<N, D>& adjacent_faces)
-  {
-    typedef typename std::vector< face_handle<N, D> >::const_iterator iter_t;
-
-    // Ensure ADJACENT_FACES are already part of the complex.
-    if (!HAS_NDEBUG)
-      for (iter_t a = adjacent_faces.faces().begin();
-	   a != adjacent_faces.faces().end(); ++a)
-	{
-	  mln_precondition(&a->cplx() == this);
-	  mln_precondition(a->is_valid());
-	}
-
-    face<N + 1, D> f;
-    /* FIXME: This is not thread-proof (these two lines should
-       form an atomic section).  */
-    data_->internal::faces_set_mixin<N + 1, D>::faces_.push_back(f);
-    unsigned id = nfaces<N + 1>() - 1;
-
-    face_handle<N + 1, D> fh(*this, id);
-    // Connect F and its ADJACENT_FACES.
-    for (iter_t a = adjacent_faces.faces().begin();
-	 a != adjacent_faces.faces().end(); ++a)
-      connect_(*a, fh);
-    return fh;
-  }
-
-
-  /*-------.
-  | Misc.  |
-  `-------*/
-
-  namespace internal
-  {
-
-    /// A binary meta-functor defined by:
-    ///
-    /// \code
-    /// add_size : x, c -> x + c.size()
-    /// \endcode
-    ///
-    /// \see mln::complex<D>::nfaces (static version).
-    /// \see mln::complex<D>::fold_left_.
-    struct add_size
-    {
-      template <typename T, typename Container>
-      T operator()(const T& x, const Container& c) const
-      {
-	return x + c.size();
-      }
-    };
-
-    /// An unary meta-functor defined by:
-    ///
-    /// \code
-    /// add_size : c -> c.size()
-    /// \endcode
-    ///
-    /// \see mln::complex<D>::nfaces (dynamic version).
-    /// \see mln::complex<D>::apply_if_dim_matches_.
-    struct get_size
-    {
-      typedef std::size_t result_type;
-
-      template <typename Container>
-      typename Container::size_type operator()(const Container& c) const
-      {
-	return c.size();
-      }
-    };
-
-  } // end of namespace mln::internal
-
-
-  /*----------------------.
-  | Static manipulators.  |
-  `----------------------*/
-
-  template <unsigned D>
-  std::size_t
-  complex<D>::nfaces() const
-  {
-    return fold_left_(internal::add_size(), 0);
-  }
-
-  template <unsigned D>
-  template <unsigned N>
-  std::size_t
-  complex<D>::nfaces() const
-  {
-    return data_->internal::faces_set_mixin<N, D>::faces_.size();
-  }
-
-
-  /*-----------------------.
-  | Dynamic manipulators.  |
-  `-----------------------*/
-
-  template <unsigned D>
-  std::size_t
-  complex<D>::nfaces(unsigned n) const
-  {
-    // Ensure N is compatible with D.
-    mln_precondition(n <= D);
-    return apply_if_dim_matches_(n, internal::get_size());
-  }
-
-
-  /*-------------------.
-  | Internal methods.  |
-  `-------------------*/
-
-  template <unsigned D>
-  template <unsigned N>
-  face<N, D>&
-  complex<D>::face_(unsigned face_id)
-  {
-    return data_->internal::faces_set_mixin<N, D>::faces_[face_id];
-  }
-
-  template <unsigned D>
-  template <unsigned N>
-  const face<N, D>&
-  complex<D>::face_(unsigned face_id) const
-  {
-    return data_->internal::faces_set_mixin<N, D>::faces_[face_id];
-  }
-
-  template <unsigned D>
-  template <unsigned N>
-  void
-  complex<D>::connect_(const face_handle<N, D>& f1,
-		       const face_handle<N + 1, D>& f2)
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-
-    f1.to_face().connect_higher_dim_face(f2);
-    f2.to_face().connect_lower_dim_face(f1);
-  }
-
-
-  /*-------------.
-  | Comparison.  |
-  `-------------*/
-
-  template <unsigned D>
-  bool
-  operator==(const complex<D>& lhs, const complex<D>& rhs)
-  {
-    return lhs.data_.ptr_ == rhs.data_.ptr_;
-  }
-
-
-  /*------------------.
-  | Pretty-printing.  |
-  `------------------*/
-
-  template <unsigned D>
-  std::ostream&
-  operator<<(std::ostream& ostr, const complex<D>& c)
-  {
-    c.print(ostr);
-    return ostr;
-  }
-
-  template <unsigned D>
-  void
-  complex<D>::print(std::ostream& ostr) const
-  {
-    data_->internal::faces_set_mixin<D, D>::print_rec_asc(ostr);
-  }
-
-  template <unsigned D>
-  template <unsigned N>
-  void
-  complex<D>::print_faces(std::ostream& ostr) const
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-
-    data_->internal::faces_set_mixin<N, D>::print(ostr);
-  }
-
-
-  namespace internal
-  {
-
-    template <unsigned N, unsigned D>
-    void
-    faces_set_mixin<N, D>::print_rec_asc(std::ostream& ostr) const
-    {
-      faces_set_mixin<N - 1, D>::print_rec_asc(ostr);
-      print(ostr);
-    }
-
-    template <unsigned D>
-    void
-    faces_set_mixin<0u, D>::print_rec_asc(std::ostream& ostr) const
-    {
-      print(ostr);
-    }
-
-    template <unsigned D>
-    void
-    faces_set_mixin<D, D>::print_rec_asc(std::ostream& ostr) const
-    {
-      faces_set_mixin<D - 1, D>::print_rec_asc(ostr);
-      print(ostr);
-    }
-
-    void
-    faces_set_mixin<0u, 0u>::print_rec_asc(std::ostream& ostr) const
-    {
-      print(ostr);
-    }
-
-
-    template <unsigned N, unsigned D>
-    void
-    faces_set_mixin<N, D>::print(std::ostream& ostr) const
-    {
-      ostr << "Faces of dimension " << N
-	   << " and their ajacent faces of dimension "
-	   << N - 1 << " and "
-	   << N + 1 << std::endl;
-      for (unsigned f = 0; f < faces_.size(); ++f)
-	{
-	  ostr << "  " << f << ":  dim " << N - 1 << ": { ";
-	  lower_dim_faces_set_mixin<N, D>::print(ostr, faces_[f]);
-	  ostr << "},  dim " << N + 1 << ": { ";
-	  higher_dim_faces_set_mixin<N, D>::print(ostr, faces_[f]);
-	  ostr << "}" << std::endl;
-	}
-    }
-
-    template <unsigned D>
-    void
-    faces_set_mixin<0u, D>::print(std::ostream& ostr) const
-    {
-      const unsigned N = 0u;
-      ostr << "Faces of dimension " << N
-	   << " and their ajacent faces of dimension "
-	   << N + 1 << std::endl;
-      for (unsigned f = 0; f < faces_.size(); ++f)
-	{
-	  ostr << "  " << f << ":  dim " << N + 1 << ": { ";
-	  higher_dim_faces_set_mixin<N, D>::print(ostr, faces_[f]);
-	  ostr << "}" << std::endl;
-	}
-    }
-
-    template <unsigned D>
-    void
-    faces_set_mixin<D, D>::print(std::ostream& ostr) const
-    {
-      const unsigned N = D;
-      ostr << "Faces of dimension " << N
-	   << " and their ajacent faces of dimension "
-	   << N - 1 << std::endl;
-      for (unsigned f = 0; f < faces_.size(); ++f)
-	{
-	  ostr << "  " << f << ":  dim " << N - 1 << ": { ";
-	  lower_dim_faces_set_mixin<N, D>::print(ostr, faces_[f]);
-	  ostr << "}" << std::endl;
-	}
-    }
-
-    void
-    faces_set_mixin<0u, 0u>::print(std::ostream& ostr) const
-    {
-      const unsigned N = 0u;
-      ostr << "Faces of dimension " << N << std::endl;
-      for (unsigned f = 0; f < faces_.size(); ++f)
-	ostr << "  " << f << std::endl;
-    }
-
-
-    template <unsigned N, unsigned D>
-    void
-    lower_dim_faces_set_mixin<N, D>::print(std::ostream& ostr,
-					   const face<N, D>& f) const
-    {
-      for (typename std::vector< face_handle<N - 1, D> >::const_iterator l =
-	     f.lower_dim_faces_.begin(); l != f.lower_dim_faces_.end(); ++l)
-	ostr << l->face_id() << " ";
-    }
-
-    template <unsigned N, unsigned D>
-    void
-    higher_dim_faces_set_mixin<N, D>::print(std::ostream& ostr,
-					    const face<N, D>& f) const
-    {
-      for (typename std::vector< face_handle<N + 1, D> >::const_iterator h =
-	     f.higher_dim_faces_.begin(); h != f.higher_dim_faces_.end(); ++h)
-	ostr << h->face_id() << " ";
-    }
-
-  } // end of namespace mln::internal
-
-
-  /*-------------------------------.
-  | Functional meta-manipulators.  |
-  `-------------------------------*/
-
-  /* ------------------------------- */
-  /* ``Static Fold Left'' Operator.  */
-  /* ------------------------------- */
-
-  template <unsigned D>
-  template <typename BinaryFunction, typename T>
-  T
-  complex<D>::fold_left_(const BinaryFunction& f, const T& accu) const
-  {
-    return data_->internal::faces_set_mixin<D, D>::fold_left_(f, accu);
-  }
-
-  namespace internal
-  {
-
-    // FIXME: Try to factor.
-
-    template <unsigned D>
-    template <typename BinaryFunction, typename T>
-    T
-    faces_set_mixin<D, D>::fold_left_(const BinaryFunction& f,
-				      const T& accu) const
-    {
-      return faces_set_mixin<D - 1, D>::fold_left_(f, f(accu, faces_));
-    }
-
-    template <unsigned N, unsigned D>
-    template <typename BinaryFunction, typename T>
-    T
-    faces_set_mixin<N, D>::fold_left_(const BinaryFunction& f,
-				      const T& accu) const
-    {
-      return faces_set_mixin<N - 1, D>::fold_left_(f, f(accu, faces_));
-    }
-
-    template <unsigned D>
-    template <typename BinaryFunction, typename T>
-    T
-    faces_set_mixin<0u, D>::fold_left_(const BinaryFunction& f,
-				       const T& accu) const
-    {
-      return f(accu, faces_);
-    }
-
-    template <typename BinaryFunction, typename T>
-    T
-    faces_set_mixin<0u, 0u>::fold_left_(const BinaryFunction& f,
-					const T& accu) const
-    {
-      return f(accu, faces_);
-    }
-
-  } // end of namespace mln::internal
-
-
-  /* ------------------------------------------------ */
-  /* ``Static Apply-If-Dimension-Matches'' Operator.  */
-  /* ------------------------------------------------ */
-
-  template <unsigned D>
-  template <typename UnaryFunction>
-  typename UnaryFunction::result_type
-  complex<D>::apply_if_dim_matches_(unsigned n, const UnaryFunction& f) const
-  {
-    // Ensure N is compatible with D.
-    mln_precondition(n <= D);
-    return data_->internal::faces_set_mixin<D, D>::apply_if_dim_matches_(n, f);
-  }
-
-  namespace internal
-  {
-
-    // FIXME: Try to factor.
-
-    template <unsigned D>
-    template <typename UnaryFunction>
-    typename UnaryFunction::result_type
-    faces_set_mixin<D, D>::apply_if_dim_matches_(unsigned n,
-						 const UnaryFunction& f) const
-    {
-      // Ensure N and D are compatible.
-      mln_precondition(n <= D);
-      return n == D ?
-	f(faces_) :
-	faces_set_mixin<D - 1, D>::apply_if_dim_matches_(n, f);
-    }
-
-    template <unsigned N, unsigned D>
-    template <typename UnaryFunction>
-    typename UnaryFunction::result_type
-    faces_set_mixin<N, D>::apply_if_dim_matches_(unsigned n,
-						 const UnaryFunction& f) const
-    {
-      // Ensure N and D are compatible.
-      mln_precondition(n <= D);
-      return n == N ?
-	f(faces_) :
-	faces_set_mixin<N - 1, D>::apply_if_dim_matches_(n, f);
-    }
-
-    template <unsigned D>
-    template <typename UnaryFunction>
-    typename UnaryFunction::result_type
-    faces_set_mixin<0u, D>::apply_if_dim_matches_(unsigned n,
-						  const UnaryFunction& f) const
-    {
-      // If we reached this method, then N should be 0.
-      mln_precondition(n == 0);
-      return f(faces_);
-    }
-
-    template <typename UnaryFunction>
-    typename UnaryFunction::result_type
-    faces_set_mixin<0u, 0u>::apply_if_dim_matches_(unsigned n,
-						  const UnaryFunction& f) const
-    {
-      // If we reached this method, then N should be 0.
-      mln_precondition(n == 0);
-      return f(faces_);
-    }
-
-  } // end of namespace mln::internal
-
-# endif // ! MLN_INCLUDE_ONLY
-
-} // end of namespace mln
-
-
-#endif // ! MLN_CORE_COMPLEX_HH
diff --git a/milena/mln/core/complex_faces_iter.hh b/milena/mln/core/complex_faces_iter.hh
deleted file mode 100644
index ea86f6f..0000000
--- a/milena/mln/core/complex_faces_iter.hh
+++ /dev/null
@@ -1,262 +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.  
-// reasons why the executable file might be covered by the GNU General
-// Public License.
-
-#ifndef MLN_CORE_COMPLEX_FACES_ITER_HH
-# define MLN_CORE_COMPLEX_FACES_ITER_HH
-
-/// \file mln/core/complex_faces_iter.hh
-/// \brief Definition of forward and backward iterators on the n-faces
-/// of a complex.
-
-# include <mln/core/internal/complex_iter_base.hh>
-
-/* FIXME: Should we drop N from the signature of these iterators?
-   I.e., have N be dynamic?  Or better: provide other iterators where
-   N is dynamic?  */
-
-
-namespace mln
-{
-
-  /*--------------------------------.
-  | complex_faces_fwd_iter_<N, D>.  |
-  `--------------------------------*/
-
-  /// \brief Forward iterator on all the faces of a mln::complex<D>.
-  ///
-  /// \arg \p N The dimension of the face associated to this iterator.
-  /// \arg \p D The dimension of the complex this iterator belongs to.
-  template <unsigned N, unsigned D>
-  class complex_faces_fwd_iter_
-    : public internal::complex_iter_base_< any_face_handle<D>,
-					   complex_faces_fwd_iter_<N, D> >
-  {
-  public:
-    /// Type of associated face.
-    typedef any_face_handle<D> face;
-
-  private:
-    typedef complex_faces_fwd_iter_<N, D> self_;
-    typedef internal::complex_iter_base_< face, self_ > super_;
-
-  public:
-    using super_::is_valid;
-    using super_::invalidate;
-
-  public:
-    /// Construction and assignment.
-    /// \{
-    complex_faces_fwd_iter_();
-    // FIXME: See comment in internal::complex_iter_base_'s default ctor
-    complex_faces_fwd_iter_(complex<D>& c);
-    /// \}
-
-    /// Manipulation.
-    /// \{
-    /// Test if the iterator is valid.
-    void start();
-    /// Go to the next point.
-    void next_();
-    /// \}
-
-  private:
-    using super_::face_;
-  };
-
-
-  /*--------------------------------.
-  | complex_faces_bkd_iter_<N, D>.  |
-  `--------------------------------*/
-
-  /// \brief Backward iterator on all the faces of a mln::complex<D>.
-  ///
-  /// \arg \p N The dimension of the face associated to this iterator.
-  /// \arg \p D The dimension of the complex this iterator belongs to.
-  template <unsigned N, unsigned D>
-  class complex_faces_bkd_iter_
-    : public internal::complex_iter_base_< any_face_handle<D>,
-					   complex_faces_bkd_iter_<N, D> >
-  {
-  public:
-    /// Type of associated face.
-    typedef any_face_handle<D> face;
-
-  private:
-    typedef complex_faces_bkd_iter_<N, D> self_;
-    typedef internal::complex_iter_base_< face, self_ > super_;
-
-  public:
-    using super_::is_valid;
-    using super_::invalidate;
-
-  public:
-    /// Construction and assignment.
-    /// \{
-    complex_faces_bkd_iter_();
-    // FIXME: See comment in internal::complex_iter_base_'s default ctor
-    complex_faces_bkd_iter_(complex<D>& c);
-    /// \}
-
-    /// Manipulation.
-    /// \{
-    /// Start an iteration.
-    void start();
-    /// Go to the next point.
-    void next_();
-    /// \}
-
-  private:
-    using super_::face_;
-  };
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-  /*--------------------------------.
-  | complex_faces_fwd_iter_<N, D>.  |
-  `--------------------------------*/
-
-  template <unsigned N, unsigned D>
-  inline
-  complex_faces_fwd_iter_<N, D>::complex_faces_fwd_iter_()
-    : super_()
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-    face_.set_n(N);
-    mln_postcondition(!is_valid());
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  complex_faces_fwd_iter_<N, D>::complex_faces_fwd_iter_(complex<D>& c)
-    : super_(c)
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-    face_.set_n(N);
-    mln_postcondition(!is_valid());
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  void 
-  complex_faces_fwd_iter_<N, D>::start()
-  {
-    face_.set_face_id(0u);
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  void 
-  complex_faces_fwd_iter_<N, D>::next_()
-  {
-    if (is_valid())
-      {
-	unsigned face_id = face_.face_id();
-	if (face_id + 1 < face_.cplx().template nfaces<N>())
-	  /* FIXME: Provide accessor any_face_handle::face_id()
-	     returning a mutable reference?  This way, we could just
-	     write
-	 
-	       ++face_.face_id();
-	     
-	     instead of the following.
-
-	     Or add {inc,add}_face_id() services.  */
-	  face_.set_face_id(face_id + 1);
-	else
-	  invalidate();
-      }
-  }
-
-
-  /*--------------------------------.
-  | complex_faces_bkd_iter_<N, D>.  |
-  `--------------------------------*/
-
-  template <unsigned N, unsigned D>
-  inline
-  complex_faces_bkd_iter_<N, D>::complex_faces_bkd_iter_()
-    : super_()
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-    face_.set_n(N);
-    mln_postcondition(!is_valid());
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  complex_faces_bkd_iter_<N, D>::complex_faces_bkd_iter_(complex<D>& c)
-    : super_(c)
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-    face_.set_n(N);
-    mln_postcondition(!is_valid());
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  void 
-  complex_faces_bkd_iter_<N, D>::start()
-  {
-    face_.set_face_id(face_.cplx().template nfaces<N>() - 1);
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  void 
-  complex_faces_bkd_iter_<N, D>::next_()
-  {
-    if (is_valid())
-      {
-	unsigned face_id = face_.face_id();
-	if (face_id > 0)
-	  /* FIXME: Provide accessor any_face_handle::face_id()
-	     returning a mutable reference?  This way, we could just
-	     write
-	 
-	       ++face_.face_id();
-	     
-	     instead of the following.
-
-	     Or add {inc,add}_face_id() services.  */
-	  face_.set_face_id(face_id - 1);
-	else
-	  invalidate();
-      }
-  }
-
-# endif // ! MLN_INCLUDE_ONLY
-
-} // end of mln
-
-
-#endif // ! MLN_CORE_COMPLEX_FACES_ITER_HH
diff --git a/milena/mln/core/complex_iter.hh b/milena/mln/core/complex_iter.hh
deleted file mode 100644
index 2a486be..0000000
--- a/milena/mln/core/complex_iter.hh
+++ /dev/null
@@ -1,270 +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.  
-// reasons why the executable file might be covered by the GNU General
-// Public License.
-
-#ifndef MLN_CORE_COMPLEX_ITER_HH
-# define MLN_CORE_COMPLEX_ITER_HH
-
-/// \file mln/core/complex_iter.hh
-/// \brief Definition of forward and backward iterators on complexes.
-
-# include <mln/core/internal/complex_iter_base.hh>
-
-// FIXME: Factor a bit more? (Using complex_iter_base_.)
-
-
-namespace mln
-{
-
-  // Forward declaration.
-  template <unsigned D> class complex;
-
-  /*-----------------------.
-  | complex_fwd_iter_<D>.  |
-  `-----------------------*/
-
-  /// \brief Forward iterator on all the faces of a mln::complex<D>.
-  ///
-  /// \arg \p D The dimension of the complex this iterator belongs to.
-  template <unsigned D>
-  class complex_fwd_iter_
-    : public internal::complex_iter_base_< any_face_handle<D>,
-					   complex_fwd_iter_<D> >
-  {
-  public:
-    /// Type of associated face.
-    typedef any_face_handle<D> face;
-
-  private:
-    typedef complex_fwd_iter_<D> self_;
-    typedef internal::complex_iter_base_< face, self_ > super_;
-
-  public:
-    using super_::is_valid;
-    using super_::invalidate;
-
-  public:
-    /// Construction and assignment.
-    /// \{
-    complex_fwd_iter_();
-    // FIXME: See comment in internal::complex_iter_base_'s default ctor
-    complex_fwd_iter_(complex<D>& c);
-    /// \}
-
-    /// Manipulation.
-    /// \{
-    /// Test if the iterator is valid.
-    void start();
-    /// Go to the next point.
-    void next_();
-    /// \}
-
-  private:
-    using super_::face_;
-  };
-
-
-  /*-----------------------.
-  | complex_bkd_iter_<D>.  |
-  `-----------------------*/
-
-  /// \brief Backward iterator on all the faces of a mln::complex<D>.
-  ///
-  /// \arg \p D The dimension of the complex this iterator belongs to.
-  template <unsigned D>
-  class complex_bkd_iter_
-    : public internal::complex_iter_base_< any_face_handle<D>,
-					   complex_bkd_iter_<D> >
-  {
-  public:
-    /// Type of associated face.
-    typedef any_face_handle<D> face;
-
-  private:
-    typedef complex_bkd_iter_<D> self_;
-    typedef internal::complex_iter_base_< face, self_ > super_;
-
-  public:
-    using super_::is_valid;
-    using super_::invalidate;
-
-  public:
-    /// Construction and assignment.
-    /// \{
-    complex_bkd_iter_();
-    // FIXME: See comment in internal::complex_iter_base_'s default ctor
-    complex_bkd_iter_(complex<D>& c);
-    /// \}
-
-    /// Manipulation.
-    /// \{
-    /// Start an iteration.
-    void start();
-    /// Go to the next point.
-    void next_();
-    /// \}
-
-  private:
-    using super_::face_;
-  };
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-  /*-----------------------.
-  | complex_fwd_iter_<D>.  |
-  `-----------------------*/
-
-  template <unsigned D>
-  inline
-  complex_fwd_iter_<D>::complex_fwd_iter_()
-    : super_()
-  {
-  }
-
-  template <unsigned D>
-  inline
-  complex_fwd_iter_<D>::complex_fwd_iter_(complex<D>& c)
-    : super_(c)
-  {
-    set_cplx(c);
-    mln_postcondition(!is_valid());
-  }
-
-  template <unsigned D>
-  inline
-  void 
-  complex_fwd_iter_<D>::start()
-  {
-    face_.set_n(0u);
-    face_.set_face_id(0u);
-  }
-
-  template <unsigned D>
-  inline
-  void 
-  complex_fwd_iter_<D>::next_()
-  {
-    if (is_valid())
-      {
-	unsigned n = face_.n();
-	unsigned face_id = face_.face_id();
-
-	if (face_id + 1 < face_.cplx().nfaces(n))
-	  /* FIXME: Provide accessor any_face_handle::face_id() returning
-	     a mutable reference?  This way, we could just write
-	 
-	       ++face_.face_id();
-	     
-	     instead of the following.
-
-	     Or add {inc,add}_face_id() services.  */
-	  face_.set_face_id(face_id + 1);
-	else
-	  // Start to iterate on the faces of the next dimension if
-	  // possible.
-	  if (n <= D)
-	    {
-	      // FIXME: Same remark as above.
-	      face_.set_n(n + 1);
-	      face_.set_face_id(0u);
-	    }
-	  else
-	    invalidate();
-      }
-  }
-
-
-  /*-----------------------.
-  | complex_bkd_iter_<D>.  |
-  `-----------------------*/
-
-  template <unsigned D>
-  inline
-  complex_bkd_iter_<D>::complex_bkd_iter_()
-    : super_()
-  {
-  }
-
-  template <unsigned D>
-  inline
-  complex_bkd_iter_<D>::complex_bkd_iter_(complex<D>& c)
-    : super_(c)
-  {
-    set_cplx(c);
-    mln_postcondition(!is_valid());
-  }
-
-  template <unsigned D>
-  inline
-  void 
-  complex_bkd_iter_<D>::start()
-  {
-    face_.set_n(D);
-    face_.set_face_id(face_.cplx().template nfaces<D>() - 1);
-  }
-
-  template <unsigned D>
-  inline
-  void 
-  complex_bkd_iter_<D>::next_()
-  {
-    if (is_valid())
-      {
-	unsigned n = face_.n();
-	unsigned face_id = face_.face_id();
-
-	if (face_id > 0)
-	  /* FIXME: Provide accessor any_face_handle::face_id() returning
-	     a mutable reference?  This way, we could just write
-	 
-	       ++face_.face_id();
-	     
-	     instead of the following.
-
-	     Or add {inc,add}_face_id() services.  */
-	  face_.set_face_id(face_id - 1);
-	else
-	  // Start to iterate on the faces of the previous dimension
-	  // if it exists.
-	  if (n > 0)
-	    {
-	      // FIXME: Same remark as above.
-	      face_.set_n(n - 1);
-	      face_.set_face_id(face_.cplx().nfaces(n - 1) - 1);
-	    }
-	  else
-	    invalidate();
-      }
-  }
-
-# endif // ! MLN_INCLUDE_ONLY
-
-} // end of mln
-
-
-#endif // ! MLN_CORE_COMPLEX_ITER_HH
diff --git a/milena/mln/core/face.hh b/milena/mln/core/face.hh
deleted file mode 100644
index 4692d65..0000000
--- a/milena/mln/core/face.hh
+++ /dev/null
@@ -1,729 +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.
-// reasons why the executable file might be covered by the GNU General
-// Public License.
-
-#ifndef MLN_CORE_FACE_HH
-# define MLN_CORE_FACE_HH
-
-/// \file mln/core/face.hh
-/// \brief Face of a complex.
-
-#include <limits>
-
-#include <vector>
-
-#include <mln/core/contract.hh>
-
-/* FIXME: Suggestions:
-
-   - rename `face' as `face_data', and move it into complex.hh or its
-     own file;
-   - rename `face_handle' as `face', and move it to its own file;
-   - rename `any_face_handle' as `any_face', and move it to its own file.
-
-   Anyway, whatever the decision, splitting `face', `face_handle' and
-   `any_face_handle' seems to be sound.
-
-   (And what about `faces_set'? Should we move it to its own file as
-   well?)  */
-
-namespace mln
-{
-
-  // Forward declarations (external).
-  template <unsigned D> class complex;
-  namespace internal
-  {
-    template <unsigned N, unsigned D> struct lower_dim_faces_set_mixin;
-    template <unsigned N, unsigned D> struct higher_dim_faces_set_mixin;
-  }
-
-  // Forward declarations (internal).
-  template <unsigned N, unsigned D> class face_handle;
-  namespace internal
-  {
-    template <unsigned N, unsigned D> class lower_dim_faces_mixin;
-    template <unsigned N, unsigned D> class higher_dim_faces_mixin;
-  }
-
-
-  /*-------.
-  | Face.  |
-  `-------*/
-
-  /// \p N-face of a \p D-complex.
-  template <unsigned N, unsigned D> class face;
-
-
-  // Specialization for the faces of highest dimension (\p D).
-  template <unsigned D>
-  class face<D, D> : public internal::lower_dim_faces_mixin<D, D>
-  {
-  };
-
-  // Specialization for the faces of intermediate dimension (greater
-  // than 0, lower than \p D).
-  template <unsigned N, unsigned D>
-  class face : public internal::lower_dim_faces_mixin<N, D>,
-	       public internal::higher_dim_faces_mixin<N, D>
-  {
-  };
-
-  // Specialization for the faces of lowest dimension (0).
-  template <unsigned D>
-  class face<0u, D> : public internal::higher_dim_faces_mixin<0u, D>
-  {
-  };
-
-  // Specialization for the case of a 0-complex.
-  template <>
-  class face<0u, 0u>
-  {
-  };
-
-
-  namespace internal
-  {
-
-    /// Factored implementation of faces.
-    /// \{
-    template <unsigned N, unsigned D>
-    class lower_dim_faces_mixin
-    {
-    public:
-      void connect_lower_dim_face (const face_handle<N - 1, D>& f);
-    private:
-      friend class mln::internal::lower_dim_faces_set_mixin<N, D>;
-      std::vector< face_handle<N - 1, D> > lower_dim_faces_;
-    };  
-
-    template <unsigned N, unsigned D>
-    class higher_dim_faces_mixin
-    {
-    public:
-      void connect_higher_dim_face(const face_handle<N + 1, D>& f);
-    private:
-      friend class mln::internal::higher_dim_faces_set_mixin<N, D>;      
-      std::vector< face_handle<N + 1, D> > higher_dim_faces_;
-    };
-    /// \}
-
-  } // end of namespace mln::internal
-
-
-
-  /*--------------.
-  | Face handle.  |
-  `--------------*/
-
-  // Face handle in a complex.
-  template <unsigned N, unsigned D>
-  struct face_handle
-  {
-    // The type of the complex this handle points to.
-    typedef complex<D> complex_type;
-
-    /// Build a non-initialized face handle.
-    face_handle();
-    /// Build a face handle from \a complex and \a face_id.
-    face_handle(complex<D>& complex, unsigned face_id);
-
-    /// Copy and assignment.
-    /// \{
-    face_handle(const face_handle<N, D>& rhs);
-    face_handle<N, D>& operator=(const face_handle<N, D>& rhs);
-    /// \}
-
-    /// Is this handle valid?
-    bool is_valid() const;
-    /// Invalidate this handle.
-    void invalidate();
-
-    /// Accessors.
-    /// \{
-    /// Return the complex the face belongs to.
-    complex<D>& cplx() const;
-    /// Return the id of the face.
-    // FIXME: Rename as `id'?
-    unsigned face_id() const;
-
-    /// Set the complex the face belongs to.
-    void set_cplx(complex<D>& cplx);
-    /// Return the dimension of the face.
-    // FIXME: Rename as `dim'?
-    unsigned n() const;
-    /// Set the id of the face.
-    void set_face_id(unsigned face_id);
-
-    /// Return the mln::face pointed by this handle.
-    face<N, D>& to_face() const;
-    /// \}
-
-  private:
-    /// \brief The complex the face belongs to.
-    ///
-    /// A const face_handle can be used to modify a complex.
-    mutable complex<D>* cplx_;
-    /// \brief The id of the face.
-    // FIXME: Rename as `id_'?
-    unsigned face_id_;
-  };
-
-
-  /// Create a handle for \p N-face of a \p D-complex.
-  template <unsigned N, unsigned D>
-  face_handle<N, D>
-  make_face_handle(const complex<D>& c, unsigned face_id);
-
-
-  /// Comparison of two instances of mln::face_handle.
-  /// \{
-  /// \brief Is \a lhs equal to \a rhs?
-  ///
-  /// \pre Arguments \a lhs and \a rhs must belong to the same
-  /// mln::complex.
-  template <unsigned N, unsigned D>
-  bool
-  operator==(const face_handle<N, D>& lhs, const face_handle<N, D>& rhs);
-
-  /// \brief Is \a lhs ``less'' than \a rhs?
-  ///
-  /// This comparison is required by algorithms sorting face handles.
-  ///
-  /// \pre Arguments \a lhs and \a rhs must belong to the same
-  /// mln::complex.
-  template <unsigned N, unsigned D>
-  bool
-  operator< (const face_handle<N, D>& lhs, const face_handle<N, D>& rhs);
-  /// \}
-
-
-  /*----------------------.
-  | Set of face handles.  |
-  `----------------------*/
-
-  /// \brief Set of face handles of dimension \p N.
-  template <unsigned N, unsigned D>
-  class faces_set
-  {
-  public:
-    void add(const face_handle<N, D>& f);
-
-    /// \brief Accessors.
-    ///
-    /// Return the set of handles.
-    /// \{
-    const std::vector< face_handle<N, D> >& faces() const;
-    /// \}
-
-  private:
-    friend class mln::complex<D>;
-
-    // FIXME: Rename this as `handles_'?
-    std::vector< face_handle<N, D> > faces_;
-  };
-
-
-  /// Construction helpers for mln::faces_set.
-  /// \{
-  template <unsigned N, unsigned D>
-  faces_set<N, D>
-  operator+(const face_handle<N, D>& f1, const face_handle<N, D>& f2);
-
-  template <unsigned N, unsigned D>
-  faces_set<N, D>
-  operator+(const faces_set<N, D>& fs, const face_handle<N, D>& f);
-  /// \}
-
-
-  /*----------------------.
-  | ``Any-face'' handle.  |
-  `----------------------*/
-
-  // Face handle in a complex, where the dimension is dynamic.
-  template <unsigned D>
-  struct any_face_handle
-  {
-    // The type of the complex this handle points to.
-    typedef complex<D> complex_type;
-
-    /// Build a non-initialized face handle.
-    any_face_handle();
-    /// Build a face handle from \a complex and \a face_id.
-    any_face_handle(complex<D>& complex, unsigned n, unsigned face_id);
-
-    /// Build a face handle from a face_handle.
-    template <unsigned N>
-    any_face_handle(const face_handle<N, D>& f);
-
-    /// Copy and assignment.
-    /// \{
-    any_face_handle(const any_face_handle<D>& rhs);
-    any_face_handle<D>& operator=(const any_face_handle<D>& rhs);
-    /// \}
-
-    /// Is this handle valid?
-    bool is_valid() const;
-    /// Invalidate this handle.
-    void invalidate();
-
-    /// Accessors.
-    /// \{
-    /// Return the complex the face belongs to.
-    complex<D>& cplx() const;
-    /// Return the dimension of the face.
-    // FIXME: Rename as `dim'?
-    unsigned n() const;
-    /// Return the id of the face.
-    // FIXME: Rename as `id'?
-    unsigned face_id() const;
-
-    /// Set the complex the face belongs to.
-    void set_cplx(complex<D>& cplx);
-    /// Set the dimension of the face.
-    void set_n(unsigned n);
-    /// Set the id of the face.
-    void set_face_id(unsigned face_id);
-
-    /// Return the mln::face pointed by this handle.
-    template <unsigned N>
-    face<N, D>& to_face() const;
-    /// \}
-
-  private:
-    /// \brief The complex the face belongs to.
-    ///
-    /// A const any_face_handle can be used to modify a complex.
-    mutable complex<D>* cplx_;
-    /// The dimension of the face.
-    // FIXME: Rename as `dim_'?
-    unsigned n_;
-    /// \brief The id of the face.
-    // FIXME: Rename as `id_'?
-    unsigned face_id_;
-  };
-
-
-  /// Comparison of two instances of mln::any_face_handle.
-  /// \{
-  /// \brief Is \a lhs equal to \a rhs?
-  ///
-  /// \pre Arguments \a lhs and \a rhs must belong to the same
-  /// mln::complex.
-  template <unsigned D>
-  bool
-  operator==(const any_face_handle<D>& lhs, const any_face_handle<D>& rhs);
-
-  /// \brief Is \a lhs ``less'' than \a rhs?
-  ///
-  /// This comparison is required by algorithms sorting face handles.
-  ///
-  /// \pre Arguments \a lhs and \a rhs must belong to the same
-  /// mln::complex.
-  /// \pre Arguments \a lhs and \a rhs must have the same dimension.
-  template <unsigned D>
-  bool
-  operator< (const any_face_handle<D>& lhs, const any_face_handle<D>& rhs);
-  /// \}
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-  /*--------.
-  | Faces.  |
-  `--------*/
-
-  namespace internal
-  {
-    template <unsigned N, unsigned D>
-    inline
-    void
-    lower_dim_faces_mixin<N, D>::connect_lower_dim_face(const face_handle<N - 1, D>& f)
-    {
-      lower_dim_faces_.push_back(f);
-    }
-
-    template <unsigned N, unsigned D>
-    inline
-    void
-    higher_dim_faces_mixin<N, D>::connect_higher_dim_face(const face_handle<N + 1, D>& f)
-    {
-      higher_dim_faces_.push_back(f);
-    }
-
-  } // end of namespace mln::internal
-
-
-  /*--------------.
-  | Face handle.  |
-  `--------------*/
-
-  template <unsigned N, unsigned D>
-  inline
-  face_handle<N, D>::face_handle()
-    : cplx_(0), face_id_(std::numeric_limits<unsigned>::max())
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  face_handle<N, D>::face_handle(complex<D>& c, unsigned face_id)
-    : cplx_(&c), face_id_(face_id)
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  face_handle<N, D>::face_handle(const face_handle<N, D>& rhs)
-    : cplx_(rhs.cplx_), face_id_(rhs.face_id_)
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  face_handle<N, D>&
-  face_handle<N, D>::operator=(const face_handle<N, D>& rhs)
-  {
-    if (&rhs != this)
-      {
-	cplx_ = rhs.cplx_;
-	face_id_ = rhs.face_id_;
-      }
-    return *this;
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  bool
-  face_handle<N, D>::is_valid() const
-  {
-    return cplx_ != 0 && face_id_ < cplx_->template nfaces<N>();
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  void
-  face_handle<N, D>::invalidate()
-  {
-    set_face_id(std::numeric_limits<unsigned>::max());
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  complex<D>&
-  face_handle<N, D>::cplx() const
-  {
-    mln_precondition(cplx_);
-    return *cplx_;
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  unsigned
-  face_handle<N, D>::n() const
-  {
-    return N;
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  unsigned
-  face_handle<N, D>::face_id() const
-  {
-    return face_id_;
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  void
-  face_handle<N, D>::set_cplx(complex<D>& cplx)
-  {
-    cplx_ = &cplx;
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  void
-  face_handle<N, D>::set_face_id(unsigned face_id)
-  {
-    face_id_ = face_id;
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  face<N, D>&
-  face_handle<N, D>::to_face() const
-  {
-    mln_precondition(is_valid());
-    return cplx_->template face_<N>(face_id_);
-  }
-
-
-  template <unsigned N, unsigned D>
-  inline
-  face_handle<N, D>
-  make_face_handle(const complex<D>& c, unsigned face_id)
-  {
-    return face_handle<N, D>(&c, face_id);
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  bool
-  operator==(const face_handle<N, D>& lhs, const face_handle<N, D>& rhs)
-  {
-    // Ensure LHS and RHS belong to the same complex.
-    mln_precondition(&lhs.face.cplx() == &rhs.face.cplx());
-    return lhs.face().id() == rhs.face().id();
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  bool
-  operator< (const face_handle<N, D>& lhs, const face_handle<N, D>& rhs)
-  {
-    // Ensure LHS and RHS belong to the same complex.
-    mln_precondition(&lhs.face.cplx() == &rhs.face.cplx());
-    return lhs.face().id() < rhs.face().id();
-  }
-
-
-  /*---------------.
-  | Set of faces.  |
-  `---------------*/
-
-  template <unsigned N, unsigned D>
-  inline
-  void
-  faces_set<N, D>::add(const face_handle<N, D>& f)
-  {
-    // Check consistency.
-    if (!faces_.empty())
-      mln_precondition(&faces_.front().cplx() == &f.cplx());
-    faces_.push_back(f);
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  const std::vector< face_handle<N, D> >&
-  faces_set<N, D>::faces() const
-  {
-    return faces_;
-  }
-
-
-  template <unsigned N, unsigned D>
-  inline
-  faces_set<N, D>
-  operator+(const face_handle<N, D>& f1, const face_handle<N, D>& f2)
-  {
-    faces_set<N, D> fs;
-    fs.add(f1);
-    fs.add(f2);
-    return fs;
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  faces_set<N, D>
-  operator+(const faces_set<N, D>& fs, const face_handle<N, D>& f)
-  {
-    faces_set<N, D> fs2(fs);
-    fs2.add(f);
-    return fs2;
-  }
-
-
-  /*----------------------.
-  | ``Any-face'' handle.  |
-  `----------------------*/
-
-  template <unsigned D>
-  inline
-  any_face_handle<D>::any_face_handle()
-    : cplx_(0),
-      n_(std::numeric_limits<unsigned>::max()),
-      face_id_(std::numeric_limits<unsigned>::max())
-  {
-  }
-
-  template <unsigned D>
-  inline
-  any_face_handle<D>::any_face_handle(complex<D>& c, unsigned n,
-				      unsigned face_id)
-    : cplx_(&c), n_(n), face_id_(face_id)
-  {
-    // Ensure N is compatible with D.
-    mln_precondition(n <= D);
-  }
-
-  template <unsigned D>
-  template <unsigned N>
-  inline
-  any_face_handle<D>::any_face_handle(const face_handle<N, D>& f)
-    : cplx_(&f.cplx()), n_(N), face_id_(f.face_id())
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-    
-  }
-
-  template <unsigned D>
-  inline
-  any_face_handle<D>::any_face_handle(const any_face_handle<D>& rhs)
-    : cplx_(rhs.cplx_), n_(rhs.n_), face_id_(rhs.face_id_)
-  {
-  }
-
-  template <unsigned D>
-  inline
-  any_face_handle<D>&
-  any_face_handle<D>::operator=(const any_face_handle<D>& rhs)
-  {
-    if (&rhs != this)
-      {
-	cplx_ = rhs.cplx_;
-	n_ = rhs.n_;
-	face_id_ = rhs.face_id_;
-      }
-    return *this;
-  }
-
-  template <unsigned D>
-  inline
-  bool
-  any_face_handle<D>::is_valid() const
-  {
-    return cplx_ != 0 && n_ <= D && face_id_ < cplx_->nfaces(n_);
-  }
-
-  template <unsigned D>
-  inline
-  void
-  any_face_handle<D>::invalidate()
-  {
-    set_n(std::numeric_limits<unsigned>::max());
-    set_face_id(std::numeric_limits<unsigned>::max());
-  }
-
-  template <unsigned D>
-  inline
-  complex<D>&
-  any_face_handle<D>::cplx() const
-  {
-    mln_precondition(cplx_);
-    return *cplx_;
-  }
-
-  template <unsigned D>
-  inline
-  unsigned
-  any_face_handle<D>::n() const
-  {
-    return n_;
-  }
-
-  template <unsigned D>
-  inline
-  unsigned
-  any_face_handle<D>::face_id() const
-  {
-    return face_id_;
-  }
-
-  template <unsigned D>
-  inline
-  void
-  any_face_handle<D>::set_cplx(complex<D>& cplx)
-  {
-    cplx_ = &cplx;
-  }
-
-  template <unsigned D>
-  inline
-  void
-  any_face_handle<D>::set_n(unsigned n)
-  {
-    n_ = n;
-  }
-
-  template <unsigned D>
-  inline
-  void
-  any_face_handle<D>::set_face_id(unsigned face_id)
-  {
-    face_id_ = face_id;
-  }
-
-  template <unsigned D>
-  template <unsigned N>
-  inline
-  face<N, D>&
-  any_face_handle<D>::to_face() const
-  {
-    mln_precondition(n_ == N);
-    mln_precondition(is_valid());
-    return cplx_->template face_<N>(face_id_);
-  }
-
-
-  template <unsigned D>
-  inline
-  bool
-  operator==(const any_face_handle<D>& lhs, const any_face_handle<D>& rhs)
-  {
-    // Ensure LHS and RHS belong to the same complex.
-    mln_precondition(&lhs.face.cplx() == &rhs.face.cplx());
-    return
-      lhs.face().n() == rhs.face().n() &&
-      lhs.face().id() == rhs.face().id();
-  }
-
-  template <unsigned D>
-  inline
-  bool
-  operator< (const any_face_handle<D>& lhs, const any_face_handle<D>& rhs)
-  {
-    // Ensure LHS and RHS belong to the same complex.
-    mln_precondition(&lhs.face.cplx() == &rhs.face.cplx());
-    // Ensure LHS and RHS have the same dimension.
-    mln_precondition(lhs.face().n() == rhs.face().n());
-    return lhs.face().id() < rhs.face().id();
-  }
-
-# endif // ! MLN_INCLUDE_ONLY
-
-} // end of namespace mln
-
-
-#endif // ! MLN_CORE_FACE_HH
diff --git a/milena/mln/core/faces_iter.hh b/milena/mln/core/faces_iter.hh
deleted file mode 100644
index 6194deb..0000000
--- a/milena/mln/core/faces_iter.hh
+++ /dev/null
@@ -1,247 +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.  
-// reasons why the executable file might be covered by the GNU General
-// Public License.
-
-#ifndef MLN_CORE_FACES_ITER_HH
-# define MLN_CORE_FACES_ITER_HH
-
-/// \file mln/core/faces_iter.hh
-/// \brief Definition of forward and backward iterators on the n-faces
-/// of a complex.
-
-# include <mln/core/internal/complex_iter_base.hh>
-
-namespace mln
-{
-
-  /*------------------------.
-  | faces_fwd_iter_<N, D>.  |
-  `------------------------*/
-
-  /// \brief Forward iterator on all the faces of a mln::complex<D>.
-  ///
-  /// \arg \p N The dimension of the face associated to this iterator.
-  /// \arg \p D The dimension of the complex this iterator belongs to.
-  template <unsigned N, unsigned D>
-  class faces_fwd_iter_
-    : public internal::complex_iter_base_< face_handle<N, D>,
-					   faces_fwd_iter_<N, D> >
-  {
-  public:
-    /// Type of associated face.
-    typedef face_handle<N, D> face;
-
-  private:
-    typedef faces_fwd_iter_<N, D> self_;
-    typedef internal::complex_iter_base_< face, self_ > super_;
-
-  public:
-    using super_::is_valid;
-    using super_::invalidate;
-
-  public:
-    /// Construction and assignment.
-    /// \{
-    faces_fwd_iter_();
-    // FIXME: See comment in internal::complex_iter_base_'s default ctor
-    faces_fwd_iter_(complex<D>& c);
-    /// \}
-
-    /// Manipulation.
-    /// \{
-    /// Test if the iterator is valid.
-    void start();
-    /// Go to the next point.
-    void next_();
-    /// \}
-
-  private:
-    using super_::face_;
-  };
-
-
-  /*------------------------.
-  | faces_bkd_iter_<N, D>.  |
-  `------------------------*/
-
-  /// \brief Backward iterator on all the faces of a mln::complex<D>.
-  ///
-  /// \arg \p N The dimension of the face associated to this iterator.
-  /// \arg \p D The dimension of the complex this iterator belongs to.
-  template <unsigned N, unsigned D>
-  class faces_bkd_iter_
-    : public internal::complex_iter_base_< face_handle<N, D>,
-					   faces_bkd_iter_<N, D> >
-  {
-  public:
-    /// Type of associated face.
-    typedef face_handle<N, D> face;
-
-  private:
-    typedef faces_bkd_iter_<N, D> self_;
-    typedef internal::complex_iter_base_< face, self_ > super_;
-
-  public:
-    using super_::is_valid;
-    using super_::invalidate;
-
-  public:
-    /// Construction and assignment.
-    /// \{
-    faces_bkd_iter_();
-    // FIXME: See comment in internal::complex_iter_base_'s default ctor
-    faces_bkd_iter_(complex<D>& c);
-    /// \}
-
-    /// Manipulation.
-    /// \{
-    /// Start an iteration.
-    void start();
-    /// Go to the next point.
-    void next_();
-    /// \}
-
-  private:
-    using super_::face_;
-  };
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-  /*------------------------.
-  | faces_fwd_iter_<N, D>.  |
-  `------------------------*/
-
-  template <unsigned N, unsigned D>
-  inline
-  faces_fwd_iter_<N, D>::faces_fwd_iter_()
-    : super_()
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-    mln_postcondition(!is_valid());
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  faces_fwd_iter_<N, D>::faces_fwd_iter_(complex<D>& c)
-    : super_(c)
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-    mln_postcondition(!is_valid());
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  void 
-  faces_fwd_iter_<N, D>::start()
-  {
-    face_.set_face_id(0u);
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  void 
-  faces_fwd_iter_<N, D>::next_()
-  {
-    if (is_valid())
-      {
-	unsigned face_id = face_.face_id();
-	if (face_id + 1 < face_.cplx().template nfaces<N>())
-	  /* FIXME: Provide accessor face_handle::n() returning
-	     a mutable reference?  This way, we could just write
-	 
-	       ++face_.face_id();
-	     
-	     instead of the following.  */
-	  face_.set_face_id(face_id + 1);
-	else
-	  invalidate();
-      }
-  }
-
-
-  /*------------------------.
-  | faces_bkd_iter_<N, D>.  |
-  `------------------------*/
-
-  template <unsigned N, unsigned D>
-  inline
-  faces_bkd_iter_<N, D>::faces_bkd_iter_()
-    : super_()
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-    mln_postcondition(!is_valid());
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  faces_bkd_iter_<N, D>::faces_bkd_iter_(complex<D>& c)
-    : super_(c)
-  {
-    // Ensure N is compatible with D.
-    metal::bool_< N <= D >::check();
-    mln_postcondition(!is_valid());
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  void 
-  faces_bkd_iter_<N, D>::start()
-  {
-    face_.set_face_id(face_.cplx().template nfaces<N>() - 1);
-  }
-
-  template <unsigned N, unsigned D>
-  inline
-  void 
-  faces_bkd_iter_<N, D>::next_()
-  {
-    if (is_valid())
-      {
-	unsigned face_id = face_.face_id();
-	if (face_id > 0)
-	  /* FIXME: Provide accessor face_handle::n() returning
-	     a mutable reference?  This way, we could just write
-	 
-	       ++face_.face_id();
-	     
-	     instead of the following.  */
-	  face_.set_face_id(face_id - 1);
-	else
-	  invalidate();
-      }
-  }
-
-# endif // ! MLN_INCLUDE_ONLY
-
-} // end of mln
-
-
-#endif // ! MLN_CORE_FACES_ITER_HH
diff --git a/milena/mln/core/internal/complex_iter_base.hh b/milena/mln/core/internal/complex_iter_base.hh
deleted file mode 100644
index e2c747a..0000000
--- a/milena/mln/core/internal/complex_iter_base.hh
+++ /dev/null
@@ -1,202 +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.  
-// reasons why the executable file might be covered by the GNU General
-// Public License.
-
-#ifndef MLN_CORE_INTERNAL_COMPLEX_ITER_BASE_HH
-# define MLN_CORE_INTERNAL_COMPLEX_ITER_BASE_HH
-
-/// \file mln/core/internal/complex_iter_base.hh
-/// \brief Definition of an implementation (factoring) class for
-/// iterators on mln::complex.
-
-# include <limits>
-
-# include <mln/metal/equal.hh>
-
-# include <mln/core/concept/iterator.hh>
-# include <mln/core/complex.hh>
-
-namespace mln
-{
-
-  namespace internal
-  {
-    /// \brief Factoring class for iterators on mln::complex.
-    ///
-    /// \arg \p F The type of the face handle.
-    /// \arg \p E The type exact type of the iterator.
-    template <typename F, typename E>
-    class complex_iter_base_ : public Iterator<E>
-    {
-      typedef complex_iter_base_<F, E> self_;
-
-    public:
-      typedef F face;
-      // FIXME: Maybe we could just get the dimension D of the face's
-      // complex, an define complex_type as mln::complex<D>?
-      typedef typename F::complex_type complex_type;
-
-      /// Construction and assignment.
-      /// \{
-      /* FIXME: Keep this non-const?  See a (big) comment about this in
-	 milena/tests/complex_image.cc.   */
-      complex_iter_base_();
-      complex_iter_base_(complex_type& c);
-      /// \}
-
-      /// Manipulation.
-      /// \{
-      /// Change the target complex.
-      // FIXME: Same comment as the ctor above.
-      void set_cplx(complex_type& c);
-
-      /// Test if the iterator is valid.
-      bool is_valid() const;
-      /// Invalidate the iterator.
-      void invalidate();
-      /// \}
-
-      /// Conversion and accessors.
-      /// \{
-      /// Reference to the corresponding face handle.
-      const face& to_face () const;
-      /// Convert the iterator into an face handle.
-      operator face() const;
-      /// \}
-
-    protected:
-      /// The face handle this iterator is pointing to.
-      face face_;
-    };
-
-
-    /* FIXME: This hand-made delegation is painful.  We should rely on
-       the general mechanism provided by Point_Site.  But then again, we
-       need to refine/adjust the interface of Point_Site w.r.t. the
-       mandatory conversions to points.  */
-    template <typename F, typename E>
-    inline
-    std::ostream&
-    operator<<(std::ostream& ostr, const complex_iter_base_<F, E>& p);
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-    template <typename F, typename E>
-    inline
-    complex_iter_base_<F, E>::complex_iter_base_()
-    {
-      // Ensure F and E are compatible.
-      mlc_equal(F, typename E::face)::check();
-
-      invalidate();
-    }
-
-    template <typename F, typename E>
-    inline
-    complex_iter_base_<F, E>::complex_iter_base_(complex_type& c)
-    {
-      // Ensure F and E are compatible.
-      mlc_equal(F, typename E::face)::check();
-
-      face_.set_cplx(c);
-      // Invalidate face_.
-      invalidate();
-    }
-
-    template <typename F, typename E>
-    inline
-    void
-    complex_iter_base_<F, E>::set_cplx(complex_type& c)
-    {
-      face_.set_cplx(c);
-      // Invalidate face_.
-      invalidate();
-    }
-
-    template <typename F, typename E>
-    inline
-    bool
-    complex_iter_base_<F, E>::is_valid() const
-    {
-      return face_.is_valid();
-    }
-
-    template <typename F, typename E>
-    inline
-    void
-    complex_iter_base_<F, E>::invalidate()
-    {
-      face_.invalidate();
-    }
-
-    template <typename F, typename E>
-    inline
-    const F&
-    complex_iter_base_<F, E>::to_face() const
-    {
-      return face_;
-    }
-
-    template <typename F, typename E>
-    inline
-    complex_iter_base_<F, E>::operator F() const
-    {
-      mln_precondition(is_valid());
-      return face_;
-    }
-
-
-    template <typename F, typename E>
-    inline
-    std::ostream&
-    operator<<(std::ostream& ostr, const complex_iter_base_<F, E>& p)
-    {
-    /* FIXME: We should use p.to_face() here, but as it lacks the
-       precondition the conversion operator has, so we use the latter.
-
-       We should
-       - rename `to_face' as `to_face_';
-       - write a new `to_face' routine checking the validity of the
-         iterator;
-       - have the conversion operator to face use this new `to_face'
-         routine;
-       - adjust former clients of `to_face'
-
-       This is a general remark that applies to all iterators of
-       Milena.  */
-      F f = p;
-      return ostr << "(dim = " << f.n() << ", id = " << f.face_id() << ')';
-    }
-
-  } // end of mln::internal
-
-# endif // ! MLN_INCLUDE_ONLY
-
-} // end of mln
-
-#endif // ! MLN_CORE_INTERNAL_COMPLEX_ITER_BASE_HH
diff --git a/milena/mln/topo/complex.hh b/milena/mln/topo/complex.hh
new file mode 100644
index 0000000..ae69dee
--- /dev/null
+++ b/milena/mln/topo/complex.hh
@@ -0,0 +1,857 @@
+// 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.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_TOPO_COMPLEX_HH
+# define MLN_TOPO_COMPLEX_HH
+
+/// \file mln/core/topo/complex.hh
+/// \brief Structures for general complexes.
+///
+/// A complex defines a topological space which can be used as a
+/// support for an image (i.e., as site sets).
+
+# include <cstddef>
+
+# include <limits>
+# include <iosfwd>
+
+# include <mln/metal/bool.hh>
+
+# include <mln/util/tracked_ptr.hh>
+
+# include <mln/topo/face.hh>
+
+# include <mln/topo/complex_iter.hh>
+# include <mln/topo/faces_iter.hh>
+# include <mln/topo/complex_faces_iter.hh>
+
+
+namespace mln
+{
+
+  namespace topo
+  {
+
+    // Forward declarations.
+    namespace internal
+    {
+      template <unsigned D>
+      struct complex_data;
+
+      template <unsigned N, unsigned D>
+      struct faces_set_mixin;
+    }
+    template <unsigned D> class complex_fwd_iter_;
+    template <unsigned D> class complex_bkd_iter_;
+    template <unsigned N, unsigned D> class faces_fwd_iter_;
+    template <unsigned N, unsigned D> class faces_bkd_iter_;
+
+
+    /*----------.
+    | Complex.  |
+    `----------*/
+
+    /// \brief General complex of dimension \p D.
+    template <unsigned D>
+    class complex
+    {
+    public:
+      /// Forward mln::Iterator type iterating on all faces.
+      typedef complex_fwd_iter_<D> fwd_citer;
+      /// Backward mln::Iterator type iterating on all faces.
+      typedef complex_bkd_iter_<D> bkd_citer;
+
+      /// Forward mln::Iterator type iterating on \p N-faces.
+      template <unsigned N>
+      struct fwd_fiter { typedef faces_fwd_iter_<N, D> ret; };
+      /// Backward mln::Iterator type iterating on \p N-faces.
+      template <unsigned N>
+      struct bkd_fiter { typedef faces_bkd_iter_<N, D> ret; };
+
+      /// Complex construction.
+      /// \{
+      /// Create a new \p D-complex.
+      complex();
+
+      /// \brief Add a 0-face to the complex.
+      face_handle<0u, D> add_face();
+
+      /// \brief Add a \p (N+1)-face to the complex (with \p N >= 0).
+      ///
+      /// \param adjacent_faces The (\p N-1)-faces adjacent to the new
+      /// \p N-face.
+      template <unsigned N>
+      face_handle<N + 1, D> add_face(const faces_set<N, D>& adjacent_faces);
+      /// \}
+
+      /// \brief Static manipulators.
+      ///
+      /// These methods use statically-known input.
+      /// \{
+      /// \brief Return the total number of faces, whatever their
+      /// dimension.
+      std::size_t nfaces() const;
+
+      /// \brief Return the number of \p N-faces.
+      template <unsigned N>
+      std::size_t nfaces() const;
+      /// \}
+
+      /// \brief Dynamic manipulators.
+      ///
+      /// These methods use input know as run time.
+      /// \{
+      /// \brief Return the number of \a n-faces.
+      ///
+      /// Warning, this function has a complexity linear in term of N,
+      /// since each faces_set is checked (the present implementation
+      /// does not provide a direct access to faces_set through a
+      /// dynamic value of the dimension).
+      std::size_t nfaces(unsigned n) const;
+      /// \}
+
+      /// Pretty-printing.
+      /// \{
+      /// Print the complex.
+      void print(std::ostream& ostr) const;
+      /// Print the faces of dimension \p N.
+      template <unsigned N>
+      void print_faces(std::ostream& ostr) const;
+      /// \}
+
+    private:
+      /// The actual data of the complex.
+      util::tracked_ptr< internal::complex_data<D> > data_;
+
+      template <unsigned D_>
+      friend bool operator==(const complex<D_>& lhs, const complex<D_>& rhs);
+
+      /// Accessors.
+      /// \{
+      template <unsigned N, unsigned D_> friend class face_handle;
+      template <unsigned D_> friend class any_face_handle;
+
+      template <unsigned N>
+      face<N, D>& face_(unsigned face_id);
+
+      template <unsigned N>
+      const face<N, D>& face_(unsigned face_id) const;
+      /// \}
+
+      /// Functional meta-manipulators.
+      /// \{
+      /* FIXME: Use something more constraining than the STL's
+	 UnaryFunction/BinaryFunction.  Use Function or Function_v2v?
+	 Or a new subclass of Function?  */
+
+      /* FIXME: Replace F and ACCU by a Milena accumulator?  */
+
+      /** \brief Apply a kind of static fold left operator to the
+	  implicit list of faces_set using a functor \a f and a value \a
+	  accu.
+
+	  Argument \a is called an "accumulator", but with a slightly
+	  different meaning than mln:accu members.
+
+	  We might want to use TypeLists or something similar, is they
+	  provide an explicit static fold left operator.  */
+      template <typename BinaryFunction, typename T>
+      T fold_left_(const BinaryFunction& f, const T& accu) const;
+
+      /// \brief Apply a functor \a f to this list of \a n-faces.
+      template <typename UnaryFunction>
+      typename UnaryFunction::result_type
+      apply_if_dim_matches_(unsigned n, const UnaryFunction& f) const;
+      /// \}
+
+      /// \brief connect two faces.
+      ///
+      /// \param f1 A face of dimension \p N
+      /// \param f2 A face of dimension \p N + 1
+      ///
+      /// \pre \p N must be lower or equal to \p D.
+      template <unsigned N>
+      void connect_(const face_handle<N, D>& f1,
+		    const face_handle<N + 1, D>& f2);
+    };
+
+
+    /// Compare two complexes for equality.
+    template <unsigned D>
+    bool
+    operator==(const complex<D>& lhs, const complex<D>& rhs);
+
+
+    /// Pretty print a complex.
+    template <unsigned D>
+    std::ostream&
+    operator<<(std::ostream& ostr, const complex<D>& c);
+
+
+    /*---------------.
+    | Complex data.  |
+    `---------------*/
+
+    namespace internal
+    {
+      // Forward declarations.
+      template <unsigned N, unsigned D>
+      struct faces_set_mixin;
+
+      /// \brief Complex data.
+      template <unsigned D>
+      struct complex_data : faces_set_mixin<D, D>
+      {
+	// Data is contained in super classes.
+      };
+
+    } // end of namespace mln::topo::internal
+
+
+    /*---------------------.
+    | Faces of a complex.  |
+    `---------------------*/
+
+    /// The sets of n-faces of a complex are recursively aggregated as
+    /// mixins.
+    namespace internal
+    {
+
+      // Forward declarations.
+      template <unsigned N, unsigned D> struct lower_dim_faces_set_mixin;
+      template <unsigned N, unsigned D> struct higher_dim_faces_set_mixin;
+
+      // -------------------------------------- //
+      // mln::topo::internal::faces_set_mixin.  //
+      // -------------------------------------- //
+
+      /// \brief Recursive mixins of set of faces.
+      /// \{
+      template <unsigned N, unsigned D> struct faces_set_mixin;
+
+      /// Faces of highest dimension (\p D).
+      template <unsigned D>
+      struct faces_set_mixin<D, D> : public faces_set_mixin<D - 1, D>,
+				     public lower_dim_faces_set_mixin<D, D>
+      {
+	std::vector< face<D, D> > faces_;
+
+	/// Pretty-printing.
+	/// \{
+	/// Print the faces of dimension \p D.
+	void print(std::ostream& ostr) const;
+	void print_rec_asc(std::ostream& ostr) const;
+	/// \}
+
+	/// Functional meta-manipulators.
+	/// \{
+	/// \brief Fold left.
+	/// \see mln::complex<D>::fold_left_.
+	template <typename BinaryFunction, typename T>
+	T fold_left_(const BinaryFunction& f, const T& accu) const;
+	/// \brief Apply a functor \a f to the list of faces if \a n == \p D.
+	/// \see mln::complex<D>::apply_if_dim_matches_.
+	template <typename UnaryFunction>
+	typename UnaryFunction::result_type
+	apply_if_dim_matches_(unsigned n, const UnaryFunction& f) const;
+	/// \}
+      };
+
+      /// Faces of intermediate dimension (greater than 0, lower than \p D).
+      template <unsigned N, unsigned D>
+      struct faces_set_mixin : public faces_set_mixin<N - 1, D>,
+			       public lower_dim_faces_set_mixin<N, D>,
+			       public higher_dim_faces_set_mixin<N, D>
+      {
+	std::vector< face<N, D> > faces_;
+
+	/// Pretty-printing.
+	/// \{
+	/// Print the faces of dimension \p N.
+	void print(std::ostream& ostr) const;
+	/// Recursively print the faces of dimensions 0 to \p N
+	/// (in ascending dimension).
+	void print_rec_asc(std::ostream& ostr) const;
+	/// \}
+
+	/// Functional meta-manipulators.
+	/// \{
+	/// \brief Fold left.
+	/// \see mln::complex<D>::fold_left_.
+	template <typename BinaryFunction, typename T>
+	T fold_left_(const BinaryFunction& f, const T& accu) const;
+	/// \brief Apply a functor \a f to the list of faces if \a n == \p N.
+	/// \see mln::complex<D>::apply_if_dim_matches_.
+	template <typename UnaryFunction>
+	typename UnaryFunction::result_type
+	apply_if_dim_matches_(unsigned n, const UnaryFunction& f) const;
+	/// \}
+      };
+
+      /// Faces of lowest dimension (0).
+      template <unsigned D>
+      struct faces_set_mixin<0u, D> : public higher_dim_faces_set_mixin<0u, D>
+      {
+	std::vector< face<0u, D> > faces_;
+
+	/// Pretty-printing.
+	/// \{
+	/// Print the faces of dimension 0.
+	void print(std::ostream& ostr) const;
+	void print_rec_asc(std::ostream& ostr) const;
+	/// \}
+
+	/// Functional meta-manipulators.
+	/// \{
+	/// \brief Fold left.
+	/// \see mln::complex<D>::fold_left_.
+	template <typename BinaryFunction, typename T>
+	T fold_left_(const BinaryFunction& f, const T& accu) const;
+	/// \brief Apply a functor \a f to the list of faces if \a n == 0.
+	/// \see mln::complex<D>::apply_if_dim_matches_.
+	template <typename UnaryFunction>
+	typename UnaryFunction::result_type
+	apply_if_dim_matches_(unsigned n, const UnaryFunction& f) const;
+	/// \}
+      };
+
+      /// Faces of a 0-complex.
+      template <>
+      struct faces_set_mixin<0u, 0u>
+      {
+	std::vector< face<0u, 0u> > faces_;
+
+	/// Pretty-printing.
+	/// \{
+	/// Print the faces of dimension \p D.
+	void print(std::ostream& ostr) const;
+	void print_rec_asc(std::ostream& ostr) const;
+	/// \}
+
+	/// Functional meta-manipulators.
+	/// \{
+	/// \brief Fold left.
+	/// \see mln::complex<D>::fold_left_.
+	template <typename BinaryFunction, typename T>
+	T fold_left_(const BinaryFunction& f, const T& accu) const;
+	/// \brief Apply a functor \a f to the list of faces if \a n == 0.
+	/// \see mln::complex<D>::apply_if_dim_matches_.
+	template <typename UnaryFunction>
+	typename UnaryFunction::result_type
+	apply_if_dim_matches_(unsigned n, const UnaryFunction& f) const;
+	/// \}
+      };
+      /// \}
+
+
+      // ------------------------------------------------- //
+      // mln::topo::internal::lower_dim_faces_set_mixin.   //
+      // mln::topo::internal::higher_dim_faces_set_mixin.  //
+      // ------------------------------------------------- //
+
+      /// Mixins of mixin mln::faces_set_mixin.
+      /// \{
+      template <unsigned N, unsigned D>
+      struct lower_dim_faces_set_mixin
+      {
+	void print(std::ostream& ostr, const face<N, D>& f) const;
+      };
+
+      template <unsigned N, unsigned D>
+      struct higher_dim_faces_set_mixin
+      {
+	void print(std::ostream& ostr, const face<N, D>& f) const;
+      };
+      /// \}
+
+    } // end of namespace mln::topo::internal
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+    /*-----------------------.
+    | Complex construction.  |
+    `-----------------------*/
+
+    template <unsigned D>
+    complex<D>::complex()
+      // Allocate data for this complex.
+      : data_(new internal::complex_data<D>())
+    {
+    }
+
+    template <unsigned D>
+    face_handle<0u, D>
+    complex<D>::add_face()
+    {
+      /* FIXME: This is not thread-proof (these two lines should
+	 form an atomic section).  */
+      data_->internal::faces_set_mixin<0u, D>::faces_.push_back(face<0u, D>());
+      unsigned id = nfaces<0u>() - 1;
+
+      return face_handle<0u, D>(*this, id);
+    }
+
+    template <unsigned D>
+    template <unsigned N>
+    face_handle<N + 1, D>
+    complex<D>::add_face(const faces_set<N, D>& adjacent_faces)
+    {
+      typedef typename std::vector< face_handle<N, D> >::const_iterator iter_t;
+
+      // Ensure ADJACENT_FACES are already part of the complex.
+      if (!HAS_NDEBUG)
+	for (iter_t a = adjacent_faces.faces().begin();
+	     a != adjacent_faces.faces().end(); ++a)
+	  {
+	    mln_precondition(&a->cplx() == this);
+	    mln_precondition(a->is_valid());
+	  }
+
+      face<N + 1, D> f;
+      /* FIXME: This is not thread-proof (these two lines should
+	 form an atomic section).  */
+      data_->internal::faces_set_mixin<N + 1, D>::faces_.push_back(f);
+      unsigned id = nfaces<N + 1>() - 1;
+
+      face_handle<N + 1, D> fh(*this, id);
+      // Connect F and its ADJACENT_FACES.
+      for (iter_t a = adjacent_faces.faces().begin();
+	   a != adjacent_faces.faces().end(); ++a)
+	connect_(*a, fh);
+      return fh;
+    }
+
+
+    /*-------.
+    | Misc.  |
+    `-------*/
+
+    namespace internal
+    {
+
+      /// A binary meta-functor defined by:
+      ///
+      /// \code
+      /// add_size : x, c -> x + c.size()
+      /// \endcode
+      ///
+      /// \see mln::complex<D>::nfaces (static version).
+      /// \see mln::complex<D>::fold_left_.
+      struct add_size
+      {
+	template <typename T, typename Container>
+	T operator()(const T& x, const Container& c) const
+	{
+	  return x + c.size();
+	}
+      };
+
+      /// An unary meta-functor defined by:
+      ///
+      /// \code
+      /// add_size : c -> c.size()
+      /// \endcode
+      ///
+      /// \see mln::complex<D>::nfaces (dynamic version).
+      /// \see mln::complex<D>::apply_if_dim_matches_.
+      struct get_size
+      {
+	typedef std::size_t result_type;
+
+	template <typename Container>
+	typename Container::size_type operator()(const Container& c) const
+	{
+	  return c.size();
+	}
+      };
+
+    } // end of namespace mln::topo::internal
+
+
+    /*----------------------.
+    | Static manipulators.  |
+    `----------------------*/
+
+    template <unsigned D>
+    std::size_t
+    complex<D>::nfaces() const
+    {
+      return fold_left_(internal::add_size(), 0);
+    }
+
+    template <unsigned D>
+    template <unsigned N>
+    std::size_t
+    complex<D>::nfaces() const
+    {
+      return data_->internal::faces_set_mixin<N, D>::faces_.size();
+    }
+
+
+    /*-----------------------.
+    | Dynamic manipulators.  |
+    `-----------------------*/
+
+    template <unsigned D>
+    std::size_t
+    complex<D>::nfaces(unsigned n) const
+    {
+      // Ensure N is compatible with D.
+      mln_precondition(n <= D);
+      return apply_if_dim_matches_(n, internal::get_size());
+    }
+
+
+    /*-------------------.
+    | Internal methods.  |
+    `-------------------*/
+
+    template <unsigned D>
+    template <unsigned N>
+    face<N, D>&
+    complex<D>::face_(unsigned face_id)
+    {
+      return data_->internal::faces_set_mixin<N, D>::faces_[face_id];
+    }
+
+    template <unsigned D>
+    template <unsigned N>
+    const face<N, D>&
+    complex<D>::face_(unsigned face_id) const
+    {
+      return data_->internal::faces_set_mixin<N, D>::faces_[face_id];
+    }
+
+    template <unsigned D>
+    template <unsigned N>
+    void
+    complex<D>::connect_(const face_handle<N, D>& f1,
+			 const face_handle<N + 1, D>& f2)
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+
+      f1.to_face().connect_higher_dim_face(f2);
+      f2.to_face().connect_lower_dim_face(f1);
+    }
+
+
+    /*-------------.
+    | Comparison.  |
+    `-------------*/
+
+    template <unsigned D>
+    bool
+    operator==(const complex<D>& lhs, const complex<D>& rhs)
+    {
+      return lhs.data_.ptr_ == rhs.data_.ptr_;
+    }
+
+
+    /*------------------.
+    | Pretty-printing.  |
+    `------------------*/
+
+    template <unsigned D>
+    std::ostream&
+    operator<<(std::ostream& ostr, const complex<D>& c)
+    {
+      c.print(ostr);
+      return ostr;
+    }
+
+    template <unsigned D>
+    void
+    complex<D>::print(std::ostream& ostr) const
+    {
+      data_->internal::faces_set_mixin<D, D>::print_rec_asc(ostr);
+    }
+
+    template <unsigned D>
+    template <unsigned N>
+    void
+    complex<D>::print_faces(std::ostream& ostr) const
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+
+      data_->internal::faces_set_mixin<N, D>::print(ostr);
+    }
+
+
+    namespace internal
+    {
+
+      template <unsigned N, unsigned D>
+      void
+      faces_set_mixin<N, D>::print_rec_asc(std::ostream& ostr) const
+      {
+	faces_set_mixin<N - 1, D>::print_rec_asc(ostr);
+	print(ostr);
+      }
+
+      template <unsigned D>
+      void
+      faces_set_mixin<0u, D>::print_rec_asc(std::ostream& ostr) const
+      {
+	print(ostr);
+      }
+
+      template <unsigned D>
+      void
+      faces_set_mixin<D, D>::print_rec_asc(std::ostream& ostr) const
+      {
+	faces_set_mixin<D - 1, D>::print_rec_asc(ostr);
+	print(ostr);
+      }
+
+      void
+      faces_set_mixin<0u, 0u>::print_rec_asc(std::ostream& ostr) const
+      {
+	print(ostr);
+      }
+
+
+      template <unsigned N, unsigned D>
+      void
+      faces_set_mixin<N, D>::print(std::ostream& ostr) const
+      {
+	ostr << "Faces of dimension " << N
+	     << " and their ajacent faces of dimension "
+	     << N - 1 << " and "
+	     << N + 1 << std::endl;
+	for (unsigned f = 0; f < faces_.size(); ++f)
+	  {
+	    ostr << "  " << f << ":  dim " << N - 1 << ": { ";
+	    lower_dim_faces_set_mixin<N, D>::print(ostr, faces_[f]);
+	    ostr << "},  dim " << N + 1 << ": { ";
+	    higher_dim_faces_set_mixin<N, D>::print(ostr, faces_[f]);
+	    ostr << "}" << std::endl;
+	  }
+      }
+
+      template <unsigned D>
+      void
+      faces_set_mixin<0u, D>::print(std::ostream& ostr) const
+      {
+	const unsigned N = 0u;
+	ostr << "Faces of dimension " << N
+	     << " and their ajacent faces of dimension "
+	     << N + 1 << std::endl;
+	for (unsigned f = 0; f < faces_.size(); ++f)
+	  {
+	    ostr << "  " << f << ":  dim " << N + 1 << ": { ";
+	    higher_dim_faces_set_mixin<N, D>::print(ostr, faces_[f]);
+	    ostr << "}" << std::endl;
+	  }
+      }
+
+      template <unsigned D>
+      void
+      faces_set_mixin<D, D>::print(std::ostream& ostr) const
+      {
+	const unsigned N = D;
+	ostr << "Faces of dimension " << N
+	     << " and their ajacent faces of dimension "
+	     << N - 1 << std::endl;
+	for (unsigned f = 0; f < faces_.size(); ++f)
+	  {
+	    ostr << "  " << f << ":  dim " << N - 1 << ": { ";
+	    lower_dim_faces_set_mixin<N, D>::print(ostr, faces_[f]);
+	    ostr << "}" << std::endl;
+	  }
+      }
+
+      void
+      faces_set_mixin<0u, 0u>::print(std::ostream& ostr) const
+      {
+	const unsigned N = 0u;
+	ostr << "Faces of dimension " << N << std::endl;
+	for (unsigned f = 0; f < faces_.size(); ++f)
+	  ostr << "  " << f << std::endl;
+      }
+
+
+      template <unsigned N, unsigned D>
+      void
+      lower_dim_faces_set_mixin<N, D>::print(std::ostream& ostr,
+					     const face<N, D>& f) const
+      {
+	for (typename std::vector< face_handle<N - 1, D> >::const_iterator l =
+	       f.lower_dim_faces_.begin(); l != f.lower_dim_faces_.end(); ++l)
+	  ostr << l->face_id() << " ";
+      }
+
+      template <unsigned N, unsigned D>
+      void
+      higher_dim_faces_set_mixin<N, D>::print(std::ostream& ostr,
+					      const face<N, D>& f) const
+      {
+	for (typename std::vector< face_handle<N + 1, D> >::const_iterator h =
+	       f.higher_dim_faces_.begin(); h != f.higher_dim_faces_.end(); ++h)
+	  ostr << h->face_id() << " ";
+      }
+
+    } // end of namespace mln::topo::internal
+
+
+    /*-------------------------------.
+    | Functional meta-manipulators.  |
+    `-------------------------------*/
+
+    /* ------------------------------- */
+    /* ``Static Fold Left'' Operator.  */
+    /* ------------------------------- */
+
+    template <unsigned D>
+    template <typename BinaryFunction, typename T>
+    T
+    complex<D>::fold_left_(const BinaryFunction& f, const T& accu) const
+    {
+      return data_->internal::faces_set_mixin<D, D>::fold_left_(f, accu);
+    }
+
+    namespace internal
+    {
+
+      // FIXME: Try to factor.
+
+      template <unsigned D>
+      template <typename BinaryFunction, typename T>
+      T
+      faces_set_mixin<D, D>::fold_left_(const BinaryFunction& f,
+					const T& accu) const
+      {
+	return faces_set_mixin<D - 1, D>::fold_left_(f, f(accu, faces_));
+      }
+
+      template <unsigned N, unsigned D>
+      template <typename BinaryFunction, typename T>
+      T
+      faces_set_mixin<N, D>::fold_left_(const BinaryFunction& f,
+					const T& accu) const
+      {
+	return faces_set_mixin<N - 1, D>::fold_left_(f, f(accu, faces_));
+      }
+
+      template <unsigned D>
+      template <typename BinaryFunction, typename T>
+      T
+      faces_set_mixin<0u, D>::fold_left_(const BinaryFunction& f,
+					 const T& accu) const
+      {
+	return f(accu, faces_);
+      }
+
+      template <typename BinaryFunction, typename T>
+      T
+      faces_set_mixin<0u, 0u>::fold_left_(const BinaryFunction& f,
+					  const T& accu) const
+      {
+	return f(accu, faces_);
+      }
+
+    } // end of namespace mln::topo::internal
+
+
+    /* ------------------------------------------------ */
+    /* ``Static Apply-If-Dimension-Matches'' Operator.  */
+    /* ------------------------------------------------ */
+
+    template <unsigned D>
+    template <typename UnaryFunction>
+    typename UnaryFunction::result_type
+    complex<D>::apply_if_dim_matches_(unsigned n, const UnaryFunction& f) const
+    {
+      // Ensure N is compatible with D.
+      mln_precondition(n <= D);
+      return data_->internal::faces_set_mixin<D, D>::apply_if_dim_matches_(n, f);
+    }
+
+    namespace internal
+    {
+
+      // FIXME: Try to factor.
+
+      template <unsigned D>
+      template <typename UnaryFunction>
+      typename UnaryFunction::result_type
+      faces_set_mixin<D, D>::apply_if_dim_matches_(unsigned n,
+						   const UnaryFunction& f) const
+      {
+	// Ensure N and D are compatible.
+	mln_precondition(n <= D);
+	return n == D ?
+	  f(faces_) :
+	  faces_set_mixin<D - 1, D>::apply_if_dim_matches_(n, f);
+      }
+
+      template <unsigned N, unsigned D>
+      template <typename UnaryFunction>
+      typename UnaryFunction::result_type
+      faces_set_mixin<N, D>::apply_if_dim_matches_(unsigned n,
+						   const UnaryFunction& f) const
+      {
+	// Ensure N and D are compatible.
+	mln_precondition(n <= D);
+	return n == N ?
+	  f(faces_) :
+	  faces_set_mixin<N - 1, D>::apply_if_dim_matches_(n, f);
+      }
+
+      template <unsigned D>
+      template <typename UnaryFunction>
+      typename UnaryFunction::result_type
+      faces_set_mixin<0u, D>::apply_if_dim_matches_(unsigned n,
+						    const UnaryFunction& f) const
+      {
+	// If we reached this method, then N should be 0.
+	mln_precondition(n == 0);
+	return f(faces_);
+      }
+
+      template <typename UnaryFunction>
+      typename UnaryFunction::result_type
+      faces_set_mixin<0u, 0u>::apply_if_dim_matches_(unsigned n,
+						     const UnaryFunction& f) const
+      {
+	// If we reached this method, then N should be 0.
+	mln_precondition(n == 0);
+	return f(faces_);
+      }
+
+    } // end of namespace mln::topo::internal
+
+# endif // ! MLN_INCLUDE_ONLY
+
+  } // end of namespace mln::topo
+
+} // end of namespace mln
+
+#endif // ! MLN_TOPO_COMPLEX_HH
diff --git a/milena/mln/topo/complex_faces_iter.hh b/milena/mln/topo/complex_faces_iter.hh
new file mode 100644
index 0000000..05713da
--- /dev/null
+++ b/milena/mln/topo/complex_faces_iter.hh
@@ -0,0 +1,266 @@
+// 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.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_TOPO_COMPLEX_FACES_ITER_HH
+# define MLN_TOPO_COMPLEX_FACES_ITER_HH
+
+/// \file mln/topo/complex_faces_iter.hh
+/// \brief Definition of forward and backward iterators on the n-faces
+/// of a complex.
+
+# include <mln/topo/internal/complex_iter_base.hh>
+
+/* FIXME: Should we drop N from the signature of these iterators?
+   I.e., have N be dynamic?  Or better: provide other iterators where
+   N is dynamic?  */
+
+
+namespace mln
+{
+
+  namespace topo
+  {
+
+    /*--------------------------------------.
+    | topo::complex_faces_fwd_iter_<N, D>.  |
+    `--------------------------------------*/
+
+    /// \brief Forward iterator on all the faces of a mln::complex<D>.
+    ///
+    /// \arg \p N The dimension of the face associated to this iterator.
+    /// \arg \p D The dimension of the complex this iterator belongs to.
+    template <unsigned N, unsigned D>
+    class complex_faces_fwd_iter_
+      : public internal::complex_iter_base_< any_face_handle<D>,
+					     complex_faces_fwd_iter_<N, D> >
+    {
+    public:
+      /// Type of associated face.
+      typedef any_face_handle<D> face;
+
+    private:
+      typedef complex_faces_fwd_iter_<N, D> self_;
+      typedef internal::complex_iter_base_< face, self_ > super_;
+
+    public:
+      using super_::is_valid;
+      using super_::invalidate;
+
+    public:
+      /// Construction and assignment.
+      /// \{
+      complex_faces_fwd_iter_();
+      // FIXME: See comment in internal::complex_iter_base_'s default ctor
+      complex_faces_fwd_iter_(complex<D>& c);
+      /// \}
+
+      /// Manipulation.
+      /// \{
+      /// Test if the iterator is valid.
+      void start();
+      /// Go to the next point.
+      void next_();
+      /// \}
+
+    private:
+      using super_::face_;
+    };
+
+
+    /*--------------------------------------.
+    | topo::complex_faces_bkd_iter_<N, D>.  |
+    `--------------------------------------*/
+
+    /// \brief Backward iterator on all the faces of a mln::complex<D>.
+    ///
+    /// \arg \p N The dimension of the face associated to this iterator.
+    /// \arg \p D The dimension of the complex this iterator belongs to.
+    template <unsigned N, unsigned D>
+    class complex_faces_bkd_iter_
+      : public internal::complex_iter_base_< any_face_handle<D>,
+					     complex_faces_bkd_iter_<N, D> >
+    {
+    public:
+      /// Type of associated face.
+      typedef any_face_handle<D> face;
+
+    private:
+      typedef complex_faces_bkd_iter_<N, D> self_;
+      typedef internal::complex_iter_base_< face, self_ > super_;
+
+    public:
+      using super_::is_valid;
+      using super_::invalidate;
+
+    public:
+      /// Construction and assignment.
+      /// \{
+      complex_faces_bkd_iter_();
+      // FIXME: See comment in internal::complex_iter_base_'s default ctor
+      complex_faces_bkd_iter_(complex<D>& c);
+      /// \}
+
+      /// Manipulation.
+      /// \{
+      /// Start an iteration.
+      void start();
+      /// Go to the next point.
+      void next_();
+      /// \}
+
+    private:
+      using super_::face_;
+    };
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+    /*--------------------------------------.
+    | topo::complex_faces_fwd_iter_<N, D>.  |
+    `--------------------------------------*/
+
+    template <unsigned N, unsigned D>
+    inline
+    complex_faces_fwd_iter_<N, D>::complex_faces_fwd_iter_()
+      : super_()
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+      face_.set_n(N);
+      mln_postcondition(!is_valid());
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    complex_faces_fwd_iter_<N, D>::complex_faces_fwd_iter_(complex<D>& c)
+      : super_(c)
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+      face_.set_n(N);
+      mln_postcondition(!is_valid());
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    void
+    complex_faces_fwd_iter_<N, D>::start()
+    {
+      face_.set_face_id(0u);
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    void
+    complex_faces_fwd_iter_<N, D>::next_()
+    {
+      if (is_valid())
+	{
+	  unsigned face_id = face_.face_id();
+	  if (face_id + 1 < face_.cplx().template nfaces<N>())
+	    /* FIXME: Provide accessor any_face_handle::face_id()
+	       returning a mutable reference?  This way, we could just
+	       write
+
+	       ++face_.face_id();
+
+	       instead of the following.
+
+	       Or add {inc,add}_face_id() services.  */
+	    face_.set_face_id(face_id + 1);
+	  else
+	    invalidate();
+	}
+    }
+
+
+    /*--------------------------------------.
+    | topo::complex_faces_bkd_iter_<N, D>.  |
+    `--------------------------------------*/
+
+    template <unsigned N, unsigned D>
+    inline
+    complex_faces_bkd_iter_<N, D>::complex_faces_bkd_iter_()
+      : super_()
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+      face_.set_n(N);
+      mln_postcondition(!is_valid());
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    complex_faces_bkd_iter_<N, D>::complex_faces_bkd_iter_(complex<D>& c)
+      : super_(c)
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+      face_.set_n(N);
+      mln_postcondition(!is_valid());
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    void
+    complex_faces_bkd_iter_<N, D>::start()
+    {
+      face_.set_face_id(face_.cplx().template nfaces<N>() - 1);
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    void
+    complex_faces_bkd_iter_<N, D>::next_()
+    {
+      if (is_valid())
+	{
+	  unsigned face_id = face_.face_id();
+	  if (face_id > 0)
+	    /* FIXME: Provide accessor any_face_handle::face_id()
+	       returning a mutable reference?  This way, we could just
+	       write
+
+	       ++face_.face_id();
+
+	       instead of the following.
+
+	       Or add {inc,add}_face_id() services.  */
+	    face_.set_face_id(face_id - 1);
+	  else
+	    invalidate();
+	}
+    }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+  } // end of namespace mln::topo
+
+} // end of namespace mln
+
+#endif // ! MLN_TOPO_COMPLEX_FACES_ITER_HH
diff --git a/milena/mln/topo/complex_iter.hh b/milena/mln/topo/complex_iter.hh
new file mode 100644
index 0000000..b30ca00
--- /dev/null
+++ b/milena/mln/topo/complex_iter.hh
@@ -0,0 +1,275 @@
+// 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.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_TOPO_COMPLEX_ITER_HH
+# define MLN_TOPO_COMPLEX_ITER_HH
+
+/// \file mln/topo/complex_iter.hh
+/// \brief Definition of forward and backward iterators on complexes.
+
+# include <mln/topo/internal/complex_iter_base.hh>
+
+// FIXME: Factor a bit more? (Using complex_iter_base_.)
+
+
+namespace mln
+{
+
+  namespace topo
+  {
+
+    // Forward declaration.
+    template <unsigned D> class complex;
+
+
+    /*-----------------------------.
+    | topo::complex_fwd_iter_<D>.  |
+    `-----------------------------*/
+
+    /// \brief Forward iterator on all the faces of a mln::complex<D>.
+    ///
+    /// \arg \p D The dimension of the complex this iterator belongs to.
+    template <unsigned D>
+    class complex_fwd_iter_
+      : public internal::complex_iter_base_< any_face_handle<D>,
+					     complex_fwd_iter_<D> >
+    {
+    public:
+      /// Type of associated face.
+      typedef any_face_handle<D> face;
+
+    private:
+      typedef complex_fwd_iter_<D> self_;
+      typedef internal::complex_iter_base_< face, self_ > super_;
+
+    public:
+      using super_::is_valid;
+      using super_::invalidate;
+
+    public:
+      /// Construction and assignment.
+      /// \{
+      complex_fwd_iter_();
+      // FIXME: See comment in internal::complex_iter_base_'s default ctor
+      complex_fwd_iter_(complex<D>& c);
+      /// \}
+
+      /// Manipulation.
+      /// \{
+      /// Test if the iterator is valid.
+      void start();
+      /// Go to the next point.
+      void next_();
+      /// \}
+
+    private:
+      using super_::face_;
+    };
+
+
+    /*-----------------------------.
+    | topo::complex_bkd_iter_<D>.  |
+    `-----------------------------*/
+
+    /// \brief Backward iterator on all the faces of a mln::complex<D>.
+    ///
+    /// \arg \p D The dimension of the complex this iterator belongs to.
+    template <unsigned D>
+    class complex_bkd_iter_
+    : public internal::complex_iter_base_< any_face_handle<D>,
+					   complex_bkd_iter_<D> >
+    {
+    public:
+      /// Type of associated face.
+      typedef any_face_handle<D> face;
+
+    private:
+      typedef complex_bkd_iter_<D> self_;
+      typedef internal::complex_iter_base_< face, self_ > super_;
+
+    public:
+      using super_::is_valid;
+      using super_::invalidate;
+
+    public:
+      /// Construction and assignment.
+      /// \{
+      complex_bkd_iter_();
+      // FIXME: See comment in internal::complex_iter_base_'s default ctor
+      complex_bkd_iter_(complex<D>& c);
+      /// \}
+
+      /// Manipulation.
+      /// \{
+      /// Start an iteration.
+      void start();
+      /// Go to the next point.
+      void next_();
+      /// \}
+
+    private:
+      using super_::face_;
+    };
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+    /*-----------------------------.
+    | topo::complex_fwd_iter_<D>.  |
+    `-----------------------------*/
+
+    template <unsigned D>
+    inline
+    complex_fwd_iter_<D>::complex_fwd_iter_()
+      : super_()
+    {
+    }
+
+    template <unsigned D>
+    inline
+    complex_fwd_iter_<D>::complex_fwd_iter_(complex<D>& c)
+      : super_(c)
+    {
+      set_cplx(c);
+      mln_postcondition(!is_valid());
+    }
+
+    template <unsigned D>
+    inline
+    void
+    complex_fwd_iter_<D>::start()
+    {
+      face_.set_n(0u);
+      face_.set_face_id(0u);
+    }
+
+    template <unsigned D>
+    inline
+    void
+    complex_fwd_iter_<D>::next_()
+    {
+      if (is_valid())
+	{
+	  unsigned n = face_.n();
+	  unsigned face_id = face_.face_id();
+
+	  if (face_id + 1 < face_.cplx().nfaces(n))
+	    /* FIXME: Provide accessor any_face_handle::face_id() returning
+	       a mutable reference?  This way, we could just write
+
+	       ++face_.face_id();
+
+	       instead of the following.
+
+	       Or add {inc,add}_face_id() services.  */
+	    face_.set_face_id(face_id + 1);
+	  else
+	    // Start to iterate on the faces of the next dimension if
+	    // possible.
+	    if (n <= D)
+	      {
+		// FIXME: Same remark as above.
+		face_.set_n(n + 1);
+		face_.set_face_id(0u);
+	      }
+	    else
+	      invalidate();
+	}
+    }
+
+
+    /*-----------------------------.
+    | topo::complex_bkd_iter_<D>.  |
+    `-----------------------------*/
+
+    template <unsigned D>
+    inline
+    complex_bkd_iter_<D>::complex_bkd_iter_()
+      : super_()
+    {
+    }
+
+    template <unsigned D>
+    inline
+    complex_bkd_iter_<D>::complex_bkd_iter_(complex<D>& c)
+      : super_(c)
+    {
+      set_cplx(c);
+      mln_postcondition(!is_valid());
+    }
+
+    template <unsigned D>
+    inline
+    void
+    complex_bkd_iter_<D>::start()
+    {
+      face_.set_n(D);
+      face_.set_face_id(face_.cplx().template nfaces<D>() - 1);
+    }
+
+    template <unsigned D>
+    inline
+    void
+    complex_bkd_iter_<D>::next_()
+    {
+      if (is_valid())
+	{
+	  unsigned n = face_.n();
+	  unsigned face_id = face_.face_id();
+
+	  if (face_id > 0)
+	    /* FIXME: Provide accessor any_face_handle::face_id() returning
+	       a mutable reference?  This way, we could just write
+
+	       ++face_.face_id();
+
+	       instead of the following.
+
+	       Or add {inc,add}_face_id() services.  */
+	    face_.set_face_id(face_id - 1);
+	  else
+	    // Start to iterate on the faces of the previous dimension
+	    // if it exists.
+	    if (n > 0)
+	      {
+		// FIXME: Same remark as above.
+		face_.set_n(n - 1);
+		face_.set_face_id(face_.cplx().nfaces(n - 1) - 1);
+	      }
+	    else
+	      invalidate();
+	}
+    }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+  } // end of namespace mln::topo
+
+} // end of namespace mln
+
+#endif // ! MLN_TOPO_COMPLEX_ITER_HH
diff --git a/milena/mln/topo/face.hh b/milena/mln/topo/face.hh
new file mode 100644
index 0000000..11f22b2
--- /dev/null
+++ b/milena/mln/topo/face.hh
@@ -0,0 +1,733 @@
+// 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.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_TOPO_FACE_HH
+# define MLN_TOPO_FACE_HH
+
+/// \file mln/topo/face.hh
+/// \brief Face of a complex.
+
+#include <limits>
+
+#include <vector>
+
+#include <mln/core/contract.hh>
+
+/* FIXME: Suggestions:
+
+   - rename `face' as `face_data', and move it into complex.hh or its
+   own file;
+   - rename `face_handle' as `face', and move it to its own file;
+   - rename `any_face_handle' as `any_face', and move it to its own file.
+
+   Anyway, whatever the decision, splitting `face', `face_handle' and
+   `any_face_handle' seems to be sound.
+
+   (And what about `faces_set'? Should we move it to its own file as
+   well?)  */
+
+namespace mln
+{
+
+  namespace topo
+  {
+
+    // Forward declarations (external).
+    template <unsigned D> class complex;
+    namespace internal
+    {
+      template <unsigned N, unsigned D> struct lower_dim_faces_set_mixin;
+      template <unsigned N, unsigned D> struct higher_dim_faces_set_mixin;
+    }
+
+    // Forward declarations (internal).
+    template <unsigned N, unsigned D> class face_handle;
+    namespace internal
+    {
+      template <unsigned N, unsigned D> class lower_dim_faces_mixin;
+      template <unsigned N, unsigned D> class higher_dim_faces_mixin;
+    }
+
+
+    /*-------.
+    | Face.  |
+    `-------*/
+
+    /// \p N-face of a \p D-complex.
+    template <unsigned N, unsigned D> class face;
+
+
+    // Specialization for the faces of highest dimension (\p D).
+    template <unsigned D>
+    class face<D, D> : public internal::lower_dim_faces_mixin<D, D>
+    {
+    };
+
+    // Specialization for the faces of intermediate dimension (greater
+    // than 0, lower than \p D).
+    template <unsigned N, unsigned D>
+    class face : public internal::lower_dim_faces_mixin<N, D>,
+		 public internal::higher_dim_faces_mixin<N, D>
+    {
+    };
+
+    // Specialization for the faces of lowest dimension (0).
+    template <unsigned D>
+    class face<0u, D> : public internal::higher_dim_faces_mixin<0u, D>
+    {
+    };
+
+    // Specialization for the case of a 0-complex.
+    template <>
+    class face<0u, 0u>
+    {
+    };
+
+
+    namespace internal
+    {
+
+      /// Factored implementation of faces.
+      /// \{
+      template <unsigned N, unsigned D>
+      class lower_dim_faces_mixin
+      {
+      public:
+	void connect_lower_dim_face (const face_handle<N - 1, D>& f);
+      private:
+	friend class mln::topo::internal::lower_dim_faces_set_mixin<N, D>;
+	std::vector< face_handle<N - 1, D> > lower_dim_faces_;
+      };
+
+      template <unsigned N, unsigned D>
+      class higher_dim_faces_mixin
+      {
+      public:
+	void connect_higher_dim_face(const face_handle<N + 1, D>& f);
+      private:
+	friend class mln::topo::internal::higher_dim_faces_set_mixin<N, D>;
+	std::vector< face_handle<N + 1, D> > higher_dim_faces_;
+      };
+      /// \}
+
+    } // end of namespace mln::topo::internal
+
+
+
+    /*--------------.
+    | Face handle.  |
+    `--------------*/
+
+    // Face handle in a complex.
+    template <unsigned N, unsigned D>
+    struct face_handle
+    {
+      // The type of the complex this handle points to.
+      typedef complex<D> complex_type;
+
+      /// Build a non-initialized face handle.
+      face_handle();
+      /// Build a face handle from \a complex and \a face_id.
+      face_handle(complex<D>& complex, unsigned face_id);
+
+      /// Copy and assignment.
+      /// \{
+      face_handle(const face_handle<N, D>& rhs);
+      face_handle<N, D>& operator=(const face_handle<N, D>& rhs);
+      /// \}
+
+      /// Is this handle valid?
+      bool is_valid() const;
+      /// Invalidate this handle.
+      void invalidate();
+
+      /// Accessors.
+      /// \{
+      /// Return the complex the face belongs to.
+      complex<D>& cplx() const;
+      /// Return the id of the face.
+      // FIXME: Rename as `id'?
+      unsigned face_id() const;
+
+      /// Set the complex the face belongs to.
+      void set_cplx(complex<D>& cplx);
+      /// Return the dimension of the face.
+      // FIXME: Rename as `dim'?
+      unsigned n() const;
+      /// Set the id of the face.
+      void set_face_id(unsigned face_id);
+
+      /// Return the mln::face pointed by this handle.
+      face<N, D>& to_face() const;
+      /// \}
+
+    private:
+      /// \brief The complex the face belongs to.
+      ///
+      /// A const face_handle can be used to modify a complex.
+      mutable complex<D>* cplx_;
+      /// \brief The id of the face.
+      // FIXME: Rename as `id_'?
+      unsigned face_id_;
+    };
+
+
+    /// Create a handle for \p N-face of a \p D-complex.
+    template <unsigned N, unsigned D>
+    face_handle<N, D>
+    make_face_handle(const complex<D>& c, unsigned face_id);
+
+
+    /// Comparison of two instances of mln::face_handle.
+    /// \{
+    /// \brief Is \a lhs equal to \a rhs?
+    ///
+    /// \pre Arguments \a lhs and \a rhs must belong to the same
+    /// mln::complex.
+    template <unsigned N, unsigned D>
+    bool
+    operator==(const face_handle<N, D>& lhs, const face_handle<N, D>& rhs);
+
+    /// \brief Is \a lhs ``less'' than \a rhs?
+    ///
+    /// This comparison is required by algorithms sorting face handles.
+    ///
+    /// \pre Arguments \a lhs and \a rhs must belong to the same
+    /// mln::complex.
+    template <unsigned N, unsigned D>
+    bool
+    operator< (const face_handle<N, D>& lhs, const face_handle<N, D>& rhs);
+    /// \}
+
+
+    /*----------------------.
+    | Set of face handles.  |
+    `----------------------*/
+
+    /// \brief Set of face handles of dimension \p N.
+    template <unsigned N, unsigned D>
+    class faces_set
+    {
+    public:
+      void add(const face_handle<N, D>& f);
+
+      /// \brief Accessors.
+      ///
+      /// Return the set of handles.
+      /// \{
+      const std::vector< face_handle<N, D> >& faces() const;
+      /// \}
+
+    private:
+      friend class complex<D>;
+
+      // FIXME: Rename this as `handles_'?
+      std::vector< face_handle<N, D> > faces_;
+    };
+
+
+    /// Construction helpers for mln::faces_set.
+    /// \{
+    template <unsigned N, unsigned D>
+    faces_set<N, D>
+    operator+(const face_handle<N, D>& f1, const face_handle<N, D>& f2);
+
+    template <unsigned N, unsigned D>
+    faces_set<N, D>
+    operator+(const faces_set<N, D>& fs, const face_handle<N, D>& f);
+    /// \}
+
+
+    /*----------------------.
+    | ``Any-face'' handle.  |
+    `----------------------*/
+
+    // Face handle in a complex, where the dimension is dynamic.
+    template <unsigned D>
+    struct any_face_handle
+    {
+      // The type of the complex this handle points to.
+      typedef complex<D> complex_type;
+
+      /// Build a non-initialized face handle.
+      any_face_handle();
+      /// Build a face handle from \a complex and \a face_id.
+      any_face_handle(complex<D>& complex, unsigned n, unsigned face_id);
+
+      /// Build a face handle from a face_handle.
+      template <unsigned N>
+      any_face_handle(const face_handle<N, D>& f);
+
+      /// Copy and assignment.
+      /// \{
+      any_face_handle(const any_face_handle<D>& rhs);
+      any_face_handle<D>& operator=(const any_face_handle<D>& rhs);
+      /// \}
+
+      /// Is this handle valid?
+      bool is_valid() const;
+      /// Invalidate this handle.
+      void invalidate();
+
+      /// Accessors.
+      /// \{
+      /// Return the complex the face belongs to.
+      complex<D>& cplx() const;
+      /// Return the dimension of the face.
+      // FIXME: Rename as `dim'?
+      unsigned n() const;
+      /// Return the id of the face.
+      // FIXME: Rename as `id'?
+      unsigned face_id() const;
+
+      /// Set the complex the face belongs to.
+      void set_cplx(complex<D>& cplx);
+      /// Set the dimension of the face.
+      void set_n(unsigned n);
+      /// Set the id of the face.
+      void set_face_id(unsigned face_id);
+
+      /// Return the mln::face pointed by this handle.
+      template <unsigned N>
+      face<N, D>& to_face() const;
+      /// \}
+
+    private:
+      /// \brief The complex the face belongs to.
+      ///
+      /// A const any_face_handle can be used to modify a complex.
+      mutable complex<D>* cplx_;
+      /// The dimension of the face.
+      // FIXME: Rename as `dim_'?
+      unsigned n_;
+      /// \brief The id of the face.
+      // FIXME: Rename as `id_'?
+      unsigned face_id_;
+    };
+
+
+    /// Comparison of two instances of mln::any_face_handle.
+    /// \{
+    /// \brief Is \a lhs equal to \a rhs?
+    ///
+    /// \pre Arguments \a lhs and \a rhs must belong to the same
+    /// mln::complex.
+    template <unsigned D>
+    bool
+    operator==(const any_face_handle<D>& lhs, const any_face_handle<D>& rhs);
+
+    /// \brief Is \a lhs ``less'' than \a rhs?
+    ///
+    /// This comparison is required by algorithms sorting face handles.
+    ///
+    /// \pre Arguments \a lhs and \a rhs must belong to the same
+    /// mln::complex.
+    /// \pre Arguments \a lhs and \a rhs must have the same dimension.
+    template <unsigned D>
+    bool
+    operator< (const any_face_handle<D>& lhs, const any_face_handle<D>& rhs);
+    /// \}
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+    /*--------.
+    | Faces.  |
+    `--------*/
+
+    namespace internal
+    {
+      template <unsigned N, unsigned D>
+      inline
+      void
+      lower_dim_faces_mixin<N, D>::connect_lower_dim_face(const face_handle<N - 1, D>& f)
+      {
+	lower_dim_faces_.push_back(f);
+      }
+
+      template <unsigned N, unsigned D>
+      inline
+      void
+      higher_dim_faces_mixin<N, D>::connect_higher_dim_face(const face_handle<N + 1, D>& f)
+      {
+	higher_dim_faces_.push_back(f);
+      }
+
+    } // end of namespace mln::topo::internal
+
+
+    /*--------------.
+    | Face handle.  |
+    `--------------*/
+
+    template <unsigned N, unsigned D>
+    inline
+    face_handle<N, D>::face_handle()
+      : cplx_(0), face_id_(std::numeric_limits<unsigned>::max())
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    face_handle<N, D>::face_handle(complex<D>& c, unsigned face_id)
+      : cplx_(&c), face_id_(face_id)
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    face_handle<N, D>::face_handle(const face_handle<N, D>& rhs)
+      : cplx_(rhs.cplx_), face_id_(rhs.face_id_)
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    face_handle<N, D>&
+    face_handle<N, D>::operator=(const face_handle<N, D>& rhs)
+    {
+      if (&rhs != this)
+	{
+	  cplx_ = rhs.cplx_;
+	  face_id_ = rhs.face_id_;
+	}
+      return *this;
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    bool
+    face_handle<N, D>::is_valid() const
+    {
+      return cplx_ != 0 && face_id_ < cplx_->template nfaces<N>();
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    void
+    face_handle<N, D>::invalidate()
+    {
+      set_face_id(std::numeric_limits<unsigned>::max());
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    complex<D>&
+    face_handle<N, D>::cplx() const
+    {
+      mln_precondition(cplx_);
+      return *cplx_;
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    unsigned
+    face_handle<N, D>::n() const
+    {
+      return N;
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    unsigned
+    face_handle<N, D>::face_id() const
+    {
+      return face_id_;
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    void
+    face_handle<N, D>::set_cplx(complex<D>& cplx)
+    {
+      cplx_ = &cplx;
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    void
+    face_handle<N, D>::set_face_id(unsigned face_id)
+    {
+      face_id_ = face_id;
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    face<N, D>&
+    face_handle<N, D>::to_face() const
+    {
+      mln_precondition(is_valid());
+      return cplx_->template face_<N>(face_id_);
+    }
+
+
+    template <unsigned N, unsigned D>
+    inline
+    face_handle<N, D>
+    make_face_handle(const complex<D>& c, unsigned face_id)
+    {
+      return face_handle<N, D>(&c, face_id);
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    bool
+    operator==(const face_handle<N, D>& lhs, const face_handle<N, D>& rhs)
+    {
+      // Ensure LHS and RHS belong to the same complex.
+      mln_precondition(&lhs.face.cplx() == &rhs.face.cplx());
+      return lhs.face().id() == rhs.face().id();
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    bool
+    operator< (const face_handle<N, D>& lhs, const face_handle<N, D>& rhs)
+    {
+      // Ensure LHS and RHS belong to the same complex.
+      mln_precondition(&lhs.face.cplx() == &rhs.face.cplx());
+      return lhs.face().id() < rhs.face().id();
+    }
+
+
+    /*---------------.
+    | Set of faces.  |
+    `---------------*/
+
+    template <unsigned N, unsigned D>
+    inline
+    void
+    faces_set<N, D>::add(const face_handle<N, D>& f)
+    {
+      // Check consistency.
+      if (!faces_.empty())
+	mln_precondition(&faces_.front().cplx() == &f.cplx());
+      faces_.push_back(f);
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    const std::vector< face_handle<N, D> >&
+    faces_set<N, D>::faces() const
+    {
+      return faces_;
+    }
+
+
+    template <unsigned N, unsigned D>
+    inline
+    faces_set<N, D>
+    operator+(const face_handle<N, D>& f1, const face_handle<N, D>& f2)
+    {
+      faces_set<N, D> fs;
+      fs.add(f1);
+      fs.add(f2);
+      return fs;
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    faces_set<N, D>
+    operator+(const faces_set<N, D>& fs, const face_handle<N, D>& f)
+    {
+      faces_set<N, D> fs2(fs);
+      fs2.add(f);
+      return fs2;
+    }
+
+
+    /*----------------------.
+    | ``Any-face'' handle.  |
+    `----------------------*/
+
+    template <unsigned D>
+    inline
+    any_face_handle<D>::any_face_handle()
+      : cplx_(0),
+	n_(std::numeric_limits<unsigned>::max()),
+	face_id_(std::numeric_limits<unsigned>::max())
+    {
+    }
+
+    template <unsigned D>
+    inline
+    any_face_handle<D>::any_face_handle(complex<D>& c, unsigned n,
+					unsigned face_id)
+      : cplx_(&c), n_(n), face_id_(face_id)
+    {
+      // Ensure N is compatible with D.
+      mln_precondition(n <= D);
+    }
+
+    template <unsigned D>
+    template <unsigned N>
+    inline
+    any_face_handle<D>::any_face_handle(const face_handle<N, D>& f)
+      : cplx_(&f.cplx()), n_(N), face_id_(f.face_id())
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+
+    }
+
+    template <unsigned D>
+    inline
+    any_face_handle<D>::any_face_handle(const any_face_handle<D>& rhs)
+      : cplx_(rhs.cplx_), n_(rhs.n_), face_id_(rhs.face_id_)
+    {
+    }
+
+    template <unsigned D>
+    inline
+    any_face_handle<D>&
+    any_face_handle<D>::operator=(const any_face_handle<D>& rhs)
+    {
+      if (&rhs != this)
+	{
+	  cplx_ = rhs.cplx_;
+	  n_ = rhs.n_;
+	  face_id_ = rhs.face_id_;
+	}
+      return *this;
+    }
+
+    template <unsigned D>
+    inline
+    bool
+    any_face_handle<D>::is_valid() const
+    {
+      return cplx_ != 0 && n_ <= D && face_id_ < cplx_->nfaces(n_);
+    }
+
+    template <unsigned D>
+    inline
+    void
+    any_face_handle<D>::invalidate()
+    {
+      set_n(std::numeric_limits<unsigned>::max());
+      set_face_id(std::numeric_limits<unsigned>::max());
+    }
+
+    template <unsigned D>
+    inline
+    complex<D>&
+    any_face_handle<D>::cplx() const
+    {
+      mln_precondition(cplx_);
+      return *cplx_;
+    }
+
+    template <unsigned D>
+    inline
+    unsigned
+    any_face_handle<D>::n() const
+    {
+      return n_;
+    }
+
+    template <unsigned D>
+    inline
+    unsigned
+    any_face_handle<D>::face_id() const
+    {
+      return face_id_;
+    }
+
+    template <unsigned D>
+    inline
+    void
+    any_face_handle<D>::set_cplx(complex<D>& cplx)
+    {
+      cplx_ = &cplx;
+    }
+
+    template <unsigned D>
+    inline
+    void
+    any_face_handle<D>::set_n(unsigned n)
+    {
+      n_ = n;
+    }
+
+    template <unsigned D>
+    inline
+    void
+    any_face_handle<D>::set_face_id(unsigned face_id)
+    {
+      face_id_ = face_id;
+    }
+
+    template <unsigned D>
+    template <unsigned N>
+    inline
+    face<N, D>&
+    any_face_handle<D>::to_face() const
+    {
+      mln_precondition(n_ == N);
+      mln_precondition(is_valid());
+      return cplx_->template face_<N>(face_id_);
+    }
+
+
+    template <unsigned D>
+    inline
+    bool
+    operator==(const any_face_handle<D>& lhs, const any_face_handle<D>& rhs)
+    {
+      // Ensure LHS and RHS belong to the same complex.
+      mln_precondition(&lhs.face.cplx() == &rhs.face.cplx());
+      return
+	lhs.face().n() == rhs.face().n() &&
+	lhs.face().id() == rhs.face().id();
+    }
+
+    template <unsigned D>
+    inline
+    bool
+    operator< (const any_face_handle<D>& lhs, const any_face_handle<D>& rhs)
+    {
+      // Ensure LHS and RHS belong to the same complex.
+      mln_precondition(&lhs.face.cplx() == &rhs.face.cplx());
+      // Ensure LHS and RHS have the same dimension.
+      mln_precondition(lhs.face().n() == rhs.face().n());
+      return lhs.face().id() < rhs.face().id();
+    }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+  } // end of namespace mln::topo
+
+} // end of namespace mln
+
+#endif // ! MLN_TOPO_FACE_HH
diff --git a/milena/mln/topo/faces_iter.hh b/milena/mln/topo/faces_iter.hh
new file mode 100644
index 0000000..8f444c7
--- /dev/null
+++ b/milena/mln/topo/faces_iter.hh
@@ -0,0 +1,251 @@
+// 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.
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_TOPO_FACES_ITER_HH
+# define MLN_TOPO_FACES_ITER_HH
+
+/// \file mln/topo/faces_iter.hh
+/// \brief Definition of forward and backward iterators on the n-faces
+/// of a complex.
+
+# include <mln/topo/internal/complex_iter_base.hh>
+
+namespace mln
+{
+
+  namespace topo
+  {
+
+    /*------------------------------.
+    | topo::faces_fwd_iter_<N, D>.  |
+    `------------------------------*/
+
+    /// \brief Forward iterator on all the faces of a mln::complex<D>.
+    ///
+    /// \arg \p N The dimension of the face associated to this iterator.
+    /// \arg \p D The dimension of the complex this iterator belongs to.
+    template <unsigned N, unsigned D>
+    class faces_fwd_iter_
+      : public internal::complex_iter_base_< face_handle<N, D>,
+					     faces_fwd_iter_<N, D> >
+    {
+    public:
+      /// Type of associated face.
+      typedef face_handle<N, D> face;
+
+    private:
+      typedef faces_fwd_iter_<N, D> self_;
+      typedef internal::complex_iter_base_< face, self_ > super_;
+
+    public:
+      using super_::is_valid;
+      using super_::invalidate;
+
+    public:
+      /// Construction and assignment.
+      /// \{
+      faces_fwd_iter_();
+      // FIXME: See comment in internal::complex_iter_base_'s default ctor
+      faces_fwd_iter_(complex<D>& c);
+      /// \}
+
+      /// Manipulation.
+      /// \{
+      /// Test if the iterator is valid.
+      void start();
+      /// Go to the next point.
+      void next_();
+      /// \}
+
+    private:
+      using super_::face_;
+    };
+
+
+    /*------------------------------.
+    | topo::faces_bkd_iter_<N, D>.  |
+    `------------------------------*/
+
+    /// \brief Backward iterator on all the faces of a mln::complex<D>.
+    ///
+    /// \arg \p N The dimension of the face associated to this iterator.
+    /// \arg \p D The dimension of the complex this iterator belongs to.
+    template <unsigned N, unsigned D>
+    class faces_bkd_iter_
+      : public internal::complex_iter_base_< face_handle<N, D>,
+					     faces_bkd_iter_<N, D> >
+    {
+    public:
+      /// Type of associated face.
+      typedef face_handle<N, D> face;
+
+    private:
+      typedef faces_bkd_iter_<N, D> self_;
+      typedef internal::complex_iter_base_< face, self_ > super_;
+
+    public:
+      using super_::is_valid;
+      using super_::invalidate;
+
+    public:
+      /// Construction and assignment.
+      /// \{
+      faces_bkd_iter_();
+      // FIXME: See comment in internal::complex_iter_base_'s default ctor
+      faces_bkd_iter_(complex<D>& c);
+      /// \}
+
+      /// Manipulation.
+      /// \{
+      /// Start an iteration.
+      void start();
+      /// Go to the next point.
+      void next_();
+      /// \}
+
+    private:
+      using super_::face_;
+    };
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+    /*------------------------------.
+    | topo::faces_fwd_iter_<N, D>.  |
+    `------------------------------*/
+
+    template <unsigned N, unsigned D>
+    inline
+    faces_fwd_iter_<N, D>::faces_fwd_iter_()
+      : super_()
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+      mln_postcondition(!is_valid());
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    faces_fwd_iter_<N, D>::faces_fwd_iter_(complex<D>& c)
+      : super_(c)
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+      mln_postcondition(!is_valid());
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    void
+    faces_fwd_iter_<N, D>::start()
+    {
+      face_.set_face_id(0u);
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    void
+    faces_fwd_iter_<N, D>::next_()
+    {
+      if (is_valid())
+	{
+	  unsigned face_id = face_.face_id();
+	  if (face_id + 1 < face_.cplx().template nfaces<N>())
+	    /* FIXME: Provide accessor face_handle::n() returning
+	       a mutable reference?  This way, we could just write
+
+	       ++face_.face_id();
+
+	       instead of the following.  */
+	    face_.set_face_id(face_id + 1);
+	  else
+	    invalidate();
+	}
+    }
+
+
+    /*------------------------------.
+    | topo::faces_bkd_iter_<N, D>.  |
+    `------------------------------*/
+
+    template <unsigned N, unsigned D>
+    inline
+    faces_bkd_iter_<N, D>::faces_bkd_iter_()
+      : super_()
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+      mln_postcondition(!is_valid());
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    faces_bkd_iter_<N, D>::faces_bkd_iter_(complex<D>& c)
+      : super_(c)
+    {
+      // Ensure N is compatible with D.
+      metal::bool_< N <= D >::check();
+      mln_postcondition(!is_valid());
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    void
+    faces_bkd_iter_<N, D>::start()
+    {
+      face_.set_face_id(face_.cplx().template nfaces<N>() - 1);
+    }
+
+    template <unsigned N, unsigned D>
+    inline
+    void
+    faces_bkd_iter_<N, D>::next_()
+    {
+      if (is_valid())
+	{
+	  unsigned face_id = face_.face_id();
+	  if (face_id > 0)
+	    /* FIXME: Provide accessor face_handle::n() returning
+	       a mutable reference?  This way, we could just write
+
+	       ++face_.face_id();
+
+	       instead of the following.  */
+	    face_.set_face_id(face_id - 1);
+	  else
+	    invalidate();
+	}
+    }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+  } // end of namespace mln::topo
+
+} // end of namespace mln
+
+#endif // ! MLN_TOPO_FACES_ITER_HH
diff --git a/milena/mln/topo/internal/complex_iter_base.hh b/milena/mln/topo/internal/complex_iter_base.hh
new file mode 100644
index 0000000..d371372
--- /dev/null
+++ b/milena/mln/topo/internal/complex_iter_base.hh
@@ -0,0 +1,208 @@
+// 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.  
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_TOPO_INTERNAL_COMPLEX_ITER_BASE_HH
+# define MLN_TOPO_INTERNAL_COMPLEX_ITER_BASE_HH
+
+/// \file mln/topo/internal/complex_iter_base.hh
+/// \brief Definition of an implementation (factoring) class for
+/// iterators on mln::complex.
+
+# include <limits>
+
+# include <mln/metal/equal.hh>
+
+# include <mln/core/concept/iterator.hh>
+# include <mln/topo/complex.hh>
+
+
+namespace mln
+{
+
+  namespace topo
+  {
+
+    namespace internal
+    {
+      /// \brief Factoring class for iterators on mln::complex.
+      ///
+      /// \arg \p F The type of the face handle.
+      /// \arg \p E The type exact type of the iterator.
+      template <typename F, typename E>
+      class complex_iter_base_ : public Iterator<E>
+      {
+	typedef complex_iter_base_<F, E> self_;
+
+      public:
+	typedef F face;
+	// FIXME: Maybe we could just get the dimension D of the face's
+	// complex, an define complex_type as mln::complex<D>?
+	typedef typename F::complex_type complex_type;
+
+	/// Construction and assignment.
+	/// \{
+	/* FIXME: Keep this non-const?  See a (big) comment about this in
+	   milena/tests/complex_image.cc.   */
+	complex_iter_base_();
+	complex_iter_base_(complex_type& c);
+	/// \}
+
+	/// Manipulation.
+	/// \{
+	/// Change the target complex.
+	// FIXME: Same comment as the ctor above.
+	void set_cplx(complex_type& c);
+
+	/// Test if the iterator is valid.
+	bool is_valid() const;
+	/// Invalidate the iterator.
+	void invalidate();
+	/// \}
+
+	/// Conversion and accessors.
+	/// \{
+	/// Reference to the corresponding face handle.
+	const face& to_face () const;
+	/// Convert the iterator into an face handle.
+	operator face() const;
+	/// \}
+
+      protected:
+	/// The face handle this iterator is pointing to.
+	face face_;
+      };
+
+
+      /* FIXME: This hand-made delegation is painful.  We should rely on
+	 the general mechanism provided by Point_Site.  But then again, we
+	 need to refine/adjust the interface of Point_Site w.r.t. the
+	 mandatory conversions to points.  */
+      template <typename F, typename E>
+      inline
+      std::ostream&
+      operator<<(std::ostream& ostr, const complex_iter_base_<F, E>& p);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+      template <typename F, typename E>
+      inline
+      complex_iter_base_<F, E>::complex_iter_base_()
+      {
+	// Ensure F and E are compatible.
+	mlc_equal(F, typename E::face)::check();
+
+	invalidate();
+      }
+
+      template <typename F, typename E>
+      inline
+      complex_iter_base_<F, E>::complex_iter_base_(complex_type& c)
+      {
+	// Ensure F and E are compatible.
+	mlc_equal(F, typename E::face)::check();
+
+	face_.set_cplx(c);
+	// Invalidate face_.
+	invalidate();
+      }
+
+      template <typename F, typename E>
+      inline
+      void
+      complex_iter_base_<F, E>::set_cplx(complex_type& c)
+      {
+	face_.set_cplx(c);
+	// Invalidate face_.
+	invalidate();
+      }
+
+      template <typename F, typename E>
+      inline
+      bool
+      complex_iter_base_<F, E>::is_valid() const
+      {
+	return face_.is_valid();
+      }
+
+      template <typename F, typename E>
+      inline
+      void
+      complex_iter_base_<F, E>::invalidate()
+      {
+	face_.invalidate();
+      }
+
+      template <typename F, typename E>
+      inline
+      const F&
+      complex_iter_base_<F, E>::to_face() const
+      {
+	return face_;
+      }
+
+      template <typename F, typename E>
+      inline
+      complex_iter_base_<F, E>::operator F() const
+      {
+	mln_precondition(is_valid());
+	return face_;
+      }
+
+
+      template <typename F, typename E>
+      inline
+      std::ostream&
+      operator<<(std::ostream& ostr, const complex_iter_base_<F, E>& p)
+      {
+	/* FIXME: We should use p.to_face() here, but as it lacks the
+	   precondition the conversion operator has, so we use the latter.
+
+	   We should
+	   - rename `to_face' as `to_face_';
+	   - write a new `to_face' routine checking the validity of the
+	   iterator;
+	   - have the conversion operator to face use this new `to_face'
+	   routine;
+	   - adjust former clients of `to_face'
+
+	   This is a general remark that applies to all iterators of
+	   Milena.  */
+	F f = p;
+	return ostr << "(dim = " << f.n() << ", id = " << f.face_id() << ')';
+      }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+    } // end of namespace mln::topo::internal
+
+  } // end of namespace mln::topo
+
+} // end of namespace mln
+
+#endif // ! MLN_TOPO_INTERNAL_COMPLEX_ITER_BASE_HH
diff --git a/milena/tests/Makefile.am b/milena/tests/Makefile.am
index a26dd92..a6ec1dc 100644
--- a/milena/tests/Makefile.am
+++ b/milena/tests/Makefile.am
@@ -35,6 +35,7 @@ SUBDIRS =					\
   subsampling					\
   tag						\
   test						\
+  topo						\
   trace						\
   trait						\
   util						\
diff --git a/milena/tests/core/other/Makefile.am b/milena/tests/core/other/Makefile.am
index 4ecef66..f0e5fdf 100644
--- a/milena/tests/core/other/Makefile.am
+++ b/milena/tests/core/other/Makefile.am
@@ -7,7 +7,6 @@ check_PROGRAMS =				\
   category					\
   clock_neighb2d				\
   clock_test					\
-  complex					\
   dpoints_pixter				\
   graph_elt_neighborhood			\
   graph_elt_window				\
@@ -27,7 +26,6 @@ box_runstart_piter_SOURCES = box_runstart_piter.cc
 category_SOURCES = category.cc
 clock_neighb2d_SOURCES = clock_neighb2d.cc
 clock_test_SOURCES = clock_test.cc
-complex_SOURCES = complex.cc
 dpoints_pixter_SOURCES = dpoints_pixter.cc
 graph_elt_neighborhood_SOURCES = graph_elt_neighborhood.cc
 graph_elt_window_SOURCES = graph_elt_window.cc
diff --git a/milena/tests/topo/Makefile.am b/milena/tests/topo/Makefile.am
new file mode 100644
index 0000000..d6258d8
--- /dev/null
+++ b/milena/tests/topo/Makefile.am
@@ -0,0 +1,10 @@
+## Process this file through Automake to create Makefile.in -*- Makefile -*-
+
+include $(top_srcdir)/milena/tests/tests.mk
+
+check_PROGRAMS =				\
+  complex
+
+complex_SOURCES = complex.cc
+
+TESTS = $(check_PROGRAMS)
diff --git a/milena/tests/core/other/complex.cc b/milena/tests/topo/complex.cc
similarity index 79%
rename from milena/tests/core/other/complex.cc
rename to milena/tests/topo/complex.cc
index a131f63..08be130 100644
--- a/milena/tests/core/other/complex.cc
+++ b/milena/tests/topo/complex.cc
@@ -25,19 +25,19 @@
 // reasons why the executable file might be covered by the GNU General
 // Public License.
 
-/// \file tests/core/other/complex.cc
+/// \file tests/topo/complex.cc
 /// \brief Test of mln::complex.
 
 #include <iostream>
 
-#include <mln/core/complex.hh>
+#include <mln/topo/complex.hh>
 
 using namespace mln;
 
 
 // Forward declaration.
-template <unsigned N, unsigned D> void test_faces_iter(complex<D>& c);
-template <unsigned N, unsigned D> void test_complex_faces_iter(complex<D>& c);
+template <unsigned N, unsigned D> void test_faces_iter(topo::complex<D>& c);
+template <unsigned N, unsigned D> void test_complex_faces_iter(topo::complex<D>& c);
 
 
 int main()
@@ -66,24 +66,24 @@ int main()
   | Complex construction.  |
   `-----------------------*/
 
-  complex<D> c;
+  topo::complex<D> c;
 
   // 0-faces (points).
-  face_handle<0, D> v0 = c.add_face();
-  face_handle<0, D> v1 = c.add_face();
-  face_handle<0, D> v2 = c.add_face();
-  face_handle<0, D> v3 = c.add_face();
+  topo::face_handle<0, D> v0 = c.add_face();
+  topo::face_handle<0, D> v1 = c.add_face();
+  topo::face_handle<0, D> v2 = c.add_face();
+  topo::face_handle<0, D> v3 = c.add_face();
  
   // 1-faces (segments).
-  face_handle<1, D> e0 = c.add_face(v0 + v1);
-  face_handle<1, D> e1 = c.add_face(v0 + v2);
-  face_handle<1, D> e2 = c.add_face(v1 + v2);
-  face_handle<1, D> e3 = c.add_face(v0 + v3);
-  face_handle<1, D> e4 = c.add_face(v2 + v3);
+  topo::face_handle<1, D> e0 = c.add_face(v0 + v1);
+  topo::face_handle<1, D> e1 = c.add_face(v0 + v2);
+  topo::face_handle<1, D> e2 = c.add_face(v1 + v2);
+  topo::face_handle<1, D> e3 = c.add_face(v0 + v3);
+  topo::face_handle<1, D> e4 = c.add_face(v2 + v3);
 
   // 2-faces (triangles).
-  face_handle<2, D> t0 = c.add_face(e0 + e1 + e2);
-  face_handle<2, D> t1 = c.add_face(e1 + e3 + e4);
+  topo::face_handle<2, D> t0 = c.add_face(e0 + e1 + e2);
+  topo::face_handle<2, D> t1 = c.add_face(e1 + e3 + e4);
 
   std::cout << c << std::endl;
 
@@ -107,12 +107,12 @@ int main()
   `-------------------*/
 
   // Get the face data from (``static'') face handle E0.
-  const face<1, D>& face1 = e0.to_face();
+  const topo::face<1, D>& face1 = e0.to_face();
 
   // Any-face handle.
-  any_face_handle<D> af(e0);
+  topo::any_face_handle<D> af(e0);
   // Get the face data from (``dynamic'') face handle AF.
-  const face<1, D>& face2 = af.to_face<1>();
+  const topo::face<1, D>& face2 = af.to_face<1>();
 
   mln_assertion(&face1 == &face2);
 
@@ -128,8 +128,8 @@ int main()
 
   // Iterators on a complex (not complex_image), or more precisely on
   // (all) the faces of complex C.
-  mln_fwd_citer_(complex<D>) fwd_f(c);
-  mln_bkd_citer_(complex<D>) bkd_f(c);
+  mln_fwd_citer_(topo::complex<D>) fwd_f(c);
+  mln_bkd_citer_(topo::complex<D>) bkd_f(c);
   for_all_2(fwd_f, bkd_f)
     std::cout << fwd_f << ' ' << bkd_f << std::endl;
   std::cout << std::endl;
@@ -165,12 +165,12 @@ int main()
 
 template <unsigned N, unsigned D>
 void
-test_faces_iter(complex<D>& c)
+test_faces_iter(topo::complex<D>& c)
 {
   std::cout << "test_faces_iter<" << N << ", " << D << ">:"
 	    << std::endl;
-  mln_fwd_fiter(N, complex<D>) fwd_nf(c);
-  mln_bkd_fiter(N, complex<D>) bkd_nf(c);
+  mln_fwd_fiter(N, topo::complex<D>) fwd_nf(c);
+  mln_bkd_fiter(N, topo::complex<D>) bkd_nf(c);
   for_all_2(fwd_nf, bkd_nf)
     std::cout << fwd_nf << ' ' << bkd_nf << std::endl;
   std::cout << std::endl;
@@ -178,15 +178,15 @@ test_faces_iter(complex<D>& c)
 
 template <unsigned N, unsigned D>
 void
-test_complex_faces_iter(complex<D>& c)
+test_complex_faces_iter(topo::complex<D>& c)
 {
   std::cout << "test_complex_faces_iter<" << N << ", " << D << ">:"
 	    << std::endl;
   /* FIXME: Provide sugar.  Maybe redefined mln_fwd_fiter and
      mln_bkd_fiter so that they expand as complex_faces_iters (instead
      of faces_iters).  */
-  complex_faces_fwd_iter_<N, D> fwd_ncf(c);
-  complex_faces_bkd_iter_<N, D> bkd_ncf(c);
+  topo::complex_faces_fwd_iter_<N, D> fwd_ncf(c);
+  topo::complex_faces_bkd_iter_<N, D> bkd_ncf(c);
   for_all_2(fwd_ncf, bkd_ncf)
     std::cout << fwd_ncf << ' ' << bkd_ncf << std::endl;
   std::cout << std::endl;
-- 
1.6.0.1
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    24 Sep '08
                    
                        	* mln/core/site_set/p_complex_piter.hh,
	* mln/core/site_set/p_faces_piter.hh:
	Here.
---
 milena/ChangeLog                            |    8 ++++++++
 milena/mln/core/site_set/p_complex_piter.hh |    7 +++++--
 milena/mln/core/site_set/p_faces_piter.hh   |    9 +++++++--
 3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 6cd837a..aa7dc82 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -41,6 +41,14 @@
 
 2008-09-24  Roland Levillain  <roland(a)lrde.epita.fr>
 
+	Misc. documentation fixes in complex-related entities.
+
+	* mln/core/site_set/p_complex_piter.hh,
+	* mln/core/site_set/p_faces_piter.hh:
+	Here.
+
+2008-09-24  Roland Levillain  <roland(a)lrde.epita.fr>
+
 	Get back to the previous, simpler interface of mln::complex_image.
 
 	* mln/core/image/complex_image.hh
diff --git a/milena/mln/core/site_set/p_complex_piter.hh b/milena/mln/core/site_set/p_complex_piter.hh
index 41671ce..114eed6 100644
--- a/milena/mln/core/site_set/p_complex_piter.hh
+++ b/milena/mln/core/site_set/p_complex_piter.hh
@@ -30,6 +30,9 @@
 
 /// \file mln/core/site_set/p_complex_piter.hh
 /// \brief Definition of point iterator on complex-based pset.
+///
+/// Types defined here are akin to parametrized typedefs: the code is
+/// factored in mln::internal::p_complex_piter_base_.
 
 # include <mln/core/site_set/p_complex.hh>
 # include <mln/core/internal/p_complex_piter_base.hh>
@@ -49,7 +52,7 @@ namespace mln
   | p_complex_fwd_piter_<D, P>.  |
   `-----------------------------*/
 
-  /// \brief Forward iterator on point sites of a mln::p_complex<D, P>.
+  /// \brief Forward iterator on (all) the faces of an mln::p_complex<D, P>.
   template <unsigned D, typename P>
   class p_complex_fwd_piter_
     : public internal::p_complex_piter_base_< complex_fwd_iter_<D>,
@@ -76,7 +79,7 @@ namespace mln
   | p_complex_bkd_piter_<D, P>.  |
   `-----------------------------*/
 
-  /// \brief Backward iterator on point sites of a mln::p_complex<D, P>.
+  /// \brief Backward iterator on (all) the faces of an mln::p_complex<D, P>.
   template <unsigned D, typename P>
   class p_complex_bkd_piter_
     : public internal::p_complex_piter_base_< complex_bkd_iter_<D>,
diff --git a/milena/mln/core/site_set/p_faces_piter.hh b/milena/mln/core/site_set/p_faces_piter.hh
index b26ca9b..65f07fd 100644
--- a/milena/mln/core/site_set/p_faces_piter.hh
+++ b/milena/mln/core/site_set/p_faces_piter.hh
@@ -30,6 +30,9 @@
 
 /// \file mln/core/site_set/p_faces_piter.hh
 /// \brief Definition of point iterator on complex-based pset.
+///
+/// Types defined here are akin to parametrized typedefs: the code is
+/// factored in mln::internal::p_complex_piter_base_.
 
 # include <mln/core/site_set/p_faces.hh>
 # include <mln/core/internal/p_complex_piter_base.hh>
@@ -50,7 +53,8 @@ namespace mln
   | p_faces_fwd_piter_<N, D, P>.  |
   `------------------------------*/
 
-  /// \brief Forward iterator on point sites of a mln::p_faces<N, D, P>.
+  /// \brief Forward iterator on the \p N-faces sites of an
+  /// mln::p_faces<N, D, P>.
   template <unsigned N, unsigned D, typename P>
   class p_faces_fwd_piter_
     : public internal::p_complex_piter_base_< faces_fwd_iter_<N, D>,
@@ -77,7 +81,8 @@ namespace mln
   | p_faces_bkd_piter_<N, D, P>.  |
   `------------------------------*/
 
-  /// \brief Backward iterator on point sites of a mln::p_faces<N, D, P>.
+  /// \brief Backward iterator on the \p N-faces sites of an
+  /// mln::p_faces<N, D, P>.
   template <unsigned N, unsigned D, typename P>
   class p_faces_bkd_piter_
   /* FIXME: Rename internal::p_complex_piter_base_ to something else,
-- 
1.6.0.1
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0