[mlpack-svn] r17070 - mlpack/trunk/src/mlpack/core/tree/rectangle_tree
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Aug 18 21:01:35 EDT 2014
Author: rcurtin
Date: Mon Aug 18 21:01:35 2014
New Revision: 17070
Log:
Avoid math::Range copy, although realistically gcc should be avoiding that
anyway when it recognizes that the variable is effectively const.
Modified:
mlpack/trunk/src/mlpack/core/tree/rectangle_tree/r_tree_split_impl.hpp
Modified: mlpack/trunk/src/mlpack/core/tree/rectangle_tree/r_tree_split_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/tree/rectangle_tree/r_tree_split_impl.hpp (original)
+++ mlpack/trunk/src/mlpack/core/tree/rectangle_tree/r_tree_split_impl.hpp Mon Aug 18 21:01:35 2014
@@ -461,7 +461,7 @@
{
// For each of the new rectangles, find the width in this dimension if
// we add the rectangle at index to the new rectangle.
- math::Range range = oldTree->Children()[index]->Bound()[i];
+ const math::Range& range = oldTree->Children()[index]->Bound()[i];
newVolOne *= treeOne->Bound()[i].Contains(range) ?
treeOne->Bound()[i].Width() : (range.Contains(treeOne->Bound()[i]) ?
range.Width() : (range.Lo() < treeOne->Bound()[i].Lo() ?
More information about the mlpack-svn
mailing list