26 #ifndef MLN_ACCU_COUNT_LABELS_HH
27 # define MLN_ACCU_COUNT_LABELS_HH
33 # include <mln/accu/internal/base.hh>
34 # include <mln/core/concept/meta_accumulator.hh>
35 # include <mln/metal/is_a.hh>
41 namespace value {
template <
typename E>
struct Symbolic; }
53 :
public mln::accu::internal::base< unsigned , count_labels<L> >
63 void take(
const argument&);
79 unsigned count_labels_;
80 std::vector<bool> deja_vu_;
101 # ifndef MLN_INCLUDE_ONLY
103 template <
typename L>
110 template <
typename L>
116 deja_vu_.resize(mln_max(L),
false);
119 template <
typename L>
133 template <
typename L>
136 count_labels<L>::take(
const count_labels<L>& other)
138 count_labels_ += other.count_labels_;
139 for (
unsigned i = 0; i < deja_vu_.size(); ++i)
140 deja_vu_[i] = deja_vu_[i] || other.deja_vu_[i];
143 template <
typename L>
149 return count_labels_ - 1;
152 template <
typename L>
160 template <
typename L>
168 # endif // ! MLN_INCLUDE_ONLY
175 #endif // ! MLN_ACCU_COUNT_LABELS_HH