From 0556eaa79dbecbc8a3a3fd8543a86276bb1135c5 Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sat, 11 Jul 2020 14:48:38 +0200 Subject: [PATCH] Mahalabonis ball bound test is compiling Signed-off-by: Omar Shrit --- src/mlpack/tests/serialization_test.cpp | 38 ++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/mlpack/tests/serialization_test.cpp b/src/mlpack/tests/serialization_test.cpp index e6acddd374..2583fbf6a3 100644 --- a/src/mlpack/tests/serialization_test.cpp +++ b/src/mlpack/tests/serialization_test.cpp @@ -181,29 +181,29 @@ BOOST_AUTO_TEST_CASE(BallBoundTest) CheckMatrices(b.Center(), xmlB.Center(), textB.Center(), binaryB.Center()); } -// BOOST_AUTO_TEST_CASE(MahalanobisBallBoundTest) -// { -// BallBound, arma::vec> b(100); -// b.Center().randu(); -// b.Radius() = 14.0; -// b.Metric().Covariance().randu(100, 100); +BOOST_AUTO_TEST_CASE(MahalanobisBallBoundTest) +{ + BallBound, arma::vec> b(100); + b.Center().randu(); + b.Radius() = 14.0; + b.Metric().Covariance().randu(100, 100); -// BallBound, arma::vec> xmlB, textB, binaryB; + BallBound, arma::vec> xmlB, textB, binaryB; -// SerializeObjectAll(b, xmlB, textB, binaryB); + SerializeObjectAll(b, xmlB, textB, binaryB); -// // Check the radius. -// BOOST_REQUIRE_CLOSE(b.Radius(), xmlB.Radius(), 1e-8); -// BOOST_REQUIRE_CLOSE(b.Radius(), textB.Radius(), 1e-8); -// BOOST_REQUIRE_CLOSE(b.Radius(), binaryB.Radius(), 1e-8); + // Check the radius. + BOOST_REQUIRE_CLOSE(b.Radius(), xmlB.Radius(), 1e-8); + BOOST_REQUIRE_CLOSE(b.Radius(), textB.Radius(), 1e-8); + BOOST_REQUIRE_CLOSE(b.Radius(), binaryB.Radius(), 1e-8); -// // Check the vectors. -// CheckMatrices(b.Center(), xmlB.Center(), textB.Center(), binaryB.Center()); -// CheckMatrices(b.Metric().Covariance(), -// xmlB.Metric().Covariance(), -// textB.Metric().Covariance(), -// binaryB.Metric().Covariance()); -// } + // Check the vectors. + CheckMatrices(b.Center(), xmlB.Center(), textB.Center(), binaryB.Center()); + CheckMatrices(b.Metric().Covariance(), + xmlB.Metric().Covariance(), + textB.Metric().Covariance(), + binaryB.Metric().Covariance()); +} // BOOST_AUTO_TEST_CASE(HRectBoundTest) // {