diff --git a/include/hpp/statistics/distribution.hh b/include/hpp/statistics/distribution.hh index 5e1029cdae773f32dbdf813b6cdbf13dd6c0b4da..92bd3b24f84009bb21b97f352a9777b80b41a9cf 100644 --- a/include/hpp/statistics/distribution.hh +++ b/include/hpp/statistics/distribution.hh @@ -107,6 +107,12 @@ namespace hpp { return proba; } + /// Return the total weight. + Weight_t totalWeight () const { + if (cumulative_weights_.empty ()) return 0; + return cumulative_weights_.back (); + } + /// \name Iterators /// Iterate on the values. /// \{