[mlpack-git] master: Minor style and spacing fixes. (ca1e3ec)
gitdub at mlpack.org
gitdub at mlpack.org
Fri Jul 8 16:27:16 EDT 2016
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/425324bf7fb7c86c85d10a909d8a59d4f69b7164...44c7c3578f5fddb1dc15b42e8c52861ba987a37e
>---------------------------------------------------------------
commit ca1e3ecba3412a14ff25b2ac16011dd8f2a3bfef
Author: Ryan Curtin <ryan at ratml.org>
Date: Fri Jul 8 16:27:16 2016 -0400
Minor style and spacing fixes.
>---------------------------------------------------------------
ca1e3ecba3412a14ff25b2ac16011dd8f2a3bfef
src/mlpack/methods/lsh/lsh_search.hpp | 1 -
src/mlpack/methods/lsh/lsh_search_impl.hpp | 36 +++++++++++++++---------------
2 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/src/mlpack/methods/lsh/lsh_search.hpp b/src/mlpack/methods/lsh/lsh_search.hpp
index f3fff9a..4e6cc97 100644
--- a/src/mlpack/methods/lsh/lsh_search.hpp
+++ b/src/mlpack/methods/lsh/lsh_search.hpp
@@ -208,7 +208,6 @@ class LSHSearch
const size_t numTablesToSearch = 0,
size_t T = 0);
-
/**
* Compute the recall (% of neighbors found) given the neighbors returned by
* LSHSearch::Search and a "ground truth" set of neighbors. The recall
diff --git a/src/mlpack/methods/lsh/lsh_search_impl.hpp b/src/mlpack/methods/lsh/lsh_search_impl.hpp
index 77d4794..794972c 100644
--- a/src/mlpack/methods/lsh/lsh_search_impl.hpp
+++ b/src/mlpack/methods/lsh/lsh_search_impl.hpp
@@ -371,10 +371,10 @@ bool LSHSearch<SortPolicy>::PerturbationShift(std::vector<bool>& A) const
{
size_t maxPos = 0;
for (size_t i = 0; i < A.size(); ++i)
- if (A[i] == 1) // marked true
- maxPos=i;
+ if (A[i] == 1) // Marked true.
+ maxPos = i;
- if ( maxPos + 1 < A.size()) // otherwise, this is an invalid vector
+ if (maxPos + 1 < A.size()) // Otherwise, this is an invalid vector.
{
A[maxPos] = 0;
A[maxPos + 1] = 1;
@@ -387,13 +387,13 @@ template<typename SortPolicy>
inline force_inline
bool LSHSearch<SortPolicy>::PerturbationExpand(std::vector<bool>& A) const
{
- // Find the last '1' in A
+ // Find the last '1' in A.
size_t maxPos = 0;
for (size_t i = 0; i < A.size(); ++i)
- if (A[i]) // marked true
+ if (A[i]) // Marked true.
maxPos = i;
- if (maxPos + 1 < A.size()) // otherwise, this is an invalid vector
+ if (maxPos + 1 < A.size()) // Otherwise, this is an invalid vector.
{
A[maxPos + 1] = 1;
return true;
@@ -827,15 +827,15 @@ void LSHSearch<SortPolicy>::Search(const arma::mat& querySet,
// support unsigned loop variables. If we're building for Visual Studio, use
// the intmax_t type instead.
#pragma omp parallel for \
- shared(resultingNeighbors, distances) \
- schedule(dynamic)\
- reduction(+:avgIndicesReturned)
+ shared(resultingNeighbors, distances) \
+ schedule(dynamic)\
+ reduction(+:avgIndicesReturned)
for (intmax_t i = 0; i < (intmax_t) querySet.n_cols; ++i)
#else
#pragma omp parallel for \
- shared(resultingNeighbors, distances) \
- schedule(dynamic)\
- reduction(+:avgIndicesReturned)
+ shared(resultingNeighbors, distances) \
+ schedule(dynamic)\
+ reduction(+:avgIndicesReturned)
for (size_t i = 0; i < querySet.n_cols; ++i)
#endif
{
@@ -906,15 +906,15 @@ Search(const size_t k,
// support unsigned loop variables. If we're building for Visual Studio, use
// the intmax_t type instead.
#pragma omp parallel for \
- shared(resultingNeighbors, distances) \
- schedule(dynamic)\
- reduction(+:avgIndicesReturned)
+ shared(resultingNeighbors, distances) \
+ schedule(dynamic)\
+ reduction(+:avgIndicesReturned)
for (intmax_t i = 0; i < (intmax_t) referenceSet->n_cols; ++i)
#else
#pragma omp parallel for \
- shared(resultingNeighbors, distances) \
- schedule(dynamic)\
- reduction(+:avgIndicesReturned)
+ shared(resultingNeighbors, distances) \
+ schedule(dynamic)\
+ reduction(+:avgIndicesReturned)
for (size_t i = 0; i < referenceSet->n_cols; ++i)
#endif
{
More information about the mlpack-git
mailing list