[mlpack-svn] r12704 - mlpack/conf/packages/mlpack/branches/1.0.X/debian/patches
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Thu May 17 12:36:07 EDT 2012
Author: speet3
Date: 2012-05-17 12:36:07 -0400 (Thu, 17 May 2012)
New Revision: 12704
Added:
mlpack/conf/packages/mlpack/branches/1.0.X/debian/patches/get_kernel_matrix.patch
Modified:
mlpack/conf/packages/mlpack/branches/1.0.X/debian/patches/series
Log:
add patch to get mlpack package building on sid amd64
Added: mlpack/conf/packages/mlpack/branches/1.0.X/debian/patches/get_kernel_matrix.patch
===================================================================
--- mlpack/conf/packages/mlpack/branches/1.0.X/debian/patches/get_kernel_matrix.patch (rev 0)
+++ mlpack/conf/packages/mlpack/branches/1.0.X/debian/patches/get_kernel_matrix.patch 2012-05-17 16:36:07 UTC (rev 12704)
@@ -0,0 +1,50 @@
+--- a/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp
++++ b/src/mlpack/methods/kernel_pca/kernel_pca_impl.hpp
+@@ -17,6 +17,24 @@
+ namespace kpca {
+
+ template <typename KernelType>
++arma::mat GetKernelMatrix(KernelType kernel, arma::mat transData)
++{
++ arma::mat kernelMat(transData.n_rows, transData.n_rows);
++
++ for (size_t i = 0; i < transData.n_rows; i++)
++ {
++ for (size_t j = 0; j < transData.n_rows; j++)
++ {
++ arma::vec v1 = trans(transData.row(i));
++ arma::vec v2 = trans(transData.row(j));
++ kernelMat(i, j) = kernel.Evaluate(v1, v2);
++ }
++ }
++
++ return kernelMat;
++}
++
++template <typename KernelType>
+ KernelPCA<KernelType>::KernelPCA(const KernelType kernel,
+ const bool centerData,
+ const bool scaleData) :
+@@ -112,22 +130,4 @@
+ }; // namespace mlpack
+ }; // namespace kpca
+
+-template <typename KernelType>
+-arma::mat GetKernelMatrix(KernelType kernel, arma::mat transData)
+-{
+- arma::mat kernelMat(transData.n_rows, transData.n_rows);
+-
+- for (size_t i = 0; i < transData.n_rows; i++)
+- {
+- for (size_t j = 0; j < transData.n_rows; j++)
+- {
+- arma::vec v1 = trans(transData.row(i));
+- arma::vec v2 = trans(transData.row(j));
+- kernelMat(i, j) = kernel.Evaluate(v1, v2);
+- }
+- }
+-
+- return kernelMat;
+-}
+-
+ #endif
Modified: mlpack/conf/packages/mlpack/branches/1.0.X/debian/patches/series
===================================================================
--- mlpack/conf/packages/mlpack/branches/1.0.X/debian/patches/series 2012-05-17 16:10:25 UTC (rev 12703)
+++ mlpack/conf/packages/mlpack/branches/1.0.X/debian/patches/series 2012-05-17 16:36:07 UTC (rev 12704)
@@ -1,4 +1,5 @@
fully_qualified_as_scalar.patch
+get_kernel_matrix.patch
build-Doxygen.patch
no-debug-or-profiling-info.patch
require-manpage-generation.patch
More information about the mlpack-svn
mailing list