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 >*
75 Count< GUM_SCALAR >::newFactory()
const {
76 return new Count< GUM_SCALAR >(value__);