Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 36135ea4 authored by hhakim's avatar hhakim
Browse files

Use BDCSVD instead of JacobiSVD in MatDense::best_low_rank() (the former is...

Use BDCSVD instead of JacobiSVD in MatDense::best_low_rank() (the former is faster than the latter on large matrices).
parent 0305a54a
No related branches found
No related tags found
No related merge requests found
...@@ -1260,7 +1260,7 @@ bool MatDense<FPP,Cpu>::eq_rows(const MatDense<FPP, Cpu> & other, faust_unsigned ...@@ -1260,7 +1260,7 @@ bool MatDense<FPP,Cpu>::eq_rows(const MatDense<FPP, Cpu> & other, faust_unsigned
template<typename FPP> template<typename FPP>
void MatDense<FPP, Cpu>::best_low_rank(const int &r, MatDense<FPP,Cpu> &bestX, MatDense<FPP, Cpu> &bestY) const void MatDense<FPP, Cpu>::best_low_rank(const int &r, MatDense<FPP,Cpu> &bestX, MatDense<FPP, Cpu> &bestY) const
{ {
Eigen::JacobiSVD<Eigen::Matrix<FPP, Eigen::Dynamic, Eigen::Dynamic>> svd(this->mat, Eigen::ComputeThinU | Eigen::ComputeThinV); Eigen::BDCSVD<Eigen::Matrix<FPP, Eigen::Dynamic, Eigen::Dynamic>> svd(this->mat, Eigen::ComputeThinU | Eigen::ComputeThinV);
if(bestX.getNbRow() != this->getNbRow() || r != bestX.getNbCol()) if(bestX.getNbRow() != this->getNbRow() || r != bestX.getNbCol())
bestX.resize(this->getNbRow(), r); bestX.resize(this->getNbRow(), r);
if(bestY.getNbRow() != this->getNbRow() || r != bestY.getNbCol()) if(bestY.getNbRow() != this->getNbRow() || r != bestY.getNbCol())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment