Skip to content

Commit

Permalink
Appears to fix #7488.
Browse files Browse the repository at this point in the history
Some ARPACK inteface tweaks.
  • Loading branch information
ViralBShah committed Jul 1, 2014
1 parent b8d7e12 commit 6e0d943
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
8 changes: 6 additions & 2 deletions base/linalg/arpack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ function aupd_wrapper(T, matvecA::Function, matvecB::Function, solveSI::Function
workd[store_idx] = solveSI(matvecA(x))
end
elseif mode == 3
workd[store_idx] = solveSI(workd[ipntr[3]+zernm1])
if bmat == "I"
workd[store_idx] = solveSI(x)
else
workd[store_idx] = solveSI(workd[ipntr[3]+zernm1])
end
end
elseif ido[1] == 2
workd[store_idx] = matvecB(x)
Expand Down Expand Up @@ -145,7 +149,7 @@ function eupd_wrapper(T, n::Integer, sym::Bool, cmplx::Bool, bmat::ASCIIString,
evec = complex(zeros(T, n, nev+1), zeros(T, n, nev+1))
j = 1
while j <= nev
if di[j] == 0.0
if di[j] == 0
evec[:,j] = v[:,j]
else
evec[:,j] = v[:,j] + im*v[:,j+1]
Expand Down
28 changes: 19 additions & 9 deletions base/sparse/sparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1742,13 +1742,18 @@ function ishermitian(A::SparseMatrixCSC)
end

function istriu{Tv}(A::SparseMatrixCSC{Tv})
for col = 1:min(A.n,A.m-1)
l1 = A.colptr[col+1]-1
for i = 0 : (l1 - A.colptr[col])
if A.rowval[l1-i] <= col
m, n = size(A)
colptr = A.colptr
rowval = A.rowval
nzval = A.nzval

for col = 1:min(n, m-1)
l1 = colptr[col+1]-1
for i = 0 : (l1 - colptr[col])
if rowval[l1-i] <= col
break
end
if A.nzval[l1-i] != 0
if nzval[l1-i] != 0
return false
end
end
Expand All @@ -1757,12 +1762,17 @@ function istriu{Tv}(A::SparseMatrixCSC{Tv})
end

function istril{Tv}(A::SparseMatrixCSC{Tv})
for col = 2:A.n
for i = A.colptr[col] : (A.colptr[col+1]-1)
if A.rowval[i] >= col
m, n = size(A)
colptr = A.colptr
rowval = A.rowval
nzval = A.nzval

for col = 2:n
for i = colptr[col] : (colptr[col+1]-1)
if rowval[i] >= col
break
end
if A.nzval[i] != 0
if nzval[i] != 0
return false
end
end
Expand Down

0 comments on commit 6e0d943

Please sign in to comment.