Skip to content

Commit a17c1a3

Browse files
committed
Adjoint factorizations (AD not working)
1 parent d3d6a24 commit a17c1a3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/factorizations/adjoint.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ for (left_f!, right_f!) in zip(
6969
end
7070
end
7171

72+
for (left_f, right_f) in zip(
73+
(:qr_full, :qr_compact, :left_polar, :left_orth),
74+
(:lq_full, :lq_compact, :right_polar, :right_orth)
75+
)
76+
@eval function MAK.$left_f(t::AdjointTensorMap; kwargs...)
77+
return reverse(adjoint.($right_f(adjoint(t); kwargs...)))
78+
end
79+
@eval function MAK.$right_f(t::AdjointTensorMap; kwargs...)
80+
return reverse(adjoint.($left_f(adjoint(t); kwargs...)))
81+
end
82+
end
83+
84+
function MAK.eig_full(t::AdjointTensorMap; kwargs...)
85+
DV = eig_full(adjoint(t); kwargs...)
86+
return (DV[1], adjoint(DV[2]))
87+
end
88+
89+
7290
# 3-arg functions
7391
for f! in (:svd_full!, :svd_compact!, :svd_trunc!)
7492
@eval function MAK.copy_input(::typeof($f!), t::AdjointTensorMap)

0 commit comments

Comments
 (0)