29 #include <agrum/tools/multidim/aggregators/count.h> 34 namespace aggregator {
35 template <
typename GUM_SCALAR >
36 INLINE Count< GUM_SCALAR >::Count(Idx value) :
37 MultiDimAggregator< GUM_SCALAR >(), _value_(value) {
38 GUM_CONSTRUCTOR(Count);
41 template <
typename GUM_SCALAR >
42 INLINE Count< GUM_SCALAR >::Count(
const Count< GUM_SCALAR >& from) :
43 MultiDimAggregator< GUM_SCALAR >(from) {
44 _value_ = from._value_;
48 template <
typename GUM_SCALAR >
49 INLINE Count< GUM_SCALAR >::~Count() {
50 GUM_DESTRUCTOR(Count);
53 template <
typename GUM_SCALAR >
54 INLINE Idx Count< GUM_SCALAR >::neutralElt_()
const {
58 template <
typename GUM_SCALAR >
59 INLINE Idx Count< GUM_SCALAR >::fold_(
const DiscreteVariable& v,
62 bool& stop_iteration)
const {
63 return (i1 == _value_) ? 1 + i2 : i2;
66 template <
typename GUM_SCALAR >
67 INLINE std::string Count< GUM_SCALAR >::aggregatorName()
const {
69 ss <<
"count[" << _value_ <<
"]";
73 template <
typename GUM_SCALAR >
74 INLINE MultiDimContainer< GUM_SCALAR >* Count< GUM_SCALAR >::newFactory()
const {
75 return new Count< GUM_SCALAR >(_value_);