[mlpack-svn] r12717 - mlpack/trunk/src/mlpack/methods/maxip
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Thu May 17 15:09:24 EDT 2012
Author: rcurtin
Date: 2012-05-17 15:09:24 -0400 (Thu, 17 May 2012)
New Revision: 12717
Modified:
mlpack/trunk/src/mlpack/methods/maxip/ip_metric_impl.hpp
Log:
Add template specalization for linear kernel.
Modified: mlpack/trunk/src/mlpack/methods/maxip/ip_metric_impl.hpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/maxip/ip_metric_impl.hpp 2012-05-17 18:40:56 UTC (rev 12716)
+++ mlpack/trunk/src/mlpack/methods/maxip/ip_metric_impl.hpp 2012-05-17 19:09:24 UTC (rev 12717)
@@ -10,6 +10,9 @@
// In case it hasn't been included yet.
#include "ip_metric_impl.hpp"
+#include <mlpack/core/metrics/lmetric.hpp>
+#include <mlpack/core/kernels/linear_kernel.hpp>
+
namespace mlpack {
namespace maxip {
@@ -23,6 +26,14 @@
2 * KernelType::Evaluate(a, b);
}
+template<>
+template<typename Vec1Type, typename Vec2Type>
+double IPMetric<kernel::LinearKernel>::Evaluate(const Vec1Type& a,
+ const Vec2Type& b)
+{
+ return metric::LMetric<2>::Evaluate(a, b);
+}
+
}; // namespace maxip
}; // namespace mlpack
More information about the mlpack-svn
mailing list