[mlpack-git] [mlpack/mlpack] Universal B tree implementation (#746)
Ryan Curtin
notifications at github.com
Mon Aug 22 16:50:37 EDT 2016
> + // The compiler should optimize out this if statement entirely.
> + if (MetricType::Power == 1)
> + {
> + loSum += vLo; // vLo is non-negative.
> + hiSum += vHi; // vHi is non-negative.
> + }
> + else if (MetricType::Power == 2)
> + {
> + loSum += vLo * vLo;
> + hiSum += vHi * vHi;
> + }
> + else
> + {
> + loSum += std::pow(vLo, (ElemType) MetricType::Power);
> + hiSum += std::pow(vHi, (ElemType) MetricType::Power);
> + }
You could probably do early termination here too but the condition would be a but stricter.
--
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/746/files/2c5eb5780226c30b8fb088ee928487f0970dc802#r75756004
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160822/852b4be2/attachment.html>
More information about the mlpack-git
mailing list