[mlpack-git] [mlpack/mlpack] Vantage point tree (#708)

Ryan Curtin notifications at github.com
Fri Jul 22 11:41:18 EDT 2016


> +        if (rightScore != DBL_MAX)
> +        {
> +          // Restore the right traversal info.
> +          rule.TraversalInfo() = traversalInfo;
> +          Traverse(queryNode, *referenceNode.Right());
> +        }
> +        else
> +          ++numPrunes;
> +      }
> +    }
> +  }
> +  else
> +  {
> +    // If the reference node contains a point we should calculate all
> +    // base cases with this point.
> +    if (referenceNode.IsFirstPointCentroid())

I agree that this is inefficient.  I think that the better solution is to do this: during recursion, for all query points in a node, perform a base case with all parent vantage points.  Something like this:

```
for (size_t i = 0; i < queryNode.NumPoints(); ++i)
{
  TreeType* p = referenceNode.Parent();
  do
  {
    if (p->NumPoints() > 0) // We are holding a vantage point.
      BaseCase(queryNode.Point(i), p->Point(0)); // p->NumPoints() should never be greater than 1.
  } while ((p = p->Parent()) != NULL);
}
```

That would have to come after the base case section but before any recursions, so I guess up by line 50 or so would be the right place.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/708/files/300882ac96e7a663e3e303ca0c45c14c6fafe1a6#r71899590
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160722/f4eb6aef/attachment.html>


More information about the mlpack-git mailing list