Re: [eigen] RcppEigen, providing bindings from R to Eigen through Rcpp, has been released |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
On 28.06.2011 22:51, Gael Guennebaud wrote:
VectorXd D = UDV.singularValues(); m_r = std::count_if(D.data(), D.data() + m_p, std::bind2nd(std::greater<double>(), threshold() * D[0])); which can be written: m_r = (UDV.singularValues().array()> threshold() * D[0]).count();
Not that speed really matters at that point, but couldn't that also be replaced by a binary search? Surely the time needed to compute the SVD in the first place is way above the potential time savings ...
Christoph -- ---------------------------------------------- Dipl.-Inf. Christoph Hertzberg Cartesium 0.051 Universität Bremen Enrique-Schmidt-Straße 5 28359 Bremen Tel: (+49) 421-218-64252 ----------------------------------------------
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |