Skip to content

Commit 461243a

Browse files
authored
Add overloads for DefaultAlgorithm (#53)
* add specializations for default algorithm * bump v 0.3.11
1 parent 1a08a65 commit 461243a

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

‎Project.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BlockTensorKit"
22
uuid = "5f87ffc2-9cf1-4a46-8172-465d160bd8cd"
3-
version = "0.3.10"
3+
version = "0.3.11"
44
authors = ["Lukas Devos <ldevos98@gmail.com> and contributors"]
55

66
[deps]

‎src/linalg/factorizations.jl‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,27 @@ for f! in (
5555
end
5656
end
5757

58+
# Default algorithm
59+
# -----------------
60+
# Needed for disambiguation
61+
for f in [
62+
:lq_full, :lq_compact, :lq_null,
63+
:qr_full, :qr_compact, :qr_null,
64+
:schur_full, :schur_vals,
65+
:eig_full, :eig_vals, :eig_trunc, :eig_trunc_no_error,
66+
:eigh_full, :eigh_vals, :eigh_trunc, :eigh_trunc_no_error,
67+
:svd_full, :svd_compact, :svd_trunc, :svd_trunc_no_error, :svd_vals,
68+
:left_polar, :right_polar,
69+
:left_orth, :right_orth, :left_null, :right_null,
70+
:project_hermitian, :project_antihermitian, :project_isometric,
71+
]
72+
f! = Symbol(f, :!)
73+
@eval MAK.$f!(t::AbstractBlockTensorMap, alg::DefaultAlgorithm) =
74+
MAK.$f!(t, MAK.select_algorithm(MAK.$f!, t, nothing; alg.kwargs...))
75+
@eval MAK.$f!(t::AbstractBlockTensorMap, out, alg::DefaultAlgorithm) =
76+
MAK.$f!(t, out, MAK.select_algorithm(MAK.$f!, t, nothing; alg.kwargs...))
77+
end
78+
5879
# specializations until fixes in base package
5980
function MAK.is_left_isometric(A::BlockMatrix; atol::Real = 0, rtol::Real = MAK.defaulttol(A), norm = LinearAlgebra.norm)
6081
P = A' * A

0 commit comments

Comments
 (0)