<p>In <a href="https://github.com/mlpack/mlpack/pull/696#discussion_r67148615">src/mlpack/methods/edge_boxes/feature_extraction_impl.hpp</a>:</p>
<pre style='color:#555'>> +
> +template<typename MatType, typename CubeType>
> +arma::vec StructuredForests<MatType, CubeType>::
> +DistanceTransform1D(arma::vec const &f, const size_t n, const double inf)
> +{
> + arma::vec d(n), v(n), z(n + 1);
> + size_t k = 0;
> + v[0] = 0.0;
> + z[0] = -inf;
> + z[1] = inf;
> + for (size_t q = 1; q <= n - 1; ++q)
> + {
> + float s = ( (f[q] + q * q)-( f[v[k]] + v[k] * v[k]) ) / (2 * q - 2 * v[k]);
> + while (s <= z[k])
> + {
> + --k;
</pre>
<p>I'm not sure, but if we set k = 0 at the beginning, how can we decrease k, and still get the right index?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/696/files/b38b688edfc4c2ee8bf461240f8384a70575d3a4#r67148615">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFDI7B9foVU45XP---vrpIWACqOsoks5qL-pegaJpZM4I1lnr">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFB4eKut-njUnzCkvqF50iwAT-Ws_ks5qL-pegaJpZM4I1lnr.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/696/files/b38b688edfc4c2ee8bf461240f8384a70575d3a4#r67148615"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>