[mlpack-git] master: Clarify comments, fix accessors. (e294504)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Fri Jul 10 18:59:37 EDT 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/4a97187bbba7ce8a6191b714949dd818ef0f37d2...e5905e62c15d1bcff21e6359b11efcd7ab6d7ca0

>---------------------------------------------------------------

commit e2945040048cf8c8c7a6bfcc15e13a244a42d988
Author: Ryan Curtin <ryan at ratml.org>
Date:   Sat Apr 18 01:40:22 2015 +0000

    Clarify comments, fix accessors.


>---------------------------------------------------------------

e2945040048cf8c8c7a6bfcc15e13a244a42d988
 src/mlpack/core/tree/ballbound.hpp | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/mlpack/core/tree/ballbound.hpp b/src/mlpack/core/tree/ballbound.hpp
index 4a83461..d1eae34 100644
--- a/src/mlpack/core/tree/ballbound.hpp
+++ b/src/mlpack/core/tree/ballbound.hpp
@@ -28,17 +28,14 @@ class BallBound
 {
  public:
   typedef VecType Vec;
-  //! Need this for Binary Space Partion Tree
+  //! Needed for BinarySpaceTree.
   typedef TMetricType MetricType;
 
  private:
-
   //! The radius of the ball bound.
   double radius;
-
   //! The center of the ball bound.
   VecType center;
-
   //! The metric used in this bound.
   TMetricType* metric;
 
@@ -175,16 +172,15 @@ class BallBound
    */
   double Diameter() const { return 2 * radius; }
 
-  /**
-   * Returns the distance metric used in this bound.
-   */
-  TMetricType Metric() const { return *metric; }
+  //! Returns the distance metric used in this bound.
+  const TMetricType& Metric() const { return *metric; }
+  //! Modify the distance metric used in this bound.
+  TMetricType& Metric() { return *metric; }
 
   /**
    * Returns a string representation of this object.
    */
   std::string ToString() const;
-
 };
 
 }; // namespace bound



More information about the mlpack-git mailing list