Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rand::normal does not finish #27

Closed
bbensaid30 opened this issue Jul 8, 2021 · 6 comments
Closed

Rand::normal does not finish #27

bbensaid30 opened this issue Jul 8, 2021 · 6 comments

Comments

@bbensaid30
Copy link

Hello

I just tried the following line of codes:

#include <Eigen/Dense>
#include <EigenRand/EigenRand>

Eigen::Rand::Vmt19937_64 gen{ 42 };
Eigen::MatrixXd test = Eigen::Rand::normal<Eigen::MatrixXd>(3,3,gen,0,1);
std::cout << test << std::endl;`

I have no compilation issue (just warnings but I think it is normal according to another discussion issue on gitlab). However, I can wait 10 mins and I have absolutely no results.
I compile with g++ (C++ 17 or 11) and I have the Eigen version 3.7.7.

Thanks in advance

@bab2min
Copy link
Owner

bab2min commented Jul 8, 2021

Hi @bbensaid30 , thank you for your interest to my package.
Umm, it seems to be an OS or hardware related problem.
Could you share more information about your environment, including your OS and CPU architecture.
Also you can get verbose g++ log with -Q --help=target -v option. (g++ yourcode.cpp -Q --help=target -v)
If you share your verbose log and compiled binary, it will be very helpful to solve the problem.

@bbensaid30
Copy link
Author

Hello
My OS: Ubuntu 20.04.2 (Debian)
The other information are in the following files.
debug.zip

@bbensaid30
Copy link
Author

Hello

Do you find the problem please ?

@bab2min
Copy link
Owner

bab2min commented Jul 15, 2021

Hello @bbensaid30
It seems that I've identified the cause of the problem.
It only happens with an odd size of double matrices where vectorization is not possible, such as 3x3 or 5x5 matrix.
If you test with 4x4 matrix, it will run without the problem.

The cause of the problem is that UniformReal generator for double type yields wrong distribution in scalar mode. I'll fix it as soon as possible. Please wait a little longer.

bab2min added a commit that referenced this issue Jul 15, 2021
bab2min added a commit that referenced this issue Jul 16, 2021
@bab2min
Copy link
Owner

bab2min commented Jul 16, 2021

@bbensaid30
I've uploaded a new version 0.3.5 that fixes the issue. Please test the same code with the new version.

@bbensaid30
Copy link
Author

Thanks it works fine. Good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants