diff --git a/src/cpp/flann/algorithms/dist.h b/src/cpp/flann/algorithms/dist.h index 91fdcbc13446f67b2ebde6a383fbaf89d20e5764..f0d2c2dc304ae02088010fa6b1be9356e426043f 100644 --- a/src/cpp/flann/algorithms/dist.h +++ b/src/cpp/flann/algorithms/dist.h @@ -93,7 +93,7 @@ struct L2_Simple } template - ResultType accum_dist(const U& a, const V& b, int dim) const + inline ResultType accum_dist(const U& a, const V& b, int dim) const { return (a-b)*(a-b); } @@ -156,7 +156,7 @@ struct L2 * Squared root is omitted for efficiency. */ template - ResultType accum_dist(const U& a, const V& b, int dim) const + inline ResultType accum_dist(const U& a, const V& b, int dim) const { return (a-b)*(a-b); } @@ -212,7 +212,7 @@ struct L1 * Partial distance, used by the kd-tree. */ template - ResultType accum_dist(const U& a, const V& b, int dim) const + inline ResultType accum_dist(const U& a, const V& b, int dim) const { return abs(a-b); } @@ -273,7 +273,7 @@ struct MinkowskiDistance * Partial distance, used by the kd-tree. */ template - ResultType accum_dist(const U& a, const V& b, int dim) const + inline ResultType accum_dist(const U& a, const V& b, int dim) const { return pow(static_cast(abs(a-b)),order); } @@ -380,7 +380,7 @@ struct HistIntersectionDistance * Partial distance, used by the kd-tree. */ template - ResultType accum_dist(const U& a, const V& b, int dim) const + inline ResultType accum_dist(const U& a, const V& b, int dim) const { return (a+b-2*(a - ResultType accum_dist(const U& a, const V& b, int dim) const + inline ResultType accum_dist(const U& a, const V& b, int dim) const { return (sqrt(static_cast(a)) - sqrt(static_cast(b))); } @@ -469,7 +469,7 @@ struct ChiSquareDistance * Partial distance, used by the kd-tree. */ template - ResultType accum_dist(const U& a, const V& b, int dim) const + inline ResultType accum_dist(const U& a, const V& b, int dim) const { ResultType result = ResultType(); ResultType sum, diff; @@ -520,7 +520,7 @@ struct KL_Divergence * Partial distance, used by the kd-tree. */ template - ResultType accum_dist(const U& a, const V& b, int dim) const + inline ResultType accum_dist(const U& a, const V& b, int dim) const { ResultType result = ResultType(); ResultType ratio = a / b;