@@ -137,6 +137,14 @@ if VERSION < v"1.10.0-DEV.1365"
137
137
end
138
138
139
139
# triangular
140
+ if isdefined (LinearAlgebra, :generic_trimatmul! ) # VERSION >= v"1.10-DEVXYZ"
141
+ # multiplication
142
+ LinearAlgebra. generic_trimatmul! (c:: oneStridedVector{T} , uploc, isunitc, tfun:: Function , A:: oneStridedMatrix{T} , b:: AbstractVector{T} ) where {T<: onemklFloat } =
143
+ trmv! (uploc, tfun === identity ? ' N' : tfun === transpose ? ' T' : ' C' , isunitc, A, c === b ? c : copyto! (c, b))
144
+ # division
145
+ LinearAlgebra. generic_trimatdiv! (C:: oneStridedVector{T} , uploc, isunitc, tfun:: Function , A:: oneStridedMatrix{T} , B:: AbstractVector{T} ) where {T<: onemklFloat } =
146
+ trsv! (uploc, tfun === identity ? ' N' : tfun === transpose ? ' T' : ' C' , isunitc, A, C === B ? C : copyto! (C, B))
147
+ else
140
148
# # direct multiplication/division
141
149
for (t, uploc, isunitc) in ((:LowerTriangular , ' L' , ' N' ),
142
150
(:UnitLowerTriangular , ' L' , ' U' ),
@@ -183,6 +191,7 @@ for (t, uploc, isunitc) in ((:LowerTriangular, 'U', 'N'),
183
191
trsv! ($ uploc, ' C' , $ isunitc, parent (parent (A)), B)
184
192
end
185
193
end
194
+ end # VERSION
186
195
187
196
188
197
#
@@ -254,23 +263,34 @@ end
254
263
end # VERSION
255
264
256
265
# triangular
266
+ if isdefined (LinearAlgebra, :generic_trimatmul! ) # VERSION >= v"1.10-DEVXYZ"
267
+ LinearAlgebra. generic_trimatmul! (C:: oneStridedMatrix{T} , uploc, isunitc, tfun:: Function , A:: oneStridedMatrix{T} , B:: oneStridedMatrix{T} ) where {T<: onemklFloat } =
268
+ trmm! (' L' , uploc, tfun === identity ? ' N' : tfun === transpose ? ' T' : ' C' , isunitc, one (T), A, C === B ? C : copyto! (C, B))
269
+ LinearAlgebra. generic_mattrimul! (C:: oneStridedMatrix{T} , uploc, isunitc, tfun:: Function , A:: oneStridedMatrix{T} , B:: oneStridedMatrix{T} ) where {T<: onemklFloat } =
270
+ trmm! (' R' , uploc, tfun === identity ? ' N' : tfun === transpose ? ' T' : ' C' , isunitc, one (T), B, C === A ? C : copyto! (C, A))
271
+ LinearAlgebra. generic_trimatdiv! (C:: oneStridedMatrix{T} , uploc, isunitc, tfun:: Function , A:: oneStridedMatrix{T} , B:: oneStridedMatrix{T} ) where {T<: onemklFloat } =
272
+ trsm! (' L' , uploc, tfun === identity ? ' N' : tfun === transpose ? ' T' : ' C' , isunitc, one (T), A, C === B ? C : copyto! (C, B))
273
+ LinearAlgebra. generic_mattridiv! (C:: oneStridedMatrix{T} , uploc, isunitc, tfun:: Function , A:: oneStridedMatrix{T} , B:: oneStridedMatrix{T} ) where {T<: onemklFloat } =
274
+ trsm! (' R' , uploc, tfun === identity ? ' N' : tfun === transpose ? ' T' : ' C' , isunitc, one (T), B, C === A ? C : copyto! (C, A))
275
+ else
257
276
# # direct multiplication/division
258
277
for (t, uploc, isunitc) in ((:LowerTriangular , ' L' , ' N' ),
259
278
(:UnitLowerTriangular , ' L' , ' U' ),
260
279
(:UpperTriangular , ' U' , ' N' ),
261
280
(:UnitUpperTriangular , ' U' , ' U' ))
262
281
@eval begin
263
282
# Multiplication
264
- LinearAlgebra. lmul! (A:: $t{T,<:oneStridedVecOrMat } ,
265
- B:: oneStridedVecOrMat {T} ) where {T<: onemklFloat } =
266
- trmm! (' L' , $ uploc, ' N' , $ isunitc, one (T), parent (A), B, B )
267
- LinearAlgebra. rmul! (A:: oneStridedVecOrMat {T} ,
268
- B:: $t{T,<:oneStridedVecOrMat } ) where {T<: onemklFloat } =
269
- trmm! (' R' , $ uploc, ' N' , $ isunitc, one (T), parent (B), A, A )
283
+ LinearAlgebra. lmul! (A:: $t{T,<:oneStridedMatrix } ,
284
+ B:: oneStridedMatrix {T} ) where {T<: onemklFloat } =
285
+ trmm! (' L' , $ uploc, ' N' , $ isunitc, one (T), parent (A), B)
286
+ LinearAlgebra. rmul! (A:: oneStridedMatrix {T} ,
287
+ B:: $t{T,<:oneStridedMatrix } ) where {T<: onemklFloat } =
288
+ trmm! (' R' , $ uploc, ' N' , $ isunitc, one (T), parent (B), A)
270
289
271
290
# Left division
272
- LinearAlgebra. ldiv! (A:: $t{T,<:oneStridedVecOrMat } ,
273
- B:: oneStridedVecOrMat {T} ) where {T<: onemklFloat } =
291
+ LinearAlgebra. ldiv! (A:: $t{T,<:oneStridedMatrix } ,
292
+ B:: oneStridedMatrix {T} ) where {T<: onemklFloat } =
274
293
trsm! (' L' , $ uploc, ' N' , $ isunitc, one (T), parent (A), B)
275
294
end
276
295
end
296
+ end # VERSION
0 commit comments