Skip to content

Commit

Permalink
Fix bug due to non intialized vector.
Browse files Browse the repository at this point in the history
  • Loading branch information
astamm committed Oct 27, 2023
1 parent a2b744b commit 9c134ba
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "animaDirichletDistribution.h"
#include <animaGammaFunctions.h>

#include <cmath>

#include <itkMacro.h>

namespace anima
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 9c134ba

Please sign in to comment.