From 9c134ba3f7099f7d1e003c146277b59990a3a3d1 Mon Sep 17 00:00:00 2001 From: Aymeric Stamm Date: Fri, 27 Oct 2023 15:07:55 +0200 Subject: [PATCH] Fix bug due to non intialized vector. --- .../statistical_distributions/animaDirichletDistribution.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Anima/math-tools/statistical_distributions/animaDirichletDistribution.cxx b/Anima/math-tools/statistical_distributions/animaDirichletDistribution.cxx index bc79a6803..65e7496ff 100644 --- a/Anima/math-tools/statistical_distributions/animaDirichletDistribution.cxx +++ b/Anima/math-tools/statistical_distributions/animaDirichletDistribution.cxx @@ -1,6 +1,8 @@ #include "animaDirichletDistribution.h" #include + #include + #include namespace anima @@ -224,6 +226,7 @@ void DirichletDistribution::Fit(const MultipleValueType &sample, const std::stri } m_TotalConcentration = alphaSum; + m_MeanValues.resize(numParameters); for (unsigned int i = 0;i < numParameters;++i) m_MeanValues[i] = alphaParameters[i] / alphaSum;