
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena Index: ChangeLog from Nicolas Ballas <ballas@lrde.epita.fr> Adapt the accumulators histo, min_h, max_h to histo/data. * tests/accu/max_h.cc, * tests/accu/min_h.cc: Update. * mln/histo/data.hh: Add a new method nvalues. * mln/core/routine/ops.hh: delete trailing whitespace. * mln/accu/nil.hh, * mln/accu/min.hh, * mln/accu/count_adjacent_vertices.hh, * mln/accu/max.hh, * mln/accu/count.hh, * mln/accu/tuple.hh, * mln/accu/bbox.hh, * mln/accu/pair.hh, * mln/accu/median.hh, * mln/accu/median_alt.hh, * mln/accu/p.hh, * mln/accu/rank_high_quant.hh, * mln/accu/sum.hh, * mln/accu/v.hh, * mln/accu/rank_bool.hh, * mln/accu/volume.hh, * mln/accu/height.hh, * mln/accu/mean.hh, * mln/accu/internal/base.hh: Rename base_ to base. * mln/accu/max_h.hh, * mln/accu/min_h.hh, * mln/accu/histo.hh: Adapt to histo/data. * mln/value/int_u.hh: Update. mln/accu/bbox.hh | 2 mln/accu/count.hh | 2 mln/accu/count_adjacent_vertices.hh | 2 mln/accu/height.hh | 2 mln/accu/histo.hh | 117 ++++++++++++++++-------------------- mln/accu/internal/base.hh | 8 +- mln/accu/max.hh | 2 mln/accu/max_h.hh | 78 ++++++++++-------------- mln/accu/mean.hh | 2 mln/accu/median.hh | 2 mln/accu/median_alt.hh | 2 mln/accu/min.hh | 2 mln/accu/min_h.hh | 79 ++++++++++-------------- mln/accu/nil.hh | 2 mln/accu/p.hh | 2 mln/accu/pair.hh | 2 mln/accu/rank_bool.hh | 2 mln/accu/rank_high_quant.hh | 2 mln/accu/sum.hh | 2 mln/accu/tuple.hh | 2 mln/accu/v.hh | 2 mln/accu/volume.hh | 2 mln/core/routine/ops.hh | 4 - mln/histo/data.hh | 19 +++++ mln/value/int_u.hh | 4 - tests/accu/max_h.cc | 2 tests/accu/min_h.cc | 4 - 27 files changed, 170 insertions(+), 181 deletions(-) Index: tests/accu/max_h.cc --- tests/accu/max_h.cc (revision 2226) +++ tests/accu/max_h.cc (working copy) @@ -39,7 +39,7 @@ using namespace mln; using namespace mln::value; - accu::max_h< set<int_u8> > a; + accu::max_h<int_u8> a; a.take(1); a.take(1); Index: tests/accu/min_h.cc --- tests/accu/min_h.cc (revision 2226) +++ tests/accu/min_h.cc (working copy) @@ -34,12 +34,14 @@ #include <mln/accu/min_h.hh> + + int main() { using namespace mln; using namespace mln::value; - accu::min_h< set<int_u8> > a; + accu::min_h<int_u8> a; a.take(42); a.take(42); Index: mln/histo/data.hh --- mln/histo/data.hh (revision 2226) +++ mln/histo/data.hh (working copy) @@ -63,6 +63,9 @@ const std::vector<std::size_t>& vect() const; const mln::value::set<T>& vset() const; std::size_t operator[](unsigned i) const; + std::size_t& operator[](unsigned i); + + std::size_t nvalues() const; protected: @@ -130,6 +133,15 @@ template <typename T> inline + std::size_t& + data<T>::operator[](unsigned i) + { + mln_precondition(i < s_.nvalues()); + return h_[i]; + } + + template <typename T> + inline const std::vector<std::size_t>& data<T>::vect() const { @@ -138,6 +150,13 @@ template <typename T> inline + std::size_t data<T>::nvalues() const + { + return h_.size(); + } + + template <typename T> + inline std::ostream& operator<<(std::ostream& ostr, const data<T>& h) { mln_viter(mln::value::set<T>) v(h.vset()); Index: mln/core/routine/ops.hh --- mln/core/routine/ops.hh (revision 2226) +++ mln/core/routine/ops.hh (working copy) @@ -80,11 +80,9 @@ * \todo Complete those definitions (...) + Overload for const (?) */ +# include <mln/trait/op/all.hh> # include <mln/core/concept/object.hh> # include <mln/metal/converts_to.hh> -# include <mln/trait/op/all.hh> - - namespace mln { Index: mln/accu/nil.hh --- mln/accu/nil.hh (revision 2226) +++ mln/accu/nil.hh (working copy) @@ -51,7 +51,7 @@ * \brief Define an accumulator that does nothing. */ template <typename T> - struct nil_ : public mln::accu::internal::base_< util::ignore , nil_<T> > + struct nil_ : public mln::accu::internal::base< util::ignore , nil_<T> > { typedef util::eat argument; typedef util::ignore result; Index: mln/accu/min.hh --- mln/accu/min.hh (revision 2226) +++ mln/accu/min.hh (working copy) @@ -51,7 +51,7 @@ * The parameter \c T is the type of values. */ template <typename T> - struct min_ : public mln::accu::internal::base_< T, min_<T> > + struct min_ : public mln::accu::internal::base< T, min_<T> > { typedef T argument; typedef T result; Index: mln/accu/count_adjacent_vertices.hh --- mln/accu/count_adjacent_vertices.hh (revision 2226) +++ mln/accu/count_adjacent_vertices.hh (working copy) @@ -54,7 +54,7 @@ /// mln::opening_area_on_vertices. template <typename P, typename V> struct count_adjacent_vertices_ - : public mln::accu::internal::base_< std::size_t, + : public mln::accu::internal::base< std::size_t, count_adjacent_vertices_<P, V> > { typedef mln::util::pix< mln::line_graph_image<P, V> > argument; Index: mln/accu/max.hh --- mln/accu/max.hh (revision 2226) +++ mln/accu/max.hh (working copy) @@ -51,7 +51,7 @@ * The parameter \c T is the type of values. */ template <typename T> - struct max_ : public mln::accu::internal::base_< T , max_<T> > + struct max_ : public mln::accu::internal::base< T , max_<T> > { typedef T argument; typedef T result; Index: mln/accu/histo.hh --- mln/accu/histo.hh (revision 2226) +++ mln/accu/histo.hh (working copy) @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 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 @@ -41,7 +41,7 @@ # include <mln/core/concept/value_set.hh> # include <mln/accu/internal/base.hh> # include <mln/value/set.hh> - +# include <mln/histo/data.hh> namespace mln { @@ -51,19 +51,20 @@ /*! - * \brief Generic histogram class over a value set with type \c S. + * \brief Generic histogram class over a value set with type \c V. */ - template <typename S> - struct histo : public mln::accu::internal::base_< const std::vector<std::size_t>& , histo<S> > + template <typename V> + struct histo : + public mln::accu::internal::base<const std::vector<std::size_t>& , + histo<V> > { - histo(const Value_Set<S>& s); histo(); - typedef mln_value(S) argument; + typedef V argument; typedef const std::vector<std::size_t>& result; void take(const argument& t); - void take(const histo<S>& other); + void take(const histo<V>& other); void untake(const argument& t); void init(); @@ -75,142 +76,130 @@ const std::vector<std::size_t>& vect() const; const std::vector<std::size_t>& to_result() const; - const S& vset() const; + const value::set<V>& vset() const; protected: - const S& s_; - std::vector<std::size_t> h_; + mln::histo::data<V> h_; std::size_t sum_; }; - template <typename S> - std::ostream& operator<<(std::ostream& ostr, const histo<S>& h); + template <typename V> + std::ostream& operator<<(std::ostream& ostr, const histo<V>& h); # ifndef MLN_INCLUDE_ONLY - template <typename S> - inline - histo<S>::histo(const Value_Set<S>& s) - : s_(exact(s)), - h_(s_.nvalues(), 0), - sum_(0) - { - } - - template <typename S> + template <typename V> inline - histo<S>::histo() - : s_(S::the()), - h_(s_.nvalues(), 0), + histo<V>::histo() + : h_(), sum_(0) { } - template <typename S> + template <typename V> inline void - histo<S>::take(const argument& t) + histo<V>::take(const argument& t) { - ++h_[s_.index_of(t)]; + ++h_[h_.vset().index_of(t)]; ++sum_; } - template <typename S> + template <typename V> inline void - histo<S>::take(const histo<S>& other) + histo<V>::take(const histo<V>& other) { - for (unsigned i = 0; i < h_.size(); ++i) + for (unsigned i = 0; i < h_.nvalues(); ++i) h_[i] += other.h_[i]; sum_ += other.sum_; } - template <typename S> + template <typename V> inline void - histo<S>::untake(const argument& t) + histo<V>::untake(const argument& t) { - mln_precondition(h_[s_.index_of(t)] > 0); + mln_precondition(h_[h_.vset().index_of(t)] > 0); mln_precondition(sum_ > 0); - --h_[s_.index_of(t)]; + --h_[h_.vset().index_of(t)]; --sum_; } - template <typename S> + template <typename V> inline void - histo<S>::init() + histo<V>::init() { - std::fill(h_.begin(), h_.end(), 0); - sum_ = 0; + h_.clear(); } - template <typename S> + template <typename V> inline std::size_t - histo<S>::operator()(const argument& t) const + histo<V>::operator()(const argument& t) const { - return h_[s_.index_of(t)]; + return h_[h_.vset().index_of(t)]; } - template <typename S> + template <typename V> inline std::size_t - histo<S>::operator[](unsigned i) const + histo<V>::operator[](unsigned i) const { - mln_precondition(i < s_.nvalues()); + mln_precondition(i < h_.vset().nvalues()); return h_[i]; } - template <typename S> + template <typename V> inline unsigned - histo<S>::nvalues() const + histo<V>::nvalues() const { - return s_.nvalues(); + return h_.vset().nvalues(); } - template <typename S> + template <typename V> inline std::size_t - histo<S>::sum() const + histo<V>::sum() const { return sum_; } - template <typename S> + template <typename V> inline const std::vector<std::size_t>& - histo<S>::vect() const + histo<V>::vect() const { - return h_; + return h_.vect(); } - template <typename S> + template <typename V> inline const std::vector<std::size_t>& - histo<S>::to_result() const + histo<V>::to_result() const { - return h_; + return this->vect(); } - template <typename S> + template <typename V> inline - const S& - histo<S>::vset() const + const value::set<V>& + histo<V>::vset() const { - return s_; + return h_.vset(); } - template <typename S> + template <typename V> inline - std::ostream& operator<<(std::ostream& ostr, const histo<S>& h) + std::ostream& operator<<(std::ostream& ostr, const histo<V>& h) { - mln_viter(S) v(h.vset()); + mln_viter(V) v(h.vset()); for_all(v) if (h(v) != 0) ostr << v << ':' << h(v) << ' '; Index: mln/accu/count.hh --- mln/accu/count.hh (revision 2226) +++ mln/accu/count.hh (working copy) @@ -43,7 +43,7 @@ /// \brief Generic counter accumulator class. /// The parameter \a T is the type to be count. template <typename T> - struct count_ : public mln::accu::internal::base_< std::size_t , count_<T> > + struct count_ : public mln::accu::internal::base< std::size_t , count_<T> > { typedef T argument; Index: mln/accu/tuple.hh --- mln/accu/tuple.hh (revision 2226) +++ mln/accu/tuple.hh (working copy) @@ -72,7 +72,7 @@ */ template <typename A, unsigned n, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(10, typename T, boost::tuples::null_type)> struct tuple_ - : public mln::accu::internal::base_< boost::tuple< BOOST_PP_REPEAT(10, RESULT_ACCU, Le Ricard ya que ca de vrai !) > , tuple_<A, n, BOOST_PP_ENUM_PARAMS(10, T)> > + : public mln::accu::internal::base< boost::tuple< BOOST_PP_REPEAT(10, RESULT_ACCU, Le Ricard ya que ca de vrai !) > , tuple_<A, n, BOOST_PP_ENUM_PARAMS(10, T)> > { typedef A argument; Index: mln/accu/bbox.hh --- mln/accu/bbox.hh (revision 2226) +++ mln/accu/bbox.hh (working copy) @@ -49,7 +49,7 @@ * The parameter \c P is the type of points. */ template <typename P> - struct bbox : public mln::accu::internal::base_< const box<P>& , bbox<P> > + struct bbox : public mln::accu::internal::base< const box<P>& , bbox<P> > { typedef P argument; typedef const box<P>& result; Index: mln/accu/min_h.hh --- mln/accu/min_h.hh (revision 2226) +++ mln/accu/min_h.hh (working copy) @@ -35,6 +35,7 @@ # include <mln/accu/internal/base.hh> # include <mln/accu/histo.hh> +# include <mln/value/set.hh> namespace mln @@ -45,33 +46,32 @@ /*! \brief Generic min function based on histogram over a value - * set with type \c S. + * set with type \c V. */ - template <typename S> - struct min_h : public mln::accu::internal::base_< mln_value(S) , min_h<S> > + template <typename V> + struct min_h : public mln::accu::internal::base< V , min_h<V> > { - typedef mln_value(S) argument; + typedef V argument; typedef argument result; - min_h(const Value_Set<S>& s); min_h(); void init(); void take(const argument& t); void take_as_init(const argument& t); - void take(const min_h<S>& other); + void take(const min_h<V>& other); void untake(const argument& t); unsigned card() const { return h_.sum(); } result to_result() const; - const accu::histo<S>& histo() const; + const accu::histo<V>& histo() const; protected: - mutable accu::histo<S> h_; - const S& s_; // derived from h_ + mutable accu::histo<V> h_; + const value::set<V>& s_; // derived from h_ mutable std::size_t sum_; mutable bool valid_; @@ -87,28 +87,19 @@ # ifndef MLN_INCLUDE_ONLY - template <typename S> + template <typename V> inline - min_h<S>::min_h(const Value_Set<S>& s) - : h_(s), - s_(h_.vset()) - { - init(); - } - - template <typename S> - inline - min_h<S>::min_h() + min_h<V>::min_h() : h_(), s_(h_.vset()) { init(); } - template <typename S> + template <typename V> inline void - min_h<S>::take(const argument& t) + min_h<V>::take(const argument& t) { h_.take(t); if (h_.sum() == 1) @@ -123,10 +114,10 @@ } } - template <typename S> + template <typename V> inline void - min_h<S>::take(const min_h<S>& other) + min_h<V>::take(const min_h<V>& other) { // h_ h_.take(other.h_); @@ -136,10 +127,10 @@ // FIXME: Optimize. } - template <typename S> + template <typename V> inline void - min_h<S>::untake(const argument& t) + min_h<V>::untake(const argument& t) { mln_precondition(h_(t) != 0); h_.untake(t); @@ -159,10 +150,10 @@ valid_ = false; } - template <typename S> + template <typename V> inline void - min_h<S>::update_() const + min_h<V>::update_() const { if (sum_ != 0) go_minus_(); @@ -172,10 +163,10 @@ valid_ = true; } - template <typename S> + template <typename V> inline void - min_h<S>::go_minus_() const + min_h<V>::go_minus_() const { do { @@ -187,10 +178,10 @@ t_ = s_[i_]; } - template <typename S> + template <typename V> inline void - min_h<S>::go_plus_() const + min_h<V>::go_plus_() const { do ++i_; @@ -198,10 +189,10 @@ t_ = s_[i_]; } - template <typename S> + template <typename V> inline void - min_h<S>::init() + min_h<V>::init() { h_.init(); sum_ = 0; @@ -210,10 +201,10 @@ valid_ = true; } - template <typename S> + template <typename V> inline void - min_h<S>::take_as_init(const argument& t) + min_h<V>::take_as_init(const argument& t) { h_.take(t); sum_ = 0; @@ -222,27 +213,27 @@ valid_ = true; } - template <typename S> + template <typename V> inline - typename min_h<S>::argument - min_h<S>::to_result() const + typename min_h<V>::argument + min_h<V>::to_result() const { if (! valid_) update_(); return t_; } - template <typename S> + template <typename V> inline - const accu::histo<S>& - min_h<S>::histo() const + const accu::histo<V>& + min_h<V>::histo() const { return h_; } - template <typename S> + template <typename V> inline - std::ostream& operator<<(std::ostream& ostr, const min_h<S>& m) + std::ostream& operator<<(std::ostream& ostr, const min_h<V>& m) { return ostr << m.to_result(); } Index: mln/accu/pair.hh --- mln/accu/pair.hh (revision 2226) +++ mln/accu/pair.hh (working copy) @@ -56,7 +56,7 @@ * \todo Check that, when T is not provided, A1 and A2 have the same value. */ template <typename A1, typename A2, typename T = mln_argument(A1)> - struct pair_ : public mln::accu::internal::base_< std::pair< mlc_unqualif(mln_result(A1)) , mlc_unqualif(mln_result(A2)) > , pair_<A1,A2,T> > + struct pair_ : public mln::accu::internal::base< std::pair< mlc_unqualif(mln_result(A1)) , mlc_unqualif(mln_result(A2)) > , pair_<A1,A2,T> > { typedef T argument; Index: mln/accu/max_h.hh --- mln/accu/max_h.hh (revision 2226) +++ mln/accu/max_h.hh (working copy) @@ -45,33 +45,32 @@ /*! \brief Generic max function based on histogram over a value set with - * type \c S. + * type \c V. */ - template <typename S> - struct max_h : public mln::accu::internal::base_< mln_value(S) , max_h<S> > + template <typename V> + struct max_h : public mln::accu::internal::base< V, max_h<V> > { - typedef mln_value(S) argument; + typedef V argument; typedef argument result; - max_h(const Value_Set<S>& s); max_h(); void init(); void take(const argument& t); void take_as_init(const argument& t); - void take(const max_h<S>& other); + void take(const max_h<V>& other); void untake(const argument& t); unsigned card() const { return h_.sum(); } argument to_result() const; - const accu::histo<S>& histo() const; + const accu::histo<V>& histo() const; protected: - mutable accu::histo<S> h_; - const S& s_; // derived from h_ + mutable accu::histo<V> h_; + const value::set<V>& s_; // derived from h_ mutable std::size_t sum_; mutable bool valid_; @@ -87,28 +86,19 @@ # ifndef MLN_INCLUDE_ONLY - template <typename S> + template <typename V> inline - max_h<S>::max_h(const Value_Set<S>& s) - : h_(s), - s_(h_.vset()) - { - init(); - } - - template <typename S> - inline - max_h<S>::max_h() + max_h<V>::max_h() : h_(), s_(h_.vset()) { init(); } - template <typename S> + template <typename V> inline void - max_h<S>::take(const argument& t) + max_h<V>::take(const argument& t) { h_.take(t); if (h_.sum() == 1) @@ -123,10 +113,10 @@ } } - template <typename S> + template <typename V> inline void - max_h<S>::take(const max_h<S>& other) + max_h<V>::take(const max_h<V>& other) { // h_ h_.take(other.h_); @@ -136,10 +126,10 @@ // FIXME: Optimize. } - template <typename S> + template <typename V> inline void - max_h<S>::untake(const argument& t) + max_h<V>::untake(const argument& t) { mln_precondition(h_(t) != 0); h_.untake(t); @@ -159,10 +149,10 @@ valid_ = false; } - template <typename S> + template <typename V> inline void - max_h<S>::update_() const + max_h<V>::update_() const { if (sum_ != 0) go_plus_(); @@ -172,10 +162,10 @@ valid_ = true; } - template <typename S> + template <typename V> inline void - max_h<S>::go_minus_() const + max_h<V>::go_minus_() const { do --i_; @@ -183,10 +173,10 @@ t_ = s_[i_]; } - template <typename S> + template <typename V> inline void - max_h<S>::go_plus_() const + max_h<V>::go_plus_() const { do { @@ -197,10 +187,10 @@ t_ = s_[i_]; } - template <typename S> + template <typename V> inline void - max_h<S>::init() + max_h<V>::init() { h_.init(); sum_ = 0; @@ -209,10 +199,10 @@ valid_ = true; } - template <typename S> + template <typename V> inline void - max_h<S>::take_as_init(const argument& t) + max_h<V>::take_as_init(const argument& t) { h_.take(t); sum_ = 0; @@ -221,27 +211,27 @@ valid_ = true; } - template <typename S> + template <typename V> inline - typename max_h<S>::argument - max_h<S>::to_result() const + typename max_h<V>::argument + max_h<V>::to_result() const { if (! valid_) update_(); return t_; } - template <typename S> + template <typename V> inline - const accu::histo<S>& - max_h<S>::histo() const + const accu::histo<V>& + max_h<V>::histo() const { return h_; } - template <typename S> + template <typename V> inline - std::ostream& operator<<(std::ostream& ostr, const max_h<S>& m) + std::ostream& operator<<(std::ostream& ostr, const max_h<V>& m) { return ostr << m.to_result(); } Index: mln/accu/median.hh --- mln/accu/median.hh (revision 2226) +++ mln/accu/median.hh (working copy) @@ -48,7 +48,7 @@ * set with type \c S. */ template <typename S> - struct median : public mln::accu::internal::base_< mln_value(S), median<S> > + struct median : public mln::accu::internal::base< mln_value(S), median<S> > { // FIXME: Should median be named 'median_' like other accumulators ? typedef mln_value(S) argument; typedef argument result; Index: mln/accu/median_alt.hh --- mln/accu/median_alt.hh (revision 2226) +++ mln/accu/median_alt.hh (working copy) @@ -48,7 +48,7 @@ * value set with type \c S. */ template <typename S> - struct median_alt : public mln::accu::internal::base_< mln_value(S), median_alt<S> > + struct median_alt : public mln::accu::internal::base< mln_value(S), median_alt<S> > { typedef mln_value(S) argument; Index: mln/accu/p.hh --- mln/accu/p.hh (revision 2226) +++ mln/accu/p.hh (working copy) @@ -52,7 +52,7 @@ * The parameter \c V is the type of values. */ template <typename A> - struct p_ : public mln::accu::internal::base_< mln_result(A) , p_<A> > + struct p_ : public mln::accu::internal::base< mln_result(A) , p_<A> > { typedef mln_argument(A) argument; typedef mln_result(A) result; Index: mln/accu/rank_high_quant.hh --- mln/accu/rank_high_quant.hh (revision 2226) +++ mln/accu/rank_high_quant.hh (working copy) @@ -52,7 +52,7 @@ * The parameter \c T is the type of values. */ template <typename T> - struct rank_ : public mln::accu::internal::base_< T, rank_<T> > + struct rank_ : public mln::accu::internal::base< T, rank_<T> > { typedef T argument; typedef T result; Index: mln/accu/sum.hh --- mln/accu/sum.hh (revision 2226) +++ mln/accu/sum.hh (working copy) @@ -57,7 +57,7 @@ * \c S is the summation type (property) of \c T. */ template <typename T, typename S = mln_sum(T)> - struct sum_ : public mln::accu::internal::base_< S, sum_<T,S> > + struct sum_ : public mln::accu::internal::base< S, sum_<T,S> > { typedef T argument; typedef S result; Index: mln/accu/v.hh --- mln/accu/v.hh (revision 2226) +++ mln/accu/v.hh (working copy) @@ -50,7 +50,7 @@ * \brief Generic val of accumulators. */ template <typename A> - struct val_ : public mln::accu::internal::base_< mln_result(A) , val_<A> > + struct val_ : public mln::accu::internal::base< mln_result(A) , val_<A> > { typedef mln_argument(A) argument; typedef mln_result(A) result; Index: mln/accu/rank_bool.hh --- mln/accu/rank_bool.hh (revision 2226) +++ mln/accu/rank_bool.hh (working copy) @@ -53,7 +53,7 @@ * */ template <> - struct rank_<bool> : public mln::accu::internal::base_< bool, rank_<bool> > + struct rank_<bool> : public mln::accu::internal::base< bool, rank_<bool> > { typedef bool argument; typedef bool result; Index: mln/accu/volume.hh --- mln/accu/volume.hh (revision 2226) +++ mln/accu/volume.hh (working copy) @@ -58,7 +58,7 @@ /// of pixels is built. template <typename I> struct volume_ - : public mln::accu::internal::base_< std::size_t , volume_<I> > + : public mln::accu::internal::base< std::size_t , volume_<I> > { /// \brief The accumulated data type. /// Index: mln/accu/height.hh --- mln/accu/height.hh (revision 2226) +++ mln/accu/height.hh (working copy) @@ -59,7 +59,7 @@ /// of pixels is built. template <typename I> struct height_ - : public mln::accu::internal::base_< std::size_t , height_<I> > + : public mln::accu::internal::base< std::size_t , height_<I> > { /// \brief The accumulated data type. /// Index: mln/accu/internal/base.hh --- mln/accu/internal/base.hh (revision 2226) +++ mln/accu/internal/base.hh (working copy) @@ -50,7 +50,7 @@ * Base class for implementation of accumulator classes. */ template <typename R, typename E> - class base_ : public Accumulator<E>, + class base : public Accumulator<E>, public mln::internal::proxy_impl< R, E > { public: @@ -62,7 +62,7 @@ typedef R result; protected: - base_(); + base(); }; @@ -70,14 +70,14 @@ template <typename R, typename E> inline - base_<R,E>::base_() + base<R,E>::base() { } template <typename R, typename E> inline R - base_<R,E>::subj_() + base<R,E>::subj_() { return exact(this)->to_result(); } Index: mln/accu/mean.hh --- mln/accu/mean.hh (revision 2226) +++ mln/accu/mean.hh (working copy) @@ -58,7 +58,7 @@ template <typename T, typename S = mln_sum(T), typename M = S> - struct mean_ : public mln::accu::internal::base_< M , mean_<T,S,M> > + struct mean_ : public mln::accu::internal::base< M , mean_<T,S,M> > { typedef T argument; typedef M result; Index: mln/value/int_u.hh --- mln/value/int_u.hh (revision 2226) +++ mln/value/int_u.hh (working copy) @@ -33,6 +33,8 @@ * \brief Define a generic class for unsigned integers. */ +# include <mln/trait/all.hh> // FIXME! + # include <mln/value/ops.hh> # include <mln/metal/math/pow.hh> @@ -40,8 +42,6 @@ # include <mln/value/internal/encoding.hh> # include <mln/value/concept/integer.hh> # include <mln/trait/value_.hh> -# include <mln/trait/all.hh> // FIXME! -# include <mln/trait/value_.hh> # include <mln/debug/format.hh>