60 template <
typename GUM_SCALAR >
65 template <
typename GUM_SCALAR >
71 template <
typename GUM_SCALAR >
76 template <
typename GUM_SCALAR >
83 template <
typename GUM_SCALAR >
88 template <
typename GUM_SCALAR >
95 std::vector< Idx > cum(maxVal, 0);
100 Idx half = (this->nbrDim() + 1) / 2;
103 for (
Idx j = 0, sumcum = 0; j < maxVal; j++)
104 if ((sumcum += cum[j]) >= half) {
109 for (
Idx j = maxVal - 1, jj = 0, sumcum = 0; jj < maxVal; jj++, j--)
110 if ((sumcum += cum[j]) >= half) {
116 return (maxR + max) / 2;
119 template <
typename GUM_SCALAR >
123 bool& stop_iteration)
const {
Base class for discrete random variable.
virtual Size domainSize() const =0
Class for assigning/browsing values to tuples of discrete variables.
Idx val(Idx i) const
Returns the current value of the variable at position i.
const DiscreteVariable & variable(Idx i) const final
Returns the variable at position i in the tuple.
Idx nbrDim() const final
Returns the number of variables in the Instantiation.
Abstract base class for all multi dimensionnal containers.
virtual Idx nbrDim() const override
Returns the number of vars in the multidimensional container.
MultiDimAggregator()
Default constructor.
Size Idx
Type for indexes.
Aggregators are functional description of CPTs.
gum is the global namespace for all aGrUM entities