@@ -8,7 +8,7 @@ using MatrixAlgebraKit: default_eigh_algorithm, eigh_full!, eigh_vals!
8
8
for f in [:default_eig_algorithm , :default_eigh_algorithm ]
9
9
@eval begin
10
10
function MatrixAlgebraKit. $f (:: Type{<:AbstractBlockSparseMatrix} ; kwargs... )
11
- return BlockPermutedDiagonalAlgorithm () do block
11
+ return BlockDiagonalAlgorithm () do block
12
12
return $ f (block; kwargs... )
13
13
end
14
14
end
@@ -28,23 +28,6 @@ function output_type(::typeof(eigh_full!), A::Type{<:AbstractMatrix{T}}) where {
28
28
return isconcretetype (DV) ? DV : Tuple{AbstractMatrix{real (T)},AbstractMatrix{T}}
29
29
end
30
30
31
- function MatrixAlgebraKit. initialize_output (
32
- :: Union{typeof(eig_full!),typeof(eigh_full!)} ,
33
- :: AbstractBlockSparseMatrix ,
34
- :: BlockPermutedDiagonalAlgorithm ,
35
- )
36
- return nothing
37
- end
38
-
39
- function MatrixAlgebraKit. check_input (
40
- :: Union{typeof(eig_full!),typeof(eigh_full!)} ,
41
- A:: AbstractBlockSparseMatrix ,
42
- DV,
43
- :: BlockPermutedDiagonalAlgorithm ,
44
- )
45
- @assert isblockpermuteddiagonal (A)
46
- return nothing
47
- end
48
31
function MatrixAlgebraKit. check_input (
49
32
:: typeof (eig_full!), A:: AbstractBlockSparseMatrix , (D, V), :: BlockDiagonalAlgorithm
50
33
)
69
52
70
53
for f in [:eig_full! , :eigh_full! ]
71
54
@eval begin
72
- function MatrixAlgebraKit. initialize_output (
73
- :: typeof ($ f), A:: AbstractBlockSparseMatrix , alg:: BlockPermutedDiagonalAlgorithm
74
- )
75
- return nothing
76
- end
77
55
function MatrixAlgebraKit. initialize_output (
78
56
:: typeof ($ f), A:: AbstractBlockSparseMatrix , alg:: BlockDiagonalAlgorithm
79
57
)
@@ -82,16 +60,6 @@ for f in [:eig_full!, :eigh_full!]
82
60
V = similar (A, BlockType (Tv))
83
61
return (D, V)
84
62
end
85
- function MatrixAlgebraKit. $f (
86
- A:: AbstractBlockSparseMatrix , DV, alg:: BlockPermutedDiagonalAlgorithm
87
- )
88
- MatrixAlgebraKit. check_input ($ f, A, DV, alg)
89
- Ad, (invrowperm, invcolperm) = blockdiagonalize (A)
90
- Dd, Vd = $ f (Ad, BlockDiagonalAlgorithm (alg))
91
- D = transform_rows (Dd, invrowperm)
92
- V = transform_cols (Vd, invcolperm)
93
- return D, V
94
- end
95
63
function MatrixAlgebraKit. $f (
96
64
A:: AbstractBlockSparseMatrix , (D, V), alg:: BlockDiagonalAlgorithm
97
65
)
128
96
129
97
for f in [:eig_vals! , :eigh_vals! ]
130
98
@eval begin
131
- function MatrixAlgebraKit. initialize_output (
132
- :: typeof ($ f), A:: AbstractBlockSparseMatrix , alg:: BlockPermutedDiagonalAlgorithm
133
- )
134
- return nothing
135
- end
136
99
function MatrixAlgebraKit. initialize_output (
137
100
:: typeof ($ f), A:: AbstractBlockSparseMatrix , alg:: BlockDiagonalAlgorithm
138
101
)
139
102
T = output_type ($ f, blocktype (A))
140
103
return similar (A, BlockType (T), axes (A, 1 ))
141
104
end
142
- function MatrixAlgebraKit. check_input (
143
- :: typeof ($ f), A:: AbstractBlockSparseMatrix , D, :: BlockPermutedDiagonalAlgorithm
144
- )
145
- @assert isblockpermuteddiagonal (A)
146
- return nothing
147
- end
148
105
function MatrixAlgebraKit. check_input (
149
106
:: typeof ($ f), A:: AbstractBlockSparseMatrix , D, :: BlockDiagonalAlgorithm
150
107
)
@@ -156,14 +113,6 @@ for f in [:eig_vals!, :eigh_vals!]
156
113
return nothing
157
114
end
158
115
159
- function MatrixAlgebraKit. $f (
160
- A:: AbstractBlockSparseMatrix , D, alg:: BlockPermutedDiagonalAlgorithm
161
- )
162
- MatrixAlgebraKit. check_input ($ f, A, D, alg)
163
- Ad, (invrowperm, _) = blockdiagonalize (A)
164
- Dd = $ f (Ad, BlockDiagonalAlgorithm (alg))
165
- return transform_rows (Dd, invrowperm)
166
- end
167
116
function MatrixAlgebraKit. $f (
168
117
A:: AbstractBlockSparseMatrix , D, alg:: BlockDiagonalAlgorithm
169
118
)
0 commit comments