Skip to content
Snippets Groups Projects
Commit 07e14516 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Return an empty vector of probabilities when DiscreteDistribution is

empty.
parent fa284dcb
No related branches found
No related tags found
No related merge requests found
......@@ -99,6 +99,7 @@ namespace hpp {
/// Return the probabilities.
std::vector < Proba_t > probabilities () const {
if (values_.empty ()) return std::vector < Proba_t > (0);
std::vector < Proba_t > proba (values_.size());
Proba_t total = cumulative_weights_.back();
for (size_t i = 0; i < values_.size (); i++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment