Skip to content

Commit 0f927db

Browse files
committed
Fixed Haar sampling
1 parent 8a5a9fd commit 0f927db

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/HaarMeasure.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import Base.rand
2222
#TODO implement O(n^2) method
2323
function rand(W::Haar, n::Integer, doCorrection::Integer)
2424
beta = W.beta
25-
M=rand(Ginibre(n, beta))
25+
M=rand(Ginibre(beta,n))
2626
q,r=qr(M)
2727
if doCorrection==0
2828
q
2929
elseif doCorrection==1
3030
if beta==1
31-
L = sign(rand(n)-0.5)
31+
L = sign(rand(n).-0.5)
3232
elseif beta==2
3333
L = exp(im*rand(n)*2pi)
3434
elseif beta==4
@@ -53,7 +53,7 @@ end
5353
#By default, always do piecewise correction
5454
#For most applications where you use the HaarMatrix as a similarity transform
5555
#it doesn't matter, but better safe than sorry... let the user choose else
56-
rand(W::Haar) = rand(W, 1)
56+
rand(W::Haar,n::Integer) = rand(W,n, 1)
5757

5858
#A utility method to check if the piecewise correction is needed
5959
#This checks the R part of the QR factorization; if correctly done,

0 commit comments

Comments
 (0)