@@ -30,10 +30,10 @@ function _mul!(Y::AbstractMatrix, A::AbstractMatrix, X::AbstractMatrix, α, β,
30
30
Y
31
31
end
32
32
33
- A_mul_B ! (y:: AbstractVector , A:: AbstractBlockBandedMatrix , b:: AbstractVector ) =
33
+ mul ! (y:: AbstractVector , A:: AbstractBlockBandedMatrix , b:: AbstractVector ) =
34
34
mul! (fill! (y, zero (eltype (y))), A, b, one (eltype (A)), zero (eltype (y)))
35
35
36
- A_mul_B ! (y:: AbstractMatrix , A:: AbstractBlockBandedMatrix , b:: AbstractMatrix ) =
36
+ mul ! (y:: AbstractMatrix , A:: AbstractBlockBandedMatrix , b:: AbstractMatrix ) =
37
37
mul! (fill! (y, zero (eltype (y))), A, b, one (eltype (A)), zero (eltype (y)))
38
38
39
39
54
54
55
55
56
56
const BBBOrStridedVecOrMat{T} = Union{BlockBandedBlock{T}, StridedVecOrMat{T}}
57
+
58
+ * (V:: BlockBandedBlock{T} , b:: AbstractVector{T} ) where T<: BlasFloat =
59
+ mul! (Array {T} (undef, size (V,1 )), V, b, one (T), zero (T))
60
+
57
61
if VERSION < v " 0.7-"
58
62
BLAS. gemv! (trans:: Char , α:: T , A:: BlockBandedBlock{T} , X:: AbstractVector{T} , β:: T , Y:: AbstractVector{T} ) where T <: BlasFloat =
59
63
gemv! (trans, α, A, X, β, Y)
@@ -144,7 +148,7 @@ function *(A::BlockBandedMatrix{T}, B::BlockBandedMatrix{V}) where {T<:Number,V<
144
148
n,m = size (A,1 ), size (B,2 )
145
149
146
150
l, u = A. l+ B. l, A. u+ B. u
147
- A_mul_B ! (BlockBandedMatrix {promote_type(T,V)} (undef,
151
+ mul ! (BlockBandedMatrix {promote_type(T,V)} (undef,
148
152
BlockBandedSizes (BlockSizes ((Arows,Bcols)), l, u)),
149
153
A, B)
150
154
end
@@ -169,7 +173,7 @@ function *(A::BandedBlockBandedMatrix{T}, B::BandedBlockBandedMatrix{V}) where {
169
173
170
174
bs = BandedBlockBandedSizes (BlockSizes ((Arows,Bcols)), A. l+ B. l, A. u+ B. u, A. λ+ B. λ, A. μ+ B. μ)
171
175
172
- A_mul_B ! (BandedBlockBandedMatrix {promote_type(T,V)} (undef, bs),
176
+ mul ! (BandedBlockBandedMatrix {promote_type(T,V)} (undef, bs),
173
177
A, B)
174
178
end
175
179
227
231
# BlockIndexRange subblocks
228
232
# ###
229
233
230
- A_mul_B ! (c:: AbstractVector{T} , V:: BlockBandedBlock{T} , b:: AbstractVector{T} ) where T<: BlasFloat =
231
- mul! (c, V, b, one (T), zero (T))
234
+ mul ! (c:: AbstractVector{T} , V:: BlockBandedBlock{T} , b:: AbstractVector{T} ) where T<: BlasFloat =
235
+ BandedMatrices . mul! (c, V, b, one (T), zero (T))
232
236
233
237
const BlockIndexRange1 = BlockIndexRange{1 ,Tuple{UnitRange{Int64}}}
234
238
const BlockRangeBlockSubBlockBandedMatrix{T} = SubArray{T,2 ,BlockBandedMatrix{T},Tuple{BlockSlice{BlockRange1},BlockSlice{Block{1 ,Int}}}}
@@ -329,17 +333,17 @@ end
329
333
# back substitution
330
334
# #####
331
335
332
- @inline A_ldiv_B ! (U:: UpperTriangular{T, BLOCK} , b:: StridedVecOrMat{T} ) where BLOCK <: Union{BlockBandedBlock{T}, BlockBandedSubBlock{T}} where T<: BlasFloat =
336
+ @inline ldiv ! (U:: UpperTriangular{T, BLOCK} , b:: StridedVecOrMat{T} ) where BLOCK <: Union{BlockBandedBlock{T}, BlockBandedSubBlock{T}} where T<: BlasFloat =
333
337
trtrs! (' U' , ' N' , ' N' , parent (U), b)
334
338
335
- @inline A_ldiv_B ! (U:: UpperTriangular{T, BlockBandedBlock{T}} , b:: StridedVecOrMat{T} ) where {T<: BlasFloat } =
339
+ @inline ldiv ! (U:: UpperTriangular{T, BlockBandedBlock{T}} , b:: StridedVecOrMat{T} ) where {T<: BlasFloat } =
336
340
trtrs! (' U' , ' N' , ' N' , parent (U), b)
337
341
338
342
339
343
@inline hasmatchingblocks (A) =
340
344
block_sizes (A). cumul_sizes[1 ] == block_sizes (A). cumul_sizes[2 ]
341
345
342
- function A_ldiv_B ! (U:: UpperTriangular{T, BM} , b:: StridedVector ) where BM <: Union{BlockBandedMatrix{T}, BlockBandedSubBlockBandedMatrix{T}} where T
346
+ function ldiv ! (U:: UpperTriangular{T, BM} , b:: StridedVector ) where BM <: Union{BlockBandedMatrix{T}, BlockBandedSubBlockBandedMatrix{T}} where T
343
347
A = parent (U)
344
348
345
349
@boundscheck size (A,1 ) == length (b) || throw (BoundsError (A))
@@ -363,7 +367,7 @@ function blockbanded_squareblocks_trtrs!(A::AbstractMatrix{T}, b::AbstractVector
363
367
for K = N: - 1 : 1
364
368
V_22 = view (A, Block (K), Block (K))
365
369
b_2 = view (b, parentindices (V_22)[1 ]. indices)
366
- A_ldiv_B ! (UpperTriangular (V_22), b_2)
370
+ ldiv ! (UpperTriangular (V_22), b_2)
367
371
368
372
V_12 = view (A, blockcolstart (A, K): Block (K- 1 ), Block (K))
369
373
b̃_1 = view (b, parentindices (V_12)[1 ]. indices)
@@ -383,7 +387,7 @@ function hasmatchingblocks(V::SubArray{T,2,BlockBandedMatrix{T},Tuple{UnitRange{
383
387
end
384
388
385
389
# Write U as [U_11 U_12; 0 U_22] and b = [b_1,b_2,b_3] to use efficient block versions
386
- function A_ldiv_B ! (U:: UpperTriangular{T,SV} ,
390
+ function ldiv ! (U:: UpperTriangular{T,SV} ,
387
391
b:: AbstractVector{T} ) where SV<: SubArray{T,2,BlockBandedMatrix{T},Tuple{UnitRange{Int},UnitRange{Int}}} where T
388
392
V = parent (U)
389
393
if hasmatchingblocks (V)
@@ -401,15 +405,15 @@ function blockbanded_squareblocks_intrange_trtrs!(V::AbstractMatrix{T}, b::Abstr
401
405
402
406
V_22 = view (A, Block (N)[1 : N_n], Block (N)[1 : N_n])
403
407
b_2 = view (b, parentindices (V_22)[1 ]. indices)
404
- A_ldiv_B ! (UpperTriangular (V_22), b_2)
408
+ ldiv ! (UpperTriangular (V_22), b_2)
405
409
406
410
V_12 = view (A, blockcolstart (A, N): Block (N- 1 ), Block (N)[1 : N_n])
407
411
b̃_1 = view (b, parentindices (V_12)[1 ]. indices)
408
412
mul! (b̃_1, V_12, b_2, - one (T), one (T))
409
413
410
414
V_11 = view (A, Block .(1 : N- 1 ), Block .(1 : N- 1 ))
411
415
b_1 = view (b, parentindices (V_11)[1 ]. indices)
412
- A_ldiv_B ! (UpperTriangular (V_11), b_1)
416
+ ldiv ! (UpperTriangular (V_11), b_1)
413
417
b
414
418
end
415
419
@@ -486,7 +490,7 @@ function blockbanded_rectblocks_trtrs!(A::AbstractMatrix{T}, b::AbstractVector{T
486
490
for J = N: - 1 : 1
487
491
V_22 = view (A, KR_map[J], JR_map[J])
488
492
b_2 = view (b, parentindices (V_22)[1 ]. indices)
489
- A_ldiv_B ! (UpperTriangular (V_22), b_2)
493
+ ldiv ! (UpperTriangular (V_22), b_2)
490
494
491
495
for K = max (1 ,J- u_new): J- 1
492
496
if KR_map[K]. block ≥ JR_map[J]. block - u # inside old blockbandwith
@@ -551,7 +555,7 @@ function blockbanded_rectblocks_intrange_trtrs!(V::AbstractMatrix{T}, b::Abstrac
551
555
for J = N: - 1 : 1
552
556
V_22 = view (A, KR_map[J], JR_map[J])
553
557
b_2 = view (b, parentindices (V_22)[1 ]. indices)
554
- A_ldiv_B ! (UpperTriangular (V_22), b_2)
558
+ ldiv ! (UpperTriangular (V_22), b_2)
555
559
556
560
for K = max (1 ,J- u_new): J- 1
557
561
if KR_map[K]. block ≥ JR_map[J]. block - u # inside old blockbandwith
0 commit comments