Skip to content

Commit

Permalink
Invert a double loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
astamm committed Oct 26, 2023
1 parent 544c6d5 commit a2b744b
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,19 +210,17 @@ int main(int argc, char **argv)
}

correctedInputValues.set_size(nbUsedImages, nbValidComponents);
for (unsigned int i = 0;i < nbUsedImages;++i)
pos = 0;
for (unsigned int j = 0;j < nbComponents;++j)
{
unsigned int posComponent = 0;
for (unsigned int j = 0;j < nbComponents;++j)
if (usefulComponents[j])
{
if (usefulComponents[j])
{
correctedInputValues.put(i, posComponent, inputValues.get(i, j));
posComponent++;
}
for (unsigned int i = 0;i < nbUsedImages;++i)
correctedInputValues.put(i, pos, inputValues.get(i, j));
pos++;
}
}

dirichletDistribution.Fit(correctedInputValues, "mle");
computedOutputValue = dirichletDistribution.GetConcentrationParameters();

Expand Down

0 comments on commit a2b744b

Please sign in to comment.