1824: Fix the interface of some graph-related piters.
https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Roland Levillain <roland@lrde.epita.fr> Fix the interface of some graph-related piters. * mln/core/graph_window_piter.hh (graph_window_fwd_piter::graph_window_fwd_piter) (graph_window_bkd_piter::graph_window_bkd_piter): Fix the signatures of these ctors w.r.t. the Window concept. * mln/core/graph_neighborhood_piter.hh: (graph_neighborhood_fwd_piter::graph_neighborhood_fwd_piter) (graph_neighborhood_bkd_piter::graph_neighborhood_bkd_piter): Likewise, w.r.t. the Neighborhood concept. (graph_neighborhood_bkd_piter::graph_neighborhood_bkd_piter): Fix the initialization of nbh_. * mln/core/graph_elt_window.hh: Fix comments. * mln/core/graph_elt_neighborhood.hh: Likewise. Use `N' instead of `W' for the parameter representing the neighborhood type. graph_elt_neighborhood.hh | 24 ++++++++++-------------- graph_elt_window.hh | 21 ++++++++------------- graph_neighborhood_piter.hh | 12 +++++++----- graph_window_piter.hh | 8 ++++---- 4 files changed, 29 insertions(+), 36 deletions(-) Index: mln/core/graph_window_piter.hh --- mln/core/graph_window_piter.hh (revision 1823) +++ mln/core/graph_window_piter.hh (working copy) @@ -84,7 +84,7 @@ /// Construction. /// \{ template <typename Pref> - graph_window_fwd_piter(const W& win, const Point_Site<Pref>& p_ref); + graph_window_fwd_piter(const Window<W>& win, const Point_Site<Pref>& p_ref); /// \} /// Manipulation. @@ -168,7 +168,7 @@ /// Construction. /// \{ template <typename Pref> - graph_window_bkd_piter(const W& win, const Point_Site<Pref>& p_ref); + graph_window_bkd_piter(const Window<W>& win, const Point_Site<Pref>& p_ref); /// \} /// Manipulation. @@ -235,7 +235,7 @@ template <typename P, typename W> template <typename Pref> inline - graph_window_fwd_piter<P, W>::graph_window_fwd_piter(const W& win, + graph_window_fwd_piter<P, W>::graph_window_fwd_piter(const Window<W>& win, const Point_Site<Pref>& p_ref) : win_(exact(win)), p_ref_(exact(p_ref).to_psite()), @@ -360,7 +360,7 @@ template <typename P, typename W> template <typename Pref> inline - graph_window_bkd_piter<P, W>::graph_window_bkd_piter(const W& win, + graph_window_bkd_piter<P, W>::graph_window_bkd_piter(const Window<W>& win, const Point_Site<Pref>& p_ref) : win_(exact(win)), p_ref_(exact(p_ref).to_psite()), Index: mln/core/graph_elt_neighborhood.hh --- mln/core/graph_elt_neighborhood.hh (revision 1823) +++ mln/core/graph_elt_neighborhood.hh (working copy) @@ -28,13 +28,11 @@ #ifndef MLN_CORE_GRAPH_ELT_NEIGHBORHOOD_HH # define MLN_CORE_GRAPH_ELT_NEIGHBORHOOD_HH -/*! \file mln/core/graph_elt_neighborhood.hh - * - * \brief Definition of the elementary ``neighborhood'' on a graph. - * - * \todo Make naming coherent: we have neighborhood (without '_') but - * point_, neighb_, etc. - */ +/// \file mln/core/graph_elt_neighborhood.hh +/// \brief Definition of the elementary ``neighborhood'' on a graph. + +/* FIXME: Have a consistent naming: we have neighborhood (without '_') + but point_, neighb_, etc. */ /* FIXME: Factor those classes: - mln::graph_elt_window @@ -50,14 +48,11 @@ namespace mln { // Fwd decls. - template <typename P, typename W> class graph_neighborhood_fwd_piter; - template <typename P, typename W> class graph_neighborhood_bkd_piter; + template <typename P, typename N> class graph_neighborhood_fwd_piter; + template <typename P, typename N> class graph_neighborhood_bkd_piter; - /*! \brief Elementary neighborhood on graph class. - * - * FIXME: Doc. - */ + /// Elementary neighborhood on graph class. template <typename P> class graph_elt_neighborhood : public Neighborhood< graph_elt_neighborhood<P> > @@ -80,7 +75,7 @@ typedef graph_neighborhood_fwd_piter<P, self_> fwd_niter; /// \brief Point_Iterator type to browse the psites of the - /// neighborhood w.r.t. the ordering of vertices. + /// neighborhood w.r.t. the reverse ordering of vertices. typedef graph_neighborhood_bkd_piter<P, self_> bkd_niter; /// The default niter type. @@ -98,6 +93,7 @@ /// \} }; + # ifndef MLN_INCLUDE_ONLY template <typename P> Index: mln/core/graph_neighborhood_piter.hh --- mln/core/graph_neighborhood_piter.hh (revision 1823) +++ mln/core/graph_neighborhood_piter.hh (working copy) @@ -83,7 +83,8 @@ /// Construction. /// \{ template <typename Pref> - graph_neighborhood_fwd_piter(const N& nbh, const Point_Site<Pref>& p_ref); + graph_neighborhood_fwd_piter(const Neighborhood<N>& nbh, + const Point_Site<Pref>& p_ref); /// \} /// Manipulation. @@ -164,7 +165,8 @@ /// Construction. /// \{ template <typename Pref> - graph_neighborhood_bkd_piter(const N& nbh, const Point_Site<Pref>& p_ref); + graph_neighborhood_bkd_piter(const Neighborhood<N>& nbh, + const Point_Site<Pref>& p_ref); /// \} /// Manipulation. @@ -229,7 +231,7 @@ template <typename P, typename N> template <typename Pref> inline - graph_neighborhood_fwd_piter<P, N>::graph_neighborhood_fwd_piter(const N& nbh, + graph_neighborhood_fwd_piter<P, N>::graph_neighborhood_fwd_piter(const Neighborhood<N>& nbh, const Point_Site<Pref>& p_ref) : nbh_(exact(nbh)), p_ref_(exact(p_ref).to_psite()), @@ -357,9 +359,9 @@ template <typename P, typename N> template <typename Pref> inline - graph_neighborhood_bkd_piter<P, N>::graph_neighborhood_bkd_piter(const N& nbh, + graph_neighborhood_bkd_piter<P, N>::graph_neighborhood_bkd_piter(const Neighborhood<N>& nbh, const Point_Site<Pref>& p_ref) - : nbh_(nbh), + : nbh_(exact(nbh)), p_ref_(exact(p_ref).to_psite()), // Initialize psite_ to a dummy value. psite_(), Index: mln/core/graph_elt_window.hh --- mln/core/graph_elt_window.hh (revision 1823) +++ mln/core/graph_elt_window.hh (working copy) @@ -28,13 +28,11 @@ #ifndef MLN_CORE_GRAPH_ELT_WINDOW_HH # define MLN_CORE_GRAPH_ELT_WINDOW_HH -/*! \file mln/core/graph_elt_window.hh - * - * \brief Definition of the elementary ``window'' on a graph. - * - * \todo Make naming coherent: we have window (without '_') but - * point_, neighb_, etc. - */ +/// \file mln/core/graph_elt_window.hh +/// \brief Definition of the elementary ``window'' on a graph. + +/* FIXME: Have a consistent naming: we have window (without '_') but + point_, neighb_, etc. */ /* FIXME: Factor those classes: - mln::graph_elt_window @@ -54,10 +52,7 @@ template <typename P, typename W> class graph_window_bkd_piter; - /*! \brief Elementary window on graph class. - * - * FIXME: Doc. - */ + /// \brief Elementary window on graph class. template <typename P> class graph_elt_window : public Window< graph_elt_window<P> > { @@ -79,7 +74,7 @@ typedef graph_window_fwd_piter<P, self_> fwd_qiter; /// \brief Point_Iterator type to browse the psites of the window - /// w.r.t. the ordering of vertices. + /// w.r.t. the reverse ordering of vertices. typedef graph_window_bkd_piter<P, self_> bkd_qiter; /// The default qiter type. @@ -106,7 +101,7 @@ /// Is the window centered? bool is_centered() const; /// Is the window symmetric? - // FIXME: We should defin this more precisely. + // FIXME: We should define this more precisely. bool is_symmetric() const; /// Return the maximum coordinate gap between the window center /// and a window point.
participants (1)
-
Roland Levillain