
URL: https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena ChangeLog: 2008-09-17 Guillaume Lazzara <z@lrde.epita.fr> Make w_window compile. * milena/mln/core/site_set/p_priority.hh: Add missing comparison operator. * milena/mln/core/w_window.hh, * milena/mln/core/concept/weighted_window.hh: Update typedefs. --- concept/weighted_window.hh | 31 ++++++++++++++++--------------- site_set/p_priority.hh | 3 ++- w_window.hh | 25 +++++++++++++++---------- 3 files changed, 33 insertions(+), 26 deletions(-) Index: branches/cleanup-2008/milena/mln/core/site_set/p_priority.hh =================================================================== --- branches/cleanup-2008/milena/mln/core/site_set/p_priority.hh (revision 2310) +++ branches/cleanup-2008/milena/mln/core/site_set/p_priority.hh (revision 2311) @@ -39,6 +39,7 @@ # include <mln/core/site_set/p_double.hh> # include <mln/core/internal/site_set_base.hh> # include <mln/util/set.hh> +# include <mln/util/ord.hh> namespace mln @@ -177,7 +178,7 @@ protected: util::set<P> p_; - std::map<P,Q> q_; + std::map<P, Q, util::ord<P> > q_; unsigned n_; // Run invariance tests and return the result. Index: branches/cleanup-2008/milena/mln/core/w_window.hh =================================================================== --- branches/cleanup-2008/milena/mln/core/w_window.hh (revision 2310) +++ branches/cleanup-2008/milena/mln/core/w_window.hh (revision 2311) @@ -38,6 +38,8 @@ # include <mln/core/window.hh> # include <mln/core/concept/weighted_window.hh> # include <mln/core/dpsites_piter.hh> +# include <mln/value/ops.hh> +# include <mln/util/ord.hh> namespace mln { @@ -56,11 +58,14 @@ template <typename D, typename W> struct w_window : public Weighted_Window< w_window<D,W> > { - /// Site associated type. - typedef mln_point(D) point; + /// DPsite associated type. + typedef D dpsite; + + /// Psite associated type. + typedef mln_psite(D) psite; - /// Dpsite associated type. - typedef D dpoint; + /// Site associated type. + typedef mln_site(D) site; /// Weight associated type. typedef W weight; @@ -70,10 +75,10 @@ /// Site_Iterator type to browse (forward) the points of a generic w_window. - typedef with_w_< dpsites_fwd_piter<D>, W > fwd_qiter; + typedef with_w_< dpsites_fwd_piter< w_window<D, W> >, W > fwd_qiter; /// Site_Iterator type to browse (backward) the points of a generic w_window. - typedef with_w_< dpsites_bkd_piter<D>, W > bkd_qiter; + typedef with_w_< dpsites_bkd_piter< w_window<D, W> >, W > bkd_qiter; /// Constructor without argument. @@ -98,7 +103,7 @@ unsigned size() const; /// Give access to the vector of delta-points. - const std::vector<D>& vect() const; + const std::vector<D>& std_vector() const; /// Give the corresponding window. const mln::window<D>& win() const; @@ -208,9 +213,9 @@ template <typename D, typename W> inline const std::vector<D>& - w_window<D,W>::vect() const + w_window<D,W>::std_vector() const { - return win_.vect(); + return win_.std_vector(); } template <typename D, typename W> @@ -244,7 +249,7 @@ return *this; // memorization: d_i -> w_i - std::map<D, W> memo_wei_; + std::map<D, W, util::ord<D> > memo_wei_; for (unsigned i = 0; i < win_.size(); ++i) memo_wei_[win_.dp(i)] = wei_[i]; Index: branches/cleanup-2008/milena/mln/core/concept/weighted_window.hh =================================================================== --- branches/cleanup-2008/milena/mln/core/concept/weighted_window.hh (revision 2310) +++ branches/cleanup-2008/milena/mln/core/concept/weighted_window.hh (revision 2311) @@ -41,7 +41,7 @@ { // Fwd decl. - template <typename E> struct Weighted_Window; + template <typename W> struct Weighted_Window; // Weighted_Window category flag type. template <> @@ -57,8 +57,8 @@ * \see mln::doc::Weighted_Window for a complete documentation of * this class contents. */ - template <typename E> - struct Weighted_Window : public Object<E> + template <typename W> + struct Weighted_Window : public Object<W> { typedef Weighted_Window<void> category; @@ -66,8 +66,9 @@ typedef fwd_qiter; typedef bkd_piter; - typedef point; - typedef dpoint; + typedef dpsite; + typedef psite; + typedef site; typedef weight; typedef window; @@ -109,22 +110,22 @@ # ifndef MLN_INCLUDE_ONLY - template <typename E> + template <typename W> inline - Weighted_Window<E>::Weighted_Window() + Weighted_Window<W>::Weighted_Window() { - typedef mln_point(E) point; - typedef mln_dpoint(E) dpoint; - typedef mln_weight(E) weight; - typedef mln_window(E) window; + //typedef mln_psite(E) point; + //typedef mln_dpsite(E) dpoint; + typedef mln_weight(W) weight; + typedef mln_window(W) window; - typedef mln_fwd_qiter(E) fwd_qiter; - typedef mln_bkd_qiter(E) bkd_qiter; + typedef mln_fwd_qiter(W) fwd_qiter; + typedef mln_bkd_qiter(W) bkd_qiter; - E& (E::*m1)() = & E::sym; + W& (W::*m1)() = & W::sym; m1 = 0; - const window& (E::*m2)() const = & E::win; + const window& (W::*m2)() const = & W::win; m2 = 0; }