When the parent-child rule can't be applied, the correct bound wasn't being used

before.  This fixes that.
This commit is contained in:
Ryan Curtin
2014-02-19 14:57:22 +00:00
parent adfc68ce28
commit 32fdc7404a
@@ -183,7 +183,11 @@ inline double NeighborSearchRules<SortPolicy, MetricType, TreeType>::Score(
}
else
{
adjustedScore = SortPolicy::CombineBest(adjustedScore, queryDescDist);
// If the parent node is NULL, force adjustedScore to be such that it can't
// be pruned. Otherwise use the parent descendant distance.
const double queryParentDescDist = (queryNode.Parent() == NULL) ?
bestDistance : queryNode.Parent()->FurthestDescendantDistance();
adjustedScore = SortPolicy::CombineBest(adjustedScore, queryParentDescDist);
}
if (traversalInfo.LastReferenceNode() == referenceNode.Parent())
@@ -193,7 +197,11 @@ inline double NeighborSearchRules<SortPolicy, MetricType, TreeType>::Score(
}
else
{
adjustedScore = SortPolicy::CombineBest(adjustedScore, refDescDist);
// If the parent node is NULL, force adjustedScore to be such that it can't
// be pruned. Otherwise use the parent descendant distance.
const double refParentDescDist = (referenceNode.Parent() == NULL) ?
bestDistance : referenceNode.Parent()->FurthestDescendantDistance();
adjustedScore = SortPolicy::CombineBest(adjustedScore, refParentDescDist);
}
// Can we prune?