@@ -6,55 +6,10 @@ using LinearAlgebra: LinearAlgebra, I, mul!
66using MatrixAlgebraKit: LAPACK_SVDAlgorithm, check_input, copy_input, default_svd_algorithm,
77 initialize_output, AbstractAlgorithm
88
9- eltypes = (Float32, Float64, ComplexF32, ComplexF64)
10-
11- # Used to test non-AbstractMatrix codepaths.
12- struct LinearMap{P <: AbstractMatrix }
13- parent:: P
14- end
15- Base. parent(A:: LinearMap ) = getfield(A, :parent)
16- function Base. copy!(dest:: LinearMap , src:: LinearMap )
17- copy!(parent(dest), parent(src))
18- return dest
19- end
20- function LinearAlgebra. mul!(C:: LinearMap , A:: LinearMap , B:: LinearMap )
21- mul!(parent(C), parent(A), parent(B))
22- return C
23- end
9+ # testing non-AbstractArray codepaths:
10+ include(" linearmap.jl" )
2411
25- function MatrixAlgebraKit. copy_input(:: typeof (qr_compact), A:: LinearMap )
26- return LinearMap(copy_input(qr_compact, parent(A)))
27- end
28- function MatrixAlgebraKit. copy_input(:: typeof (lq_compact), A:: LinearMap )
29- return LinearMap(copy_input(lq_compact, parent(A)))
30- end
31- function MatrixAlgebraKit. initialize_output(:: typeof (left_orth!), A:: LinearMap )
32- return LinearMap.(initialize_output(left_orth!, parent(A)))
33- end
34- function MatrixAlgebraKit. initialize_output(:: typeof (right_orth!), A:: LinearMap )
35- return LinearMap.(initialize_output(right_orth!, parent(A)))
36- end
37- function MatrixAlgebraKit. check_input(
38- :: typeof (left_orth!), A:: LinearMap , VC, alg:: AbstractAlgorithm
39- )
40- return check_input(left_orth!, parent(A), parent.(VC), alg)
41- end
42- function MatrixAlgebraKit. check_input(
43- :: typeof (right_orth!), A:: LinearMap , VC, alg:: AbstractAlgorithm
44- )
45- return check_input(right_orth!, parent(A), parent.(VC), alg)
46- end
47- function MatrixAlgebraKit. default_svd_algorithm(:: Type{LinearMap{A}} ; kwargs... ) where {A}
48- return default_svd_algorithm(A; kwargs... )
49- end
50- function MatrixAlgebraKit. initialize_output(
51- :: typeof (svd_compact!), A:: LinearMap , alg:: LAPACK_SVDAlgorithm
52- )
53- return LinearMap.(initialize_output(svd_compact!, parent(A), alg))
54- end
55- function MatrixAlgebraKit. svd_compact!(A:: LinearMap , USVᴴ, alg:: LAPACK_SVDAlgorithm )
56- return LinearMap.(svd_compact!(parent(A), parent.(USVᴴ), alg))
57- end
12+ eltypes = (Float32, Float64, ComplexF32, ComplexF64)
5813
5914@testset " left_orth and left_null for T = $T " for T in eltypes
6015 rng = StableRNG(123 )
0 commit comments