BallBound does not accept an instantiated metric so this test cannot work. (It didn't anyway.)

This commit is contained in:
Ryan Curtin
2024-06-15 11:09:15 -04:00
parent f6686af6b3
commit 1c8d0fbb3c
-25
View File
@@ -1655,31 +1655,6 @@ TEST_CASE("BallTreeTest", "[TreeTest]")
}
}
/**
* Ensure that we can build a ball tree with a custom instantiated distance
* type.
*/
TEST_CASE("MahalanobisBallTreeTest", "[TreeTest]")
{
arma::mat dataset(10, 1000, arma::fill::randu);
arma::mat cov = arma::eye<arma::mat>(10, 10);
cov(2, 2) = 2.0; // Just so it's not completely the identity matrix.
MahalanobisDistance<> m(std::move(cov));
typedef BallTree<MahalanobisDistance<>, EmptyStatistic, arma::mat> TreeType;
TreeType tree(dataset);
// As long as it built successfully, I am okay with that.
REQUIRE(tree.NumDescendants() == 1000);
// Also test when we give oldFromNew, since this uses a different code path.
std::vector<size_t> oldFromNew;
TreeType tree2(std::move(dataset), oldFromNew);
REQUIRE(tree.NumDescendants() == 1000);
}
template<typename TreeType>
void GenerateVectorOfTree(TreeType* node,
size_t depth,