[mlpack-git] master: Attempt to fix failing build for old Armadillo versions. (310e72d)
gitdub at mlpack.org
gitdub at mlpack.org
Wed Sep 14 13:24:00 EDT 2016
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/13611b64d830899e1dddd9490957c988209f302c...310e72d7afeb952bb08a0d0dabf16cc605178528
>---------------------------------------------------------------
commit 310e72d7afeb952bb08a0d0dabf16cc605178528
Author: Ryan Curtin <ryan at ratml.org>
Date: Wed Sep 14 13:24:00 2016 -0400
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.
>---------------------------------------------------------------
310e72d7afeb952bb08a0d0dabf16cc605178528
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 a5fb379..60ea3a0 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.
More information about the mlpack-git
mailing list