@@ -159,43 +159,4 @@ function MatrixAlgebraKit._avgdiff!(A::StridedROCMatrix, B::StridedROCMatrix)
159159 return A, B
160160end
161161
162- function MatrixAlgebraKit. truncate (
163- :: typeof (left_null!), US:: Tuple{TU, TS} , strategy:: TruncationStrategy
164- ) where {TU <: ROCMatrix , TS}
165- # TODO : avoid allocation?
166- U, S = US
167- extended_S = vcat (diagview (S), zeros (eltype (S), max (0 , size (S, 1 ) - size (S, 2 ))))
168- ind = MatrixAlgebraKit. findtruncated (extended_S, strategy)
169- trunc_cols = collect (1 : size (U, 2 ))[ind]
170- Utrunc = U[:, trunc_cols]
171- return Utrunc, ind
172- end
173- function MatrixAlgebraKit. truncate (
174- :: typeof (right_null!), SVᴴ:: Tuple{TS, TVᴴ} , strategy:: TruncationStrategy
175- ) where {TS, TVᴴ <: ROCMatrix }
176- # TODO : avoid allocation?
177- S, Vᴴ = SVᴴ
178- extended_S = vcat (diagview (S), zeros (eltype (S), max (0 , size (S, 2 ) - size (S, 1 ))))
179- ind = MatrixAlgebraKit. findtruncated (extended_S, strategy)
180- trunc_rows = collect (1 : size (Vᴴ, 1 ))[ind]
181- Vᴴtrunc = Vᴴ[trunc_rows, :]
182- return Vᴴtrunc, ind
183- end
184-
185- # disambiguate:
186- function MatrixAlgebraKit. truncate (
187- :: typeof (left_null!), (U, S):: Tuple{TU, TS} , :: NoTruncation
188- ) where {TU <: ROCMatrix , TS}
189- m, n = size (S)
190- ind = (n + 1 ): m
191- return U[:, ind], ind
192- end
193- function MatrixAlgebraKit. truncate (
194- :: typeof (right_null!), (S, Vᴴ):: Tuple{TS, TVᴴ} , :: NoTruncation
195- ) where {TS, TVᴴ <: ROCMatrix }
196- m, n = size (S)
197- ind = (m + 1 ): n
198- return Vᴴ[ind, :], ind
199- end
200-
201162end
0 commit comments