elbamos / largeVis

An implementation of the largeVis algorithm for visualizing large, high-dimensional datasets, for R
340 stars 62 forks source link

add cxx flag ARMA_64BIT_WORD to handle large data. #9

Closed zaburo-ch closed 8 years ago

zaburo-ch commented 8 years ago

In pjicalculation.cpp, the function distMatrixTowij() makes matrix 'arma::sp_mat' that has N rows and N cols. However, without flag ARMA_64BIT_WORD, sp_mat can hold (n, m) elements that n, m, n*m <= 0xffff. So an error occur when we try to handle large data, e.g. 70000 row dataset.

It can be confirmed by below RcppArmadillo code. https://github.com/RcppCore/RcppArmadillo/blob/master/inst/include/armadillo_bits/Mat_meat.hpp#L196 https://github.com/RcppCore/RcppArmadillo/blob/master/inst/include/armadillo_bits/typedef_elem.hpp#L83

So we should set flag ARMA_64BIT_WORD to handle large data. And we also need option '-std=c++11' to build RcppArmadillo successfully.

elbamos commented 8 years ago

@zaburo-ch The version I'm about to pull, 0.1.5, should resolve this problem. It appears to have been an armadillo bug that is fixed in the current version of RcppArmadillo.