[mlpack-git] [mlpack/mlpack] Universal B tree implementation (#746)

Ryan Curtin notifications at github.com
Mon Aug 22 19:34:40 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're right, I did not think my comment through thoroughly before I posted it.  We can't shortcut any max-distance calculation.

-- 
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#r75779210
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160822/081e8f36/attachment.html>


More information about the mlpack-git mailing list