[mlpack-git] [mlpack/mlpack] Spill trees (#747)

MarcosPividori notifications at github.com
Tue Aug 16 21:25:42 EDT 2016


> +    // better, then take it.
> +    if (SortPolicy::IsBetter(queryNode.Parent()->Stat().FirstBound(),
> +        worstDistance))
> +      worstDistance = queryNode.Parent()->Stat().FirstBound();
> +  }
> +
> +  // Could the existing bounds be better?
> +  if (SortPolicy::IsBetter(queryNode.Stat().FirstBound(), worstDistance))
> +    worstDistance = queryNode.Stat().FirstBound();
> +
> +  // Cache bounds for later.
> +  queryNode.Stat().FirstBound() = worstDistance;
> +
> +  worstDistance = SortPolicy::Relax(worstDistance, epsilon);
> +
> +  return worstDistance;

@rcurtin , The `Score()` calculation is different too, because I consider the special case of overlapping nodes. As there are 3 different methods, I thought it would preferable to have a different implementation, but I agree this means some duplicated code. I was not sure what was preferable, some duplicated code with the advantage of not modifying the original search rules, or more compact code but a bit more complex.

As I have to access the `Overlap()` method of Spill Trees and it is not included in all tree types, I can't use the `#ifdef` approach, because we will have a compiler error when instantiating with a different tree type. I think I should consider template specialization for the Score() methods.

-- 
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/747/files/fe090ee13c7cad79e2b7eb8b6690628ba3ead1ed#r75050155
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160816/2d8c27a2/attachment-0001.html>


More information about the mlpack-git mailing list