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

lozhnikov notifications at github.com
Thu Aug 18 13:28:38 EDT 2016


> +    for (size_t d = 0; d < dim; d++)
> +    {
> +      lower = loBound(d, i) - point[d];
> +      higher = point[d] - hiBound(d, i);
> +
> +      // Since only one of 'lower' or 'higher' is negative, if we add each's
> +      // absolute value to itself and then sum those two, our result is the
> +      // nonnegative half of the equation times two; then we raise to power Power.
> +      sum += pow((lower + fabs(lower)) + (higher + fabs(higher)),
> +          (ElemType) MetricType::Power);
> +    }
> +
> +    if (sum < minSum)
> +      minSum = sum;
> +  }
> +

Hmm... I construct the minimum bounding rectangle on the points held in the node:
```
  arma::Col<ElemType> mins(min(data, 1));
  arma::Col<ElemType> maxs(max(data, 1));

  minWidth = std::numeric_limits<ElemType>::max();
  for (size_t i = 0; i < dim; i++)
  {
    bounds[i] |= math::RangeType<ElemType>(mins[i], maxs[i]);
```
`bounds` is the minimum bounding rectangle.

-- 
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/8c5a97dcb1641ae6c98edc70426fb19f5cd7cb79#r75351459
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160818/c6b3e8c2/attachment.html>


More information about the mlpack-git mailing list