Skip to content

Commit

Permalink
Better ARPACK complex tests (no longer use zero imaginary parts).
Browse files Browse the repository at this point in the history
dsaupd allocates ipntr of length 11 instead of 14, as per the docs.
  • Loading branch information
ViralBShah committed Oct 27, 2013
1 parent d17055d commit a4f429a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion base/linalg/arpack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ function aupd_wrapper(T, linop::Function, n::Integer,
info = ones(BlasInt, 1)
end
iparam = zeros(BlasInt, 11)
ipntr = zeros(BlasInt, 14)
if sym && !cmplx
ipntr = zeros(BlasInt, 11)
else
ipntr = zeros(BlasInt, 14)
end

ido = zeros(BlasInt, 1)

Expand Down
8 changes: 7 additions & 1 deletion test/arpack.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
begin
local n,a,asym,d,v
n = 10
a = rand(n,n)
areal = randn(n,n)
acmplx = complex(randn(n,n), randn(n,n))

for elty in (Float32, Float64, Complex64, Complex128)
if elty == Complex64 || elty == Complex128
a = acmplx
else
a = areal
end
a = convert(Matrix{elty}, a)
asym = a' + a # symmetric indefinite
apd = a'*a # symmetric positive-definite
Expand Down

0 comments on commit a4f429a

Please sign in to comment.