@@ -1547,12 +1547,11 @@ for (f, g) in ((:A_mul_Bc, :A_mul_Bc!), (:A_mul_Bt, :A_mul_Bt!))
1547
1547
end
1548
1548
end
1549
1549
1550
- for mat in (:AbstractVector , :AbstractMatrix )
1551
-
1552
1550
# ## Multiplication with triangle to the left and hence rhs cannot be transposed.
1553
1551
for (f, g) in ((:* , :A_mul_B! ), (:Ac_mul_B , :Ac_mul_B! ), (:At_mul_B , :At_mul_B! ))
1554
1552
@eval begin
1555
- function ($ f)(A:: AbstractTriangular , B:: $mat )
1553
+ ($ f)(A:: AbstractTriangular , B:: AbstractVector ) = ($ f)(A, reshape (B, Val{2 }))
1554
+ function ($ f)(A:: AbstractTriangular , B:: AbstractMatrix )
1556
1555
TAB = typeof (zero (eltype (A))* zero (eltype (B)) + zero (eltype (A))* zero (eltype (B)))
1557
1556
BB = similar (B, TAB, size (B))
1558
1557
copy! (BB, B)
@@ -1563,7 +1562,8 @@ end
1563
1562
# ## Left division with triangle to the left hence rhs cannot be transposed. No quotients.
1564
1563
for (f, g) in ((:\ , :A_ldiv_B! ), (:Ac_ldiv_B , :Ac_ldiv_B! ), (:At_ldiv_B , :At_ldiv_B! ))
1565
1564
@eval begin
1566
- function ($ f)(A:: Union{UnitUpperTriangular,UnitLowerTriangular} , B:: $mat )
1565
+ ($ f)(A:: Union{UnitUpperTriangular,UnitLowerTriangular} , B:: AbstractVector ) = ($ f)(A, reshape (B, Val{2 }))
1566
+ function ($ f)(A:: Union{UnitUpperTriangular,UnitLowerTriangular} , B:: AbstractMatrix )
1567
1567
TAB = typeof (zero (eltype (A))* zero (eltype (B)) + zero (eltype (A))* zero (eltype (B)))
1568
1568
BB = similar (B, TAB, size (B))
1569
1569
copy! (BB, B)
@@ -1574,7 +1574,8 @@ end
1574
1574
# ## Left division with triangle to the left hence rhs cannot be transposed. Quotients.
1575
1575
for (f, g) in ((:\ , :A_ldiv_B! ), (:Ac_ldiv_B , :Ac_ldiv_B! ), (:At_ldiv_B , :At_ldiv_B! ))
1576
1576
@eval begin
1577
- function ($ f)(A:: Union{UpperTriangular,LowerTriangular} , B:: $mat )
1577
+ ($ f)(A:: Union{UpperTriangular,LowerTriangular} , B:: AbstractVector ) = ($ f)(A, reshape (B, Val{2 }))
1578
+ function ($ f)(A:: Union{UpperTriangular,LowerTriangular} , B:: AbstractMatrix )
1578
1579
TAB = typeof ((zero (eltype (A))* zero (eltype (B)) + zero (eltype (A))* zero (eltype (B)))/ one (eltype (A)))
1579
1580
BB = similar (B, TAB, size (B))
1580
1581
copy! (BB, B)
@@ -1585,7 +1586,8 @@ end
1585
1586
# ## Multiplication with triangle to the rigth and hence lhs cannot be transposed.
1586
1587
for (f, g) in ((:* , :A_mul_B! ), (:A_mul_Bc , :A_mul_Bc! ), (:A_mul_Bt , :A_mul_Bt! ))
1587
1588
@eval begin
1588
- function ($ f)(A:: $mat , B:: AbstractTriangular )
1589
+ ($ f)(A:: AbstractVector , B:: AbstractTriangular ) = ($ f)(reshape (A, Val{2 }), B)
1590
+ function ($ f)(A:: AbstractMatrix , B:: AbstractTriangular )
1589
1591
TAB = typeof (zero (eltype (A))* zero (eltype (B)) + zero (eltype (A))* zero (eltype (B)))
1590
1592
AA = similar (A, TAB, size (A))
1591
1593
copy! (AA, A)
@@ -1596,7 +1598,8 @@ end
1596
1598
# ## Right division with triangle to the right hence lhs cannot be transposed. No quotients.
1597
1599
for (f, g) in ((:/ , :A_rdiv_B! ), (:A_rdiv_Bc , :A_rdiv_Bc! ), (:A_rdiv_Bt , :A_rdiv_Bt! ))
1598
1600
@eval begin
1599
- function ($ f)(A:: $mat , B:: Union{UnitUpperTriangular, UnitLowerTriangular} )
1601
+ ($ f)(A:: AbstractVector , B:: Union{UnitUpperTriangular, UnitLowerTriangular} ) = ($ f)(reshape (A, Val{2 }), B)
1602
+ function ($ f)(A:: AbstractMatrix , B:: Union{UnitUpperTriangular, UnitLowerTriangular} )
1600
1603
TAB = typeof (zero (eltype (A))* zero (eltype (B)) + zero (eltype (A))* zero (eltype (B)))
1601
1604
AA = similar (A, TAB, size (A))
1602
1605
copy! (AA, A)
@@ -1608,15 +1611,15 @@ end
1608
1611
# ## Right division with triangle to the right hence lhs cannot be transposed. Quotients.
1609
1612
for (f, g) in ((:/ , :A_rdiv_B! ), (:A_rdiv_Bc , :A_rdiv_Bc! ), (:A_rdiv_Bt , :A_rdiv_Bt! ))
1610
1613
@eval begin
1611
- function ($ f)(A:: $mat , B:: Union{UpperTriangular,LowerTriangular} )
1614
+ ($ f)(A:: AbstractVector , B:: Union{UpperTriangular,LowerTriangular} ) = ($ f)(reshape (A, Val{2 }), B)
1615
+ function ($ f)(A:: AbstractMatrix , B:: Union{UpperTriangular,LowerTriangular} )
1612
1616
TAB = typeof ((zero (eltype (A))* zero (eltype (B)) + zero (eltype (A))* zero (eltype (B)))/ one (eltype (A)))
1613
1617
AA = similar (A, TAB, size (A))
1614
1618
copy! (AA, A)
1615
1619
($ g)(AA, convert (AbstractArray{TAB}, B))
1616
1620
end
1617
1621
end
1618
1622
end
1619
- end
1620
1623
1621
1624
# If these are not defined, they will fallback to the versions in matmul.jl
1622
1625
# and dispatch to generic_matmatmul! which is very costly to compile. The methods
0 commit comments