Registered Member
|
int nCol = 300;
int nRow = 126; Eigen::MatrixXf spectrals(nRow, nCol); spectrals.setOnes(); Eigen::MatrixXf spectrals2(nCol,nRow); spectrals2.setOnes(); Eigen::MatrixXf mmm = spectrals*spectrals2; saveMat(mmm, "D:\\mmm.txt"); Environment: VS2012 In the result 'mmm', there are nearly half of the columns are zeros. Is this a bug or something wrong with my code? |
Registered Member
|
Have you double checked the implementation of the saveMat() function? If I replace it by the following code:
I get the expected result:
|
Registered Member
|
Thanks for your answer. I find when I set Eigen::setNbThreads(1); or disable the OpenMP ,the result turned out correct. As I enabled the OpenMP for my solution, I wonder the parallel multiplication may affect the result. |
Moderator
|
Which Eigen version are you using? (3.2 or devel branch?)
|
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]