Skip to content

Commit 4c5bf46

Browse files
committed
fix eig_trunc
1 parent 557bd36 commit 4c5bf46

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/factorizations/truncation.jl

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,12 @@ end
4141

4242
for f in [:eig_trunc!, :eigh_trunc!]
4343
@eval begin
44-
function MatrixAlgebraKit.$f(
45-
A::AbstractBlockSparseMatrix,
46-
out,
47-
alg::TruncatedAlgorithm{<:BlockPermutedDiagonalAlgorithm},
44+
function MatrixAlgebraKit.truncate!(
45+
::typeof($f),
46+
(D, V)::NTuple{2,AbstractBlockSparseMatrix},
47+
strategy::TruncationStrategy,
4848
)
49-
Ad, (invrowperm, invcolperm) = blockdiagonalize(A)
50-
blockalg = BlockDiagonalAlgorithm(alg.alg)
51-
blockstrategy = BlockDiagonalTruncationStrategy(alg.trunc)
52-
Dd, Vd = $f(Ad, TruncatedAlgorithm(blockalg, blockstrategy))
53-
54-
D = transform_rows(Dd, invrowperm)
55-
V = transform_cols(Vd, invcolperm)
56-
return D, V
49+
return truncate!($f, (D, V), BlockDiagonalTruncationStrategy(strategy))
5750
end
5851
end
5952
end

0 commit comments

Comments
 (0)