[mlpack-git] master: Revert "Switch to struct to be in line with other trait structs." I'd rather just switch the documentation, because it turns out the other trait structs are actually classes too. (8110b5c)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Mon Aug 31 15:46:10 EDT 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/fab25eaf7b9630076fd3b980e43a25363a936d28...b34381d94ec4d8f026a2954f8376b9df5a4d661d

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

commit 8110b5caa90fedbd83dc4c796cf068c21cb20d76
Author: Ryan Curtin <ryan at ratml.org>
Date:   Mon Aug 31 15:35:01 2015 +0000

    Revert "Switch to struct to be in line with other trait structs."
    I'd rather just switch the documentation, because it turns out the other trait structs are actually classes too.
    
    This reverts commit 3b44f3dae40632a624275c7f2567ee85f8a2889f.


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

8110b5caa90fedbd83dc4c796cf068c21cb20d76
 src/mlpack/core/tree/binary_space_tree/traits.hpp | 5 +++--
 src/mlpack/core/tree/cover_tree/traits.hpp        | 4 ++--
 src/mlpack/core/tree/rectangle_tree/traits.hpp    | 5 +++--
 src/mlpack/core/tree/tree_traits.hpp              | 7 ++++---
 4 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/mlpack/core/tree/binary_space_tree/traits.hpp b/src/mlpack/core/tree/binary_space_tree/traits.hpp
index 08285f1..44e42b4 100644
--- a/src/mlpack/core/tree/binary_space_tree/traits.hpp
+++ b/src/mlpack/core/tree/binary_space_tree/traits.hpp
@@ -24,9 +24,10 @@ template<typename MetricType,
          template<typename BoundMetricType> class BoundType,
          template<typename SplitBoundType, typename SplitMatType>
              class SplitType>
-struct TreeTraits<BinarySpaceTree<MetricType, StatisticType, MatType, BoundType,
-                                  SplitType>>
+class TreeTraits<BinarySpaceTree<MetricType, StatisticType, MatType, BoundType,
+                                 SplitType>>
 {
+ public:
   /**
    * Each binary space tree node has two children which represent
    * non-overlapping subsets of the space which the node represents.  Therefore,
diff --git a/src/mlpack/core/tree/cover_tree/traits.hpp b/src/mlpack/core/tree/cover_tree/traits.hpp
index fd66562..60d6aa1 100644
--- a/src/mlpack/core/tree/cover_tree/traits.hpp
+++ b/src/mlpack/core/tree/cover_tree/traits.hpp
@@ -23,9 +23,9 @@ template<typename MetricType,
          typename StatisticType,
          typename MatType,
          typename RootPointPolicy>
-struct TreeTraits<CoverTree<MetricType, StatisticType, MatType,
-                            RootPointPolicy>>
+class TreeTraits<CoverTree<MetricType, StatisticType, MatType, RootPointPolicy>>
 {
+ public:
   /**
    * The cover tree (or, this implementation of it) does not require that
    * children represent non-overlapping subsets of the parent node.
diff --git a/src/mlpack/core/tree/rectangle_tree/traits.hpp b/src/mlpack/core/tree/rectangle_tree/traits.hpp
index a3f4456..811d9ac 100644
--- a/src/mlpack/core/tree/rectangle_tree/traits.hpp
+++ b/src/mlpack/core/tree/rectangle_tree/traits.hpp
@@ -23,9 +23,10 @@ template<typename MetricType,
          typename MatType,
          typename SplitType,
          typename DescentType>
-struct TreeTraits<RectangleTree<MetricType, StatisticType, MatType, SplitType,
-                                DescentType>>
+class TreeTraits<RectangleTree<MetricType, StatisticType, MatType, SplitType,
+                               DescentType>>
 {
+ public:
   /**
    * An R-tree can have overlapping children.
    */
diff --git a/src/mlpack/core/tree/tree_traits.hpp b/src/mlpack/core/tree/tree_traits.hpp
index 9a1f244..44d5134 100644
--- a/src/mlpack/core/tree/tree_traits.hpp
+++ b/src/mlpack/core/tree/tree_traits.hpp
@@ -69,8 +69,9 @@ namespace tree {
  * mlpack/core/tree/binary_space_tree/traits.hpp for an example.
  */
 template<typename TreeType>
-struct TreeTraits
+class TreeTraits
 {
+ public:
   /**
    * This is true if the subspaces represented by the children of a node can
    * overlap.
@@ -99,7 +100,7 @@ struct TreeTraits
   static const bool BinaryTree = false;
 };
 
-} // namespace tree
-} // namespace mlpack
+}; // namespace tree
+}; // namespace mlpack
 
 #endif



More information about the mlpack-git mailing list