[mlpack-svn] r15432 - mlpack/trunk/src/mlpack/core/metrics

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Jul 8 10:47:40 EDT 2013


Author: rcurtin
Date: Mon Jul  8 10:47:40 2013
New Revision: 15432

Log:
Older versions of Armadillo require as_scalar() because gcc isn't able to figure
out that the result will be a double.


Modified:
   mlpack/trunk/src/mlpack/core/metrics/lmetric_impl.hpp

Modified: mlpack/trunk/src/mlpack/core/metrics/lmetric_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/metrics/lmetric_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/metrics/lmetric_impl.hpp	Mon Jul  8 10:47:40 2013
@@ -83,7 +83,7 @@
 template<typename VecType1, typename VecType2>
 double LMetric<INT_MAX, false>::Evaluate(const VecType1& a, const VecType2& b)
 {
-  return max(abs(a - b));
+  return arma::as_scalar(max(abs(a - b)));
 }
 
 }; // namespace metric



More information about the mlpack-svn mailing list