[mlpack-git] master: Whitespace fixes (9ef75a4)
gitdub at mlpack.org
gitdub at mlpack.org
Wed Apr 6 04:55:56 EDT 2016
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/5bc514c122d53590397fdfad42c7845d9ad91fa1...f0675d7789b69746f7c337c3ec4a778cef932924
>---------------------------------------------------------------
commit 9ef75a49d449fd5fe7404ace8144ee1e99186739
Author: Yannis Mentekidis <mentekid at gmail.com>
Date: Wed Apr 6 09:55:56 2016 +0100
Whitespace fixes
>---------------------------------------------------------------
9ef75a49d449fd5fe7404ace8144ee1e99186739
src/mlpack/tests/lsh_test.cpp | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/mlpack/tests/lsh_test.cpp b/src/mlpack/tests/lsh_test.cpp
index a04a459..2076ad5 100644
--- a/src/mlpack/tests/lsh_test.cpp
+++ b/src/mlpack/tests/lsh_test.cpp
@@ -27,7 +27,7 @@ double compute_recall(
{
for (size_t n = 0; n < neigh; ++n)
{
- same+=(LSHneighbors(n,q)==groundTruth(n,q));
+ same += (LSHneighbors(n,q) == groundTruth(n,q));
}
}
return static_cast<double>(same)/
@@ -79,8 +79,8 @@ BOOST_AUTO_TEST_CASE(numTablesTest)
bool fail;
for (int t = 0; t < numTries; ++t)
{
-
fail = false;
+
const int lSize = 6; //number of runs
const int lValue[] = {1, 8, 16, 32, 64, 128}; //number of tables
double lValueRecall[lSize] = {0.0}; //recall of each LSH run
@@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE(numTablesTest)
if (l > 0)
{
- if(lValueRecall[l] < lValueRecall[l-1]-epsilon)
+ if(lValueRecall[l] < lValueRecall[l-1] - epsilon)
{
fail = true; //if test fails at one point, stop and retry
break;
@@ -110,6 +110,7 @@ BOOST_AUTO_TEST_CASE(numTablesTest)
if ( !fail )
break; //if test passes one time, it is sufficient
}
+
BOOST_REQUIRE(fail == false);
}
@@ -151,7 +152,7 @@ BOOST_AUTO_TEST_CASE(hashWidthTest)
const double hValue[] = {0.1, 0.5, 1, 5, 10, 50, 500}; //hash width
double hValueRecall[hSize] = {0.0}; //recall of each run
- for (size_t h=0; h < hSize; ++h)
+ for (size_t h = 0; h < hSize; ++h)
{
//run LSH with only hashWidth varying (other values default)
LSHSearch<> lshTest(
@@ -170,7 +171,7 @@ BOOST_AUTO_TEST_CASE(hashWidthTest)
hValueRecall[h] = compute_recall(LSHneighbors, groundTruth);
if (h > 0)
- BOOST_REQUIRE_GE(hValueRecall[h], hValueRecall[h-1]-epsilon);
+ BOOST_REQUIRE_GE(hValueRecall[h], hValueRecall[h-1] - epsilon);
}
}
@@ -216,7 +217,7 @@ BOOST_AUTO_TEST_CASE(numProjTest)
const int pValue[] = {1, 10, 20, 50, 100}; //number of projections
double pValueRecall[pSize] = {0.0}; //recall of each run
- for (size_t p=0; p < pSize; ++p)
+ for (size_t p = 0; p < pSize; ++p)
{
//run LSH with only numProj varying (other values default)
LSHSearch<> lshTest(
More information about the mlpack-git
mailing list