[mlpack-git] [mlpack/mlpack] Cannot create NeighborSearch with arma:fmat MatType (#506)

Versus notifications at github.com
Tue Apr 12 01:32:47 EDT 2016

Similar problem in KMeans:

float mat[] = { 1, 2, 3, 4, 5, 6 };
const arma::fmat data(mat, 2, 3, false, true);

size_t number_of_clusters = 2;  

arma::Row<size_t> assignments(3);
arma::mat centroids(2, 3);

km::KMeans<mlpack::metric::EuclideanDistance, km::RandomPartition, 
           km::MaxVarianceNewCluster, km::NaiveKMeans, arma::fmat> k;

k.Cluster(data, number_of_clusters, assignments, centroids);

/usr/include/mlpack/methods/kmeans/kmeans_impl.hpp: In instantiation of ‘void mlpack::kmeans::KMeans<MetricType, InitialPartitionPolicy, EmptyClusterPolicy, LloydStepType, MatType>::Cluster(const MatType&, size_t, arma::Row<long unsigned int>&, arma::mat&, bool, bool) [with MetricType = mlpack::metric::LMetric<2, true>; InitialPartitionPolicy = mlpack::kmeans::RandomPartition; EmptyClusterPolicy = mlpack::kmeans::MaxVarianceNewCluster; LloydStepType = mlpack::kmeans::NaiveKMeans; MatType = arma::Mat<float>; size_t = long unsigned int; arma::mat = arma::Mat<double>]’:
test.cxx:44:65:   required from here
/usr/include/mlpack/methods/kmeans/kmeans_impl.hpp:239:37: error: no matching function for call to ‘arma::Col<double>::Col(const arma::subview_col<float>)’
       centroids.col(assignments[i]) += arma::vec(data.col(i));

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160411/49052c99/attachment.html>

More information about the mlpack-git mailing list