[mlpack-git] [mlpack/mlpack] Spill trees (#747)
Ryan Curtin
notifications at github.com
Sun Aug 14 12:07:39 EDT 2016
> + // and points with projection value greater than zero are included in
> + // rightPoints.
> + leftPoints.resize(left);
> + rightPoints.resize(right);
> + for (size_t i = 0, rc = 0, lc = 0; i < points.n_elem; i++)
> + {
> + if (projections[i] <= 0)
> + {
> + leftPoints[lc] = points[i];
> + lc++;
> + }
> + else
> + {
> + rightPoints[rc] = points[i];
> + rc++;
> + }
If you wanted, you could compress this code a lot:
```
if (projections[i] <= 0)
leftPoints[lc++] = points[i];
else
rightPoints[rc++] = points[i];
```
Whether or not you want to do that is your choice. :)
--
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/747/files/fe090ee13c7cad79e2b7eb8b6690628ba3ead1ed#r74704407
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160814/1abeb2b5/attachment.html>
More information about the mlpack-git
mailing list