[mlpack-svn] [MLPACK] #195: Compilation error with arma::SpMat (sparse matrices)
MLPACK Trac
trac at coffeetalk-1.cc.gatech.edu
Tue Jan 31 15:47:51 EST 2012
#195: Compilation error with arma::SpMat (sparse matrices)
------------------------------+---------------------------------------------
Reporter: pram | Owner: rcurtin
Type: defect | Status: new
Priority: major | Milestone:
Component: armadillo sparse | Keywords:
Blocking: | Blocked By:
------------------------------+---------------------------------------------
The executable failing is in
{{{contrib/pram/max_ip_search/sp_max_ip_main.cpp}}}.
The following is the compilation error:
{{{
[pram at no build]$ make sp_max_ip_main
[ 50%] Built target contrib_pram
[100%] Building CXX object
max_ip_search/CMakeFiles/sp_max_ip_main.dir/sp_max_ip_main.cpp.o
/usr/include/armadillo_bits/Col_meat.hpp: In constructor
‘arma::Col<eT>::Col(const arma::Base<eT, T1>&) [with T1 =
arma::SpSubview<double>, eT = double]’:
/net/hu12/pram/work_space/contrib/pram/max_ip_search/sp_max_ip_main.cpp:140:
instantiated from here
/usr/include/armadillo_bits/Col_meat.hpp:213: error: no matching function
for call to ‘arma::Col<double>::operator=(const arma::SpSubview<double>&)’
/usr/include/armadillo_bits/Mat_bones.hpp:54: note: candidates are: const
arma::Mat<eT>& arma::Mat<eT>::operator=(const char*) [with eT = double]
/usr/include/armadillo_bits/Mat_bones.hpp:57: note: const
arma::Mat<eT>& arma::Mat<eT>::operator=(const std::string&) [with eT =
double]
/usr/include/armadillo_bits/Mat_bones.hpp:67: note: const
arma::Mat<eT>& arma::Mat<eT>::operator=(eT) [with eT = double]
/usr/include/armadillo_bits/Mat_bones.hpp:74: note: const
arma::Mat<eT>& arma::Mat<eT>::operator=(const arma::Mat<eT>&) [with eT =
double]
/usr/include/armadillo_bits/Mat_bones.hpp:93: note: const
arma::Mat<eT>& arma::Mat<eT>::operator=(const arma::subview<eT>&) [with eT
= double]
/usr/include/armadillo_bits/Mat_bones.hpp:102: note: const
arma::Mat<eT>& arma::Mat<eT>::operator=(const arma::subview_cube<eT>&)
[with eT = double]
/usr/include/armadillo_bits/Mat_bones.hpp:111: note: const
arma::Mat<eT>& arma::Mat<eT>::operator=(const arma::diagview<eT>&) [with
eT = double]
make[3]: ***
[max_ip_search/CMakeFiles/sp_max_ip_main.dir/sp_max_ip_main.cpp.o] Error 1
make[2]: *** [max_ip_search/CMakeFiles/sp_max_ip_main.dir/all] Error 2
make[1]: *** [max_ip_search/CMakeFiles/sp_max_ip_main.dir/rule] Error 2
make: *** [sp_max_ip_main] Error 2
}}}
The code around line 140 in
{{{contrib/pram/max_ip_search/sp_max_ip_main.cpp}}} is the following:
{{{
139 for (size_t i = 0; i < qdata.n_cols; i++) {
140 arma::vec q = (arma::vec) qdata.col(i);
141 qdata.col(i) = q / arma::norm(q, 2);
142 }
}}}
Here ''qdata'' is a {{{arma::SpMat<double>}}}
--
Ticket URL: <http://trac.research.cc.gatech.edu/fastlab/ticket/195>
MLPACK <www.fast-lab.org>
MLPACK is an intuitive, fast, and scalable C++ machine learning library developed by the FASTLAB at Georgia Tech under Dr. Alex Gray.
More information about the mlpack-svn
mailing list