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

Random Engine #33

Open
prasunanand opened this issue Aug 28, 2019 · 4 comments
Open

Random Engine #33

prasunanand opened this issue Aug 28, 2019 · 4 comments
Labels
good first issue Good for newcomers

Comments

@prasunanand
Copy link
Member

Implement Random Engine generators

@prasunanand prasunanand added the good first issue Good for newcomers label Aug 28, 2019
@pkspyder007
Copy link

@prasunanand could you please explain this feature and some guidelines how to implement it.

@prasunanand
Copy link
Member Author

Please take a look at different generators in numpy code base.

http://www.netlib.org/lapack/explore-html/df/dd1/group___o_t_h_e_rauxiliary_ga77e05a87ced667cbdb502aa87c72d056.html
https://github.com/numpy/numpy/tree/master/numpy/random

Describe an approach how you will implement it ?

@pkspyder007
Copy link

The random module in NumPy has random generators such as random.uniform for uniform distribution, random.randn for normal distribution, and also range based pseudo-random generators.

What I am thinking is of a nested class in NumRuby that will bind to the native C functions for the various random generators.
We also need to consider various data types we need to support for example bool, int, and float.
For this, we can have overloaded functions,
for distributions, I need to study how to create uniform/normal distributions in C.

class Random
 -> uniform(n, interval) => [ ...n ]
 -> normal(n, mean, sd) => [ ...n ]
 -> in_range(min, max) => n in [min, max)
etc

@pkspyder007
Copy link

@prasunanand I am getting an error when I try to call LAPACK_dlarnv subroutine ( undefined reference to dlarnv )
Is there any specific way to call these functions in our ext folder?

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

No branches or pull requests

2 participants