27 #ifndef MLN_ACCU_CENTER_HH
28 # define MLN_ACCU_CENTER_HH
36 # include <mln/accu/internal/base.hh>
37 # include <mln/accu/shape/bbox.hh>
54 template <
typename P,
typename V =
typename P::vec>
56 :
public mln::accu::internal::base<V, center<P,V> >
66 void take(
const argument& t);
81 algebra::vec<P::dim, mln_sum(mln_coord(P))> center_;
104 # ifndef MLN_INCLUDE_ONLY
106 template <
typename P,
typename V>
113 template <
typename P,
typename V>
122 template <
typename P,
typename V>
126 center_ += t.to_vec();
130 template <
typename P,
typename V>
133 center<P,V>::take(
const center<P,V>& other)
135 center_ += other.center_;
136 nsites_ += other.nsites_;
139 template <
typename P,
typename V>
147 return center_ / nsites_;
150 template <
typename P,
typename V>
154 return P(to_result());
157 template <
typename P,
typename V>
165 template <
typename P,
typename V>
173 # endif // ! MLN_INCLUDE_ONLY
181 #endif // ! MLN_ACCU_CENTER_HH