From 310e72d7afeb952bb08a0d0dabf16cc605178528 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 14 Sep 2016 13:24:00 -0400 Subject: [PATCH] Attempt to fix failing build for old Armadillo versions. It seems as though the old Armadillo versions do not implement '||' either, so I replaced that with +, which does the same thing in the context of booleans. --- src/mlpack/tests/lsh_test.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mlpack/tests/lsh_test.cpp b/src/mlpack/tests/lsh_test.cpp index a5fb379a86..60ea3a0dee 100644 --- a/src/mlpack/tests/lsh_test.cpp +++ b/src/mlpack/tests/lsh_test.cpp @@ -595,16 +595,17 @@ BOOST_AUTO_TEST_CASE(MultiprobeDeterministicTest) // Test that q1 search with 1 additional probe returns some C2 points. // We use the schur product (%) instead of logical and (&&) to handle an early - // Armadillo bug. + // Armadillo bug, and we also use boolean addition (+) instead of logical or + // (||). lshTest.Search(q1, k, neighbors, distances, 0, 1); BOOST_REQUIRE(arma::all( - (neighbors.col(0) == N) || + (neighbors.col(0) == N) + ((neighbors.col(0) >= N / 4) % (neighbors.col(0) < N / 2)))); // Test that q2 simple search returns some C2 points. lshTest.Search(q2, k, neighbors, distances); BOOST_REQUIRE(arma::all( - neighbors.col(0) == N || + (neighbors.col(0) == N) + ((neighbors.col(0) >= N / 4) % (neighbors.col(0) < N / 2)))); // Test that q2 with 3 additional probes returns all C2 points.