Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using rvalue references to set a given reference tree in FastMKS and DualTreeBoruvka #799

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mlpack/methods/fastmks/fastmks_model_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ void BuildFastMKSModel(FastMKS<KernelType>& f,
// Create the tree with the specified base.
Timer::Start("tree_building");
metric::IPMetric<KernelType> metric(k);
typename FastMKS<KernelType>::Tree tree(referenceData, metric, base);
typename FastMKS<KernelType>::Tree tree(std::move(referenceData), metric, base);
Timer::Stop("tree_building");

f.Train(tree);
f.Train(std::move(tree));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/mlpack/tests/fastmks_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ BOOST_AUTO_TEST_CASE(FastMKSModelLinearTest)
m.Search(3, mIndices, mKernels);
mNaive.Search(3, mNaiveIndices, mNaiveKernels);
mSingle.Search(3, mSingleIndices, mSingleKernels);

BOOST_REQUIRE_EQUAL(indices.n_cols, mIndices.n_cols);
BOOST_REQUIRE_EQUAL(indices.n_cols, mNaiveIndices.n_cols);
BOOST_REQUIRE_EQUAL(indices.n_cols, mSingleIndices.n_cols);
Expand Down