Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 8b1edf2f authored by hhakim's avatar hhakim
Browse files

Modify the butterfly C++ to handle a matrix size program argument + keep using...

Modify the butterfly C++ to handle a matrix size program argument + keep using JacobiSVD (instead of BDCSVD) on Windows VS.
parent e057b18d
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,12 @@ using namespace std;
int main(int argc, char** argv)
{
auto wht = TransformHelper<FPP,Cpu>::hadamardFaust(10, false);
int log2dim;
if(argc > 2)
log2dim = std::atoi(argv[2]);
else
log2dim = 10;
auto wht = TransformHelper<FPP,Cpu>::hadamardFaust(log2dim, false);
Faust::MatDense<FPP,Cpu> A;
/********** NOTE: a lot of garbage is left here, it was useful during the first writing of butterfly module (it could be again) */
// Faust::MatDense<FPP,Cpu> support1, support2, A;
......
......@@ -1260,7 +1260,13 @@ bool MatDense<FPP,Cpu>::eq_rows(const MatDense<FPP, Cpu> & other, faust_unsigned
template<typename FPP>
void MatDense<FPP, Cpu>::best_low_rank(const int &r, MatDense<FPP,Cpu> &bestX, MatDense<FPP, Cpu> &bestY) const
{
#ifdef _MSC_VER
// as far as I tested eigen3.4rc1 doesn't compile with VS 14
// so use JacobiSVD
Eigen::JacobiSVD<Eigen::Matrix<FPP, Eigen::Dynamic, Eigen::Dynamic>> svd(this->mat, Eigen::ComputeThinU | Eigen::ComputeThinV);
#else
Eigen::BDCSVD<Eigen::Matrix<FPP, Eigen::Dynamic, Eigen::Dynamic>> svd(this->mat, Eigen::ComputeThinU | Eigen::ComputeThinV);
#endif
if(bestX.getNbRow() != this->getNbRow() || r != bestX.getNbCol())
bestX.resize(this->getNbRow(), r);
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