-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
While writing docstrings for rand methods I found this:
julia> rand(GaussianLaguerre(2, 1.0), (3, 3))
ERROR: UndefVarError: `a` not defined in `RandomMatrices`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
[1] rand(d::GaussianLaguerre, dims::Tuple{Int64, Int64})
@ RandomMatrices ~/Documents/Julia Packages/JuliaMatrices/RandomMatrices.jl/src/GaussianEnsembles.jl:180
[2] top-level scope
@ REPL[54]:1
Originates from not accessing a from the object d. Tests should be added for this method too as it looks a little suspicious as is:
RandomMatrices.jl/src/GaussianEnsembles.jl
Lines 149 to 173 in c76044d
| mutable struct GaussianLaguerre <: ContinuousMatrixDistribution | |
| beta::Real | |
| a::Real | |
| end | |
| const Wishart = GaussianLaguerre | |
| #Generates a NxN Hermitian Wishart matrix | |
| #TODO Check - the eigenvalue distribution looks funky | |
| #TODO The appropriate matrix size should be calculated from a and one matrix dimension | |
| function rand(d::GaussianLaguerre, dims::Dim2) | |
| n = 2.0*a/d.beta | |
| if d.beta == 1 #real | |
| A = randn(dims) | |
| elseif d.beta == 2 #complex | |
| A = randn(dims) + im*randn(dims) | |
| elseif d.beta == 4 #quaternion | |
| #Employs 2x2 matrix representation of quaternions | |
| X = randn(dims) + im*randn(dims) | |
| Y = randn(dims) + im*randn(dims) | |
| A = [X Y; -conj(Y) conj(X)] | |
| error("beta = $(d.beta) is not implemented") | |
| end | |
| return (A * A') / dims[1] | |
| end |
Metadata
Metadata
Assignees
Labels
No labels