Skip to content

Commit

Permalink
[Similarity] A few steps toward less memory leaks with the similarity…
Browse files Browse the repository at this point in the history
… search.
  • Loading branch information
christofmuc committed Nov 16, 2023
1 parent 79d6543 commit 39bc2b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions The-Orm/SimilarPatchesPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ void SimilarPatchesPanel::changeListenerCallback(ChangeBroadcaster* source)
{
if (UIModel::currentPatch().patch()) {
// Build the VPtree
EuklidMass cityBlock;


// Load the patches
auto allPatches = db_.getPatches(patchView_->currentFilter(), 0, -1);
auto max_element = std::max_element(allPatches.cbegin(), allPatches.cend(), [](midikraft::PatchHolder const& a, midikraft::PatchHolder const& b) {
Expand All @@ -68,7 +67,7 @@ void SimilarPatchesPanel::changeListenerCallback(ChangeBroadcaster* source)
}
auto featureSet = new MerkmalsMenge((int)allPatches.size(), features);

VPBaum vp_tree("test.vp", &cityBlock, (int)max_dimension, 16, 2);
VPBaum vp_tree("test.vp", std::make_unique<EuklidMass>(), (int)max_dimension, 16, 2);
long start = vp_tree.speichereMenge(featureSet);
vp_tree.info.startSeite = start;
vp_tree.speichereInfo();
Expand Down
2 changes: 1 addition & 1 deletion vp-baum

0 comments on commit 39bc2b4

Please sign in to comment.