Skip to content

Commit

Permalink
Fix indentation. Remove old svds implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ViralBShah committed Oct 14, 2013
1 parent 78915d2 commit f1dc7be
Showing 1 changed file with 3 additions and 38 deletions.
41 changes: 3 additions & 38 deletions base/linalg/arnoldi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ using .ARPACK
## eigs

function eigs(A;nev::Integer=6, ncv::Integer=20, which::ASCIIString="LM",
tol=0.0, maxiter::Integer=1000, sigma=0,v0::Vector=zeros((0,)),
ritzvec::Bool=true, complexOP::Bool=false)
tol=0.0, maxiter::Integer=1000, sigma=0,v0::Vector=zeros((0,)),
ritzvec::Bool=true, complexOP::Bool=false)

(m, n) = size(A)
if m != n; error("Input must be square"); end
if n <= 6 && nev > n-1; nev = n-1; end
Expand Down Expand Up @@ -50,39 +51,3 @@ function eigs(A;nev::Integer=6, ncv::Integer=20, which::ASCIIString="LM",
workd, workl, lworkl, rwork)

end

## svds

# For a dense matrix A is ignored and At is actually A'*A
# sarupdate{T}(A::StridedMatrix{T}, At::StridedMatrix{T}, X::StridedVector{T}) = BLAS.symv('U', one(T), At, X)
# sarupdate{Tv,Ti}(A::SparseMatrixCSC{Tv,Ti}, At::SparseMatrixCSC{Tv,Ti}, X::StridedVector{Tv}) = At*(A*X)

# function svds{T<:Union(Float64,Float32)}(A::AbstractMatrix{T};
# nsv::Integer=6, ncv::Integer=20, which::ASCIIString="LA",
# tol=0.0, maxiter::Integer=1000,
# ritzvec::Bool=true)

# (m, n) = size(A)
# ncv = blas_int(min(max(2*nsv+2, ncv), n))
# # if m < n; error("m = $m, n = $n and only the m >= n case is implemented"); end
# sym = true
# cmplx = false
# bmat = "I"
# At = isa(A, StridedMatrix) ? BLAS.syrk('U','T',1.0,A) : A'
# sigma = 0
# mode = 1

# # Compute the Ritz values and Ritz vectors
# (resid, v, ldv, iparam, ipntr, workd, workl, lworkl, rwork) =
# ARPACK.aupd_wrapper(T, (x) -> sarupdate(A, At, x), n, sym, cmplx, bmat,
# nsv, ncv, which, tol, maxiter, mode)

# # Postprocessing to get eigenvalues and eigenvectors
# (svals, svecs) = ARPACK.eupd_wrapper(T, n, sym, cmplx, bmat, nsv, which, ritzvec,
# tol, resid, ncv, v, ldv, sigma, iparam, ipntr,
# workd, workl, lworkl, rwork)

# svals = sqrt(svals)
# ritzvec ? (A*svecs*diagm(1./svals), svals, v[:,1:nsv].') : svals
# end

0 comments on commit f1dc7be

Please sign in to comment.