@@ -107,13 +107,26 @@ function left_orth_polar!(A, VC, alg)
107107 return left_polar! (A, VC, alg′)
108108end
109109function left_orth_svd! (A, VC, alg, trunc:: Nothing = nothing )
110+ alg′ = select_algorithm (svd_compact!, A, alg)
111+ U, S, Vᴴ = svd_compact! (A, alg′)
112+ V, C = VC
113+ return copy! (V, U), mul! (C, S, Vᴴ)
114+ end
115+ function left_orth_svd! (A:: AbstractMatrix , VC, alg, trunc:: Nothing = nothing )
110116 alg′ = select_algorithm (svd_compact!, A, alg)
111117 V, C = VC
112118 S = Diagonal (initialize_output (svd_vals!, A, alg′))
113119 U, S, Vᴴ = svd_compact! (A, (V, S, C), alg′)
114120 return U, lmul! (S, Vᴴ)
115121end
116122function left_orth_svd! (A, VC, alg, trunc)
123+ alg′ = select_algorithm (svd_compact!, A, alg)
124+ alg_trunc = select_algorithm (svd_trunc!, A, alg′; trunc)
125+ U, S, Vᴴ = svd_trunc! (A, alg_trunc)
126+ V, C = VC
127+ return copy! (V, U), mul! (C, S, Vᴴ)
128+ end
129+ function left_orth_svd! (A:: AbstractMatrix , VC, alg, trunc)
117130 alg′ = select_algorithm (svd_compact!, A, alg)
118131 alg_trunc = select_algorithm (svd_trunc!, A, alg′; trunc)
119132 V, C = VC
@@ -148,13 +161,26 @@ function right_orth_polar!(A, CVᴴ, alg)
148161 return right_polar! (A, CVᴴ, alg′)
149162end
150163function right_orth_svd! (A, CVᴴ, alg, trunc:: Nothing = nothing )
164+ alg′ = select_algorithm (svd_compact!, A, alg)
165+ U, S, Vᴴ′ = svd_compact! (A, alg′)
166+ C, Vᴴ = CVᴴ
167+ return mul! (C, U, S), copy! (Vᴴ, Vᴴ′)
168+ end
169+ function right_orth_svd! (A:: AbstractMatrix , CVᴴ, alg, trunc:: Nothing = nothing )
151170 alg′ = select_algorithm (svd_compact!, A, alg)
152171 C, Vᴴ = CVᴴ
153172 S = Diagonal (initialize_output (svd_vals!, A, alg′))
154173 U, S, Vᴴ = svd_compact! (A, (C, S, Vᴴ), alg′)
155174 return rmul! (U, S), Vᴴ
156175end
157176function right_orth_svd! (A, CVᴴ, alg, trunc)
177+ alg′ = select_algorithm (svd_compact!, A, alg)
178+ alg_trunc = select_algorithm (svd_trunc!, A, alg′; trunc)
179+ U, S, Vᴴ′ = svd_trunc! (A, alg_trunc)
180+ C, Vᴴ = CVᴴ
181+ return mul! (C, U, S), copy! (Vᴴ, Vᴴ′)
182+ end
183+ function right_orth_svd! (A:: AbstractMatrix , CVᴴ, alg, trunc)
158184 alg′ = select_algorithm (svd_compact!, A, alg)
159185 alg_trunc = select_algorithm (svd_trunc!, A, alg′; trunc)
160186 C, Vᴴ = CVᴴ
0 commit comments