40 namespace aggregator {
41 template <
typename GUM_SCALAR >
46 template <
typename GUM_SCALAR >
52 template <
typename GUM_SCALAR >
57 template <
typename GUM_SCALAR >
64 template <
typename GUM_SCALAR >
70 template <
typename GUM_SCALAR >
78 std::vector< Idx > cum(maxVal, 0);
86 for (
Idx j = 0, sumcum = 0; j < maxVal; j++)
87 if ((sumcum += cum[j]) >= half) {
92 for (
Idx j = maxVal - 1, jj = 0, sumcum = 0; jj < maxVal; jj++, j--)
93 if ((sumcum += cum[j]) >= half) {
99 return (maxR + max) / 2;
102 template <
typename GUM_SCALAR >
106 bool& stop_iteration)
const {
Idx nbrDim() const final
Returns the number of variables in the Instantiation.
Base class for discrete random variable.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Abstract base class for all multi dimensionnal containers.
<agrum/multidim/aggregators/multiDimAggregator.h>
Idx val(Idx i) const
Returns the current value of the variable at position i.
virtual Size domainSize() const =0
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual Idx nbrDim() const override
Returns the number of vars in the multidimensional container.
Class for assigning/browsing values to tuples of discrete variables.
Size Idx
Type for indexes.
const DiscreteVariable & variable(Idx i) const final
Returns the variable at position i in the tuple.