-
Notifications
You must be signed in to change notification settings - Fork 37
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
Improvements for drawing random numbers #42
Conversation
@KristofferC can you review this or recommend someone who can? |
Codecov Report
@@ Coverage Diff @@
## master #42 +/- ##
==========================================
+ Coverage 39.18% 43.78% +4.60%
==========================================
Files 3 3
Lines 342 354 +12
==========================================
+ Hits 134 155 +21
+ Misses 208 199 -9
Continue to review full report at Codecov.
|
The PR now adds also |
This PR adds an optional
AbstractRNG
parameter toquatrand
andnquatrand
.It also implements the necessary overloads to call methods like
Base.rand(Quaternion{Float64}, 10)
andBase.randn(Quaternion{Float64}, 10)
. These behave differently fromquatrand
, instead following the pattern set in base byBase.rand(<:Complex)
. Namely,rand
draws each of the four real numbers from the interval[0,1]
.randn
draws from the proper Quaternion normal distribution, which requires a scaling by1/sqrt(4)
(as opposed toComplex
which uses a scaling of1/sqrt(2)
).