Skip to content

Commit a11cbe5

Browse files
committed
Rewrite A[ct]_(mul|ldiv|rdiv)_B[ct][!] calls in stdlib/IterativeEigenSolvers as *, /, \, mul!, ldiv!, or rdiv!.
1 parent fa97d9c commit a11cbe5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

stdlib/IterativeEigenSolvers/src/IterativeEigenSolvers.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Arnoldi and Lanczos iteration for computing eigenvalues
77
"""
88
module IterativeEigenSolvers
99

10-
using Base.LinAlg: BlasFloat, BlasInt, SVD, checksquare
10+
using Base.LinAlg: BlasFloat, BlasInt, SVD, checksquare, mul!, Adjoint, Transpose
1111

1212
export eigs, svds
1313

@@ -152,7 +152,7 @@ function _eigs(A, B;
152152
end
153153

154154
# Refer to ex-*.doc files in ARPACK/DOCUMENTS for calling sequence
155-
matvecA!(y, x) = A_mul_B!(y, A, x)
155+
matvecA!(y, x) = mul!(y, A, x)
156156
if !isgeneral # Standard problem
157157
matvecB = x -> x
158158
if !isshift # Regular mode
@@ -207,8 +207,8 @@ end
207207

208208
function Base.LinAlg.mul!(y::StridedVector{T}, A::SVDAugmented{T}, x::StridedVector{T}) where T
209209
m, mn = size(A.X, 1), length(x)
210-
A_mul_B!( view(y, 1:m), A.X, view(x, m + 1:mn)) # left singular vector
211-
Ac_mul_B!(view(y, m + 1:mn), A.X, view(x, 1:m)) # right singular vector
210+
mul!( view(y, 1:m), A.X, view(x, m + 1:mn)) # left singular vector
211+
mul!(view(y, m + 1:mn), Adjoint(A.X), view(x, 1:m)) # right singular vector
212212
return y
213213
end
214214
Base.size(A::SVDAugmented) = ((+)(size(A.X)...), (+)(size(A.X)...))
@@ -227,11 +227,11 @@ end
227227

228228
function Base.LinAlg.mul!(y::StridedVector{T}, A::AtA_or_AAt{T}, x::StridedVector{T}) where T
229229
if size(A.A, 1) >= size(A.A, 2)
230-
A_mul_B!(A.buffer, A.A, x)
231-
return Ac_mul_B!(y, A.A, A.buffer)
230+
mul!(A.buffer, A.A, x)
231+
return mul!(y, Adjoint(A.A), A.buffer)
232232
else
233-
Ac_mul_B!(A.buffer, A.A, x)
234-
return A_mul_B!(y, A.A, A.buffer)
233+
mul!(A.buffer, Adjoint(A.A), x)
234+
return mul!(y, A.A, A.buffer)
235235
end
236236
end
237237
Base.size(A::AtA_or_AAt) = ntuple(i -> min(size(A.A)...), Val(2))

stdlib/IterativeEigenSolvers/test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function Base.LinAlg.mul!(rho2::StridedVector{T},Phi::CPM{T},rho::StridedVector{
148148
return copy!(rho2,rho1)
149149
end
150150
Base.LinAlg.A_mul_B!(rho2::StridedVector{T},Phi::CPM{T},rho::StridedVector{T}) where {T<:Base.LinAlg.BlasFloat} = Base.LinAlg.mul!(rho2, Phi, rho)
151-
# after the A_mul_B! deprecation, remove this A_mul_B! def and the import above
151+
# after the A_mul_B! deprecation, remove this A_mul_B! def
152152

153153
let
154154
# Generate random isometry

0 commit comments

Comments
 (0)