Skip to content
Snippets Groups Projects

KLMixture: Use ctor with num of elements

1 file
+ 3
5
Compare changes
  • Side-by-side
  • Inline
@@ -196,14 +196,12 @@ findMerges(Component1D* componentsIn,
@@ -196,14 +196,12 @@ findMerges(Component1D* componentsIn,
const int32_t n = inputSize;
const int32_t n = inputSize;
const int32_t nn = n * (n - 1) / 2;
const int32_t nn = n * (n - 1) / 2;
// Create a trianular mapping for the pairwise distances
// Create a trianular mapping for the pairwise distances
std::vector<triangularToIJ> convert;
// We now that the size is nn
convert.reserve(nn);
std::vector<triangularToIJ> convert(nn);
for (int32_t i = 1; i < n; ++i) {
for (int32_t i = 1; i < n; ++i) {
const int indexConst = (i - 1) * i / 2;
const int indexConst = (i - 1) * i / 2;
for (int32_t j = 0; j < i; ++j) {
for (int32_t j = 0; j < i; ++j) {
int32_t index = indexConst + j;
convert[indexConst + j] = { i, j };
convert[index] = { i, j };
}
}
}
}
// We need to work with multiple of 8, in principle this is a requirement
// We need to work with multiple of 8, in principle this is a requirement
Loading