Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dead code? #55

Closed
ibtaylor opened this issue Nov 2, 2017 · 1 comment
Closed

dead code? #55

ibtaylor opened this issue Nov 2, 2017 · 1 comment

Comments

@ibtaylor
Copy link

ibtaylor commented Nov 2, 2017

I'm confused by this function. Nothing ever seems to call it.

// Returns the L2 distance between the vector "p1[0:size-1]" and the data point with index "idx_p2" stored in the class:
inline num_t kdtree_distance(const num_t *p1, const IndexType idx_p2, IndexType size) const
{
num_t s = 0;
for (IndexType i = 0; i < size; i++) {
const num_t d = p1[i] - m_data_matrix.coeff(idx_p2, i);
s += d * d;
}
return s;
}

Seems like it wasn't fully cleared out during this commit.
b83c291#diff-6972321bb8a18bf106257beeecb4a09eL371

@jlblancoc
Copy link
Owner

@ibtaylor thanks!! You were right... It's clear that this code was useless, specially since there is a template argument for the type of metric, and this old code was only for L2.

All good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants