[mlpack-git] master: Change to size_t only, and add a warning for the mutator. (6ffa348)
gitdub at mlpack.org
gitdub at mlpack.org
Tue Jun 28 16:46:38 EDT 2016
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/081a60194cc8757b10f4dc52279236a67de61d9c...6ffa3488be70150fa3e787d8bf928c023edbc201
>---------------------------------------------------------------
commit 6ffa3488be70150fa3e787d8bf928c023edbc201
Author: Ryan Curtin <ryan at ratml.org>
Date: Tue Jun 28 16:46:38 2016 -0400
Change to size_t only, and add a warning for the mutator.
>---------------------------------------------------------------
6ffa3488be70150fa3e787d8bf928c023edbc201
src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp b/src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp
index 83b6670..37f9572 100644
--- a/src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp
+++ b/src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp
@@ -419,9 +419,10 @@ class RectangleTree
*
* @param index Index of point for which a dataset index is wanted.
*/
- const size_t& Point(const size_t index) const { return points[index]; }
+ size_t Point(const size_t index) const { return points[index]; }
- //! Modify the index of a particular point in this node.
+ //! Modify the index of a particular point in this node. Be very careful when
+ //! you do this! You may make the tree invalid.
size_t& Point(const size_t index) { return points[index]; }
//! Return the minimum distance to another node.
More information about the mlpack-git
mailing list