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

stereomatchingkiss notifications at github.com
Thu Jun 9 07:32:05 EDT 2016


> +  this->options = inMap;
> +}
> +
> +template<typename MatType, typename CubeType>
> +MatType StructuredForests<MatType, CubeType>::
> +LoadData(MatType& images, MatType& boundaries, MatType& segmentations)
> +{
> +  int num_images = this->options["num_images"];
> +  int row_size = this->options["row_size"];
> +  int col_size = this->options["col_size"];
> +  MatType input_data(num_images * row_size * 5, col_size);
> +  // we store the input data as follows: 
> +  // images (3), boundaries (1), segmentations (1).
> +  int loop_iter = num_images * 5;
> +  size_t row_idx = 0;
> +  int col_i = 0, col_s = 0, col_b = 0;

use size_t maybe is a better choice, since this type guarantee it is large enough for the index 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#r66424464
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160609/e1c6b19e/attachment.html>


More information about the mlpack-git mailing list