File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
function Random. rand (rng:: AbstractRNG , :: Random.SamplerType{R} ) where R <: Union{<:Rotation{2},<:RotMatrix{2}}
2
- # Union{<:Rotation{2},<:RotMatrix{2}} seems able to be replaced with Rotation{2},
3
- # but it avoids the method for general dimensional RotMatrix.
2
+ # We use the awkward Union{<:Rotation{2},<:RotMatrix{2}} here rather than ` Rotation{2}`
3
+ # to make this efficient 2D method more specific than the method for general ` RotMatrix` .
4
4
T = eltype (R)
5
5
if T == Any
6
6
T = Float64
13
13
# The unit sphere in R⁴ parameterizes quaternion rotations according to the
14
14
# Haar measure of SO(3) - see e.g. http://math.stackexchange.com/questions/184086/uniform-distributions-on-the-space-of-rotations-in-3d
15
15
function Random. rand (rng:: AbstractRNG , :: Random.SamplerType{R} ) where R <: Union{<:Rotation{3},<:RotMatrix{3}}
16
- # Union{<:Rotation{3 },<:RotMatrix{3 }} seems able to be replaced with Rotation{3},
17
- # but it avoids the method for general dimensional RotMatrix.
16
+ # We use the awkward Union{<:Rotation{2 },<:RotMatrix{2 }} here rather than ` Rotation{2}`
17
+ # to make this efficient 3D method more specific than the method for general ` RotMatrix` .
18
18
T = eltype (R)
19
19
if T == Any
20
20
T = Float64
You can’t perform that action at this time.
0 commit comments