[mlpack-git] [mlpack/mlpack] backported ind2sub and sub2ind. (#683)

stereomatchingkiss notifications at github.com
Thu Jun 9 11:20:46 EDT 2016


> +
> +template<typename MatType, typename CubeType>
> +void StructuredForests<MatType, CubeType>::
> +dt_2d(MatType& im)
> +{
> +  arma::vec f(std::max(im.n_rows, im.n_cols));
> +  // transform along columns
> +  for (size_t x = 0; x < im.n_cols; ++x)
> +  {
> +    f.subvec(0, im.n_rows - 1) = im.col(x);
> +    arma::vec d = this->dt_1d(f, im.n_rows);
> +    im.col(x) = d;
> +  }
> +
> +  // transform along rows
> +  for (int y = 0; y < im.n_rows; y++)

I guess this line would emit warning(compare with unsigned and signed, change y to size_t or uword may solve this problem, I remember rcurtin prefer size_t since it is a standard way to store the size of array)

---
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/683/files/9d85b64c6c6bdff608331195351d09abf56cfc96#r66461709
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160609/6451b669/attachment.html>


More information about the mlpack-git mailing list