[mlpack-git] master: Make Power and TakeRoot available for other classes. (02af1b5)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Wed Jul 29 16:41:48 EDT 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/f8ceffae0613b350f4d6bdd46c6c8633a40b4897...6ee21879488fe98612a4619b17f8b51e8da5215b

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

commit 02af1b59fc8bf6aeb0b5c75ae17736c735fb0b41
Author: ryan <ryan at ratml.org>
Date:   Wed Jul 22 22:07:58 2015 -0400

    Make Power and TakeRoot available for other classes.


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

02af1b59fc8bf6aeb0b5c75ae17736c735fb0b41
 src/mlpack/core/metrics/lmetric.hpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mlpack/core/metrics/lmetric.hpp b/src/mlpack/core/metrics/lmetric.hpp
index 6ea9419..ecd9648 100644
--- a/src/mlpack/core/metrics/lmetric.hpp
+++ b/src/mlpack/core/metrics/lmetric.hpp
@@ -54,7 +54,7 @@ namespace metric {
  *    is returned.  Setting this to false causes the metric to not satisfy the
  *    Triangle Inequality (be careful!).
  */
-template<int Power, bool TakeRoot = true>
+template<int TPower, bool TTakeRoot = true>
 class LMetric
 {
  public:
@@ -83,6 +83,11 @@ class LMetric
   //! Serialize the metric (nothing to do).
   template<typename Archive>
   void Serialize(Archive& /* ar */, const unsigned int /* version */) { }
+
+  //! The power of the metric.
+  static const int Power = TPower;
+  //! Whether or not the root is taken.
+  static const bool TakeRoot = TTakeRoot;
 };
 
 // Convenience typedefs.



More information about the mlpack-git mailing list