Precompute KDE absErrorTol

This commit is contained in:
Roberto Hueso Gomez
2019-08-26 06:03:56 +02:00
parent d7e4645035
commit 8f718bfdad
2 changed files with 4 additions and 2 deletions
+3
View File
@@ -158,6 +158,9 @@ class KDERules
constexpr static bool kernelIsGaussian =
std::is_same<KernelType, kernel::GaussianKernel>::value;
//! Absolute error tolerance available for each reference point.
const double absErrorTol;
//! The last query index.
size_t lastQueryIndex;
+1 -2
View File
@@ -50,6 +50,7 @@ KDERules<MetricType, KernelType, TreeType>::KDERules(
kernel(kernel),
monteCarlo(monteCarlo),
sameSet(sameSet),
absErrorTol(absError / referenceSet.n_cols),
lastQueryIndex(querySet.n_cols),
lastReferenceIndex(referenceSet.n_cols),
baseCases(0),
@@ -146,7 +147,6 @@ Score(const size_t queryIndex, TreeType& referenceNode)
const double bound = maxKernel - minKernel;
// Error tolerance of the current query point and reference node.
const double absErrorTol = absError / referenceSet.n_cols;
const double relErrorTol = relError * minKernel;
const double errorTolerance = absErrorTol + relErrorTol;
@@ -353,7 +353,6 @@ Score(TreeType& queryNode, TreeType& referenceNode)
const double bound = maxKernel - minKernel;
// Error tolerance of the current nodes combination.
const double absErrorTol = absError / referenceSet.n_cols;
const double relErrorTol = relError * minKernel;
const double errorTolerance = absErrorTol + relErrorTol;