@@ -7,7 +7,7 @@ Arnoldi and Lanczos iteration for computing eigenvalues
7
7
"""
8
8
module IterativeEigenSolvers
9
9
10
- using Base. LinAlg: BlasFloat, BlasInt, SVD, checksquare
10
+ using Base. LinAlg: BlasFloat, BlasInt, SVD, checksquare, mul!, Adjoint, Transpose
11
11
12
12
export eigs, svds
13
13
@@ -152,7 +152,7 @@ function _eigs(A, B;
152
152
end
153
153
154
154
# 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)
156
156
if ! isgeneral # Standard problem
157
157
matvecB = x -> x
158
158
if ! isshift # Regular mode
207
207
208
208
function Base. LinAlg. mul! (y:: StridedVector{T} , A:: SVDAugmented{T} , x:: StridedVector{T} ) where T
209
209
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
212
212
return y
213
213
end
214
214
Base. size (A:: SVDAugmented ) = ((+ )(size (A. X)... ), (+ )(size (A. X)... ))
@@ -227,11 +227,11 @@ end
227
227
228
228
function Base. LinAlg. mul! (y:: StridedVector{T} , A:: AtA_or_AAt{T} , x:: StridedVector{T} ) where T
229
229
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)
232
232
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)
235
235
end
236
236
end
237
237
Base. size (A:: AtA_or_AAt ) = ntuple (i -> min (size (A. A)... ), Val (2 ))
0 commit comments