@@ -7,7 +7,7 @@ using MatrixAlgebraKit:
77 eigh_trunc!,
88 findtruncated,
99 svd_trunc!,
10- truncate!
10+ truncate
1111
1212"""
1313 BlockDiagonalTruncationStrategy(strategy::TruncationStrategy)
4141
4242for f in [:eig_trunc! , :eigh_trunc! ]
4343 @eval begin
44- function MatrixAlgebraKit. truncate! (
44+ function MatrixAlgebraKit. truncate (
4545 :: typeof ($ f),
4646 (D, V):: NTuple{2, AbstractBlockSparseMatrix} ,
4747 strategy:: TruncationStrategy ,
4848 )
49- return truncate! ($ f, (D, V), BlockDiagonalTruncationStrategy (strategy))
49+ return truncate ($ f, (D, V), BlockDiagonalTruncationStrategy (strategy))
5050 end
5151 end
5252end
@@ -74,23 +74,23 @@ function to_truncated_indices(values::AbstractBlockVector, I::AbstractVector{Boo
7474 return blocks
7575end
7676
77- function MatrixAlgebraKit. truncate! (
77+ function MatrixAlgebraKit. truncate (
7878 :: typeof (svd_trunc!),
7979 (U, S, Vᴴ):: NTuple{3, AbstractBlockSparseMatrix} ,
8080 strategy:: BlockDiagonalTruncationStrategy ,
8181 )
8282 I = findtruncated (diag (S), strategy)
83- return (U[:, I], S[I, I], Vᴴ[I, :])
83+ return (U[:, I], S[I, I], Vᴴ[I, :]), I
8484end
8585for f in [:eig_trunc! , :eigh_trunc! ]
8686 @eval begin
87- function MatrixAlgebraKit. truncate! (
87+ function MatrixAlgebraKit. truncate (
8888 :: typeof ($ f),
8989 (D, V):: NTuple{2, AbstractBlockSparseMatrix} ,
9090 strategy:: BlockDiagonalTruncationStrategy ,
9191 )
9292 I = findtruncated (diag (D), strategy)
93- return (D[I, I], V[:, I])
93+ return (D[I, I], V[:, I]), I
9494 end
9595 end
9696end
0 commit comments