refactored src/mlpack/methods/*/ - updated MinDistance(), MaxDistance() and RangeDistance() calls

This commit is contained in:
KANODIA
2016-09-20 09:42:31 +05:30
parent 3d5efcc6b2
commit 7ce36bc35a
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -115,7 +115,7 @@ double DTBRules<MetricType, TreeType>::Score(TreeType& queryNode,
return DBL_MAX;
++scores;
const double distance = queryNode.MinDistance(&referenceNode);
const double distance = queryNode.MinDistance(referenceNode);
const double bound = CalculateBound(queryNode);
// If all the points in the reference node are farther than the candidate
@@ -216,7 +216,7 @@ inline double DualTreeKMeansRules<MetricType, TreeType>::Score(
{
// If this might affect the lower bound, make it more exact.
queryNode.Stat().LowerBound() = std::min(queryNode.Stat().LowerBound(),
queryNode.MinDistance(&referenceNode));
queryNode.MinDistance(referenceNode));
++scores;
}
@@ -228,7 +228,7 @@ inline double DualTreeKMeansRules<MetricType, TreeType>::Score(
if (score != DBL_MAX)
{
// Get minimum and maximum distances.
const math::Range distances = queryNode.RangeDistance(&referenceNode);
const math::Range distances = queryNode.RangeDistance(referenceNode);
score = distances.Lo();
++scores;
@@ -18,7 +18,7 @@ inline double FurthestNeighborSort::BestNodeToNodeDistance(
{
// This is not implemented yet for the general case because the trees do not
// accept arbitrary distance metrics.
return queryNode->MaxDistance(referenceNode);
return queryNode->MaxDistance(*referenceNode);
}
template<typename TreeType>
@@ -27,7 +27,7 @@ inline double FurthestNeighborSort::BestNodeToNodeDistance(
const TreeType* referenceNode,
const double centerToCenterDistance)
{
return queryNode->MaxDistance(referenceNode, centerToCenterDistance);
return queryNode->MaxDistance(*referenceNode, centerToCenterDistance);
}
template<typename TreeType>
@@ -37,7 +37,7 @@ inline double FurthestNeighborSort::BestNodeToNodeDistance(
const TreeType* referenceChildNode,
const double centerToCenterDistance)
{
return queryNode->MaxDistance(referenceNode, centerToCenterDistance) +
return queryNode->MaxDistance(*referenceNode, centerToCenterDistance) +
referenceChildNode->ParentDistance();
}
@@ -18,7 +18,7 @@ inline double NearestNeighborSort::BestNodeToNodeDistance(
{
// This is not implemented yet for the general case because the trees do not
// accept arbitrary distance metrics.
return queryNode->MinDistance(referenceNode);
return queryNode->MinDistance(*referenceNode);
}
template<typename TreeType>
@@ -27,7 +27,7 @@ inline double NearestNeighborSort::BestNodeToNodeDistance(
const TreeType* referenceNode,
const double centerToCenterDistance)
{
return queryNode->MinDistance(referenceNode, centerToCenterDistance);
return queryNode->MinDistance(*referenceNode, centerToCenterDistance);
}
template<typename TreeType>
@@ -37,7 +37,7 @@ inline double NearestNeighborSort::BestNodeToNodeDistance(
const TreeType* referenceChildNode,
const double centerToCenterDistance)
{
return queryNode->MinDistance(referenceChildNode, centerToCenterDistance) -
return queryNode->MinDistance(*referenceChildNode, centerToCenterDistance) -
referenceChildNode->ParentDistance();
}
@@ -179,7 +179,7 @@ double RangeSearchRules<MetricType, TreeType>::Score(TreeType& queryNode,
else
{
// Just perform the calculation.
distances = referenceNode.RangeDistance(&queryNode);
distances = referenceNode.RangeDistance(queryNode);
++scores;
}