@@ -53,12 +53,12 @@ Base.@constprop :aggressive function spdensemul!(C, tA, tB, A, B, alpha, beta)
5353 _At_or_Ac_mul_B! (transpose, C, A, wrap (B, tB), alpha, beta)
5454 elseif tA_uc == ' C'
5555 _At_or_Ac_mul_B! (adjoint, C, A, wrap (B, tB), alpha, beta)
56- elseif tA_uc in (' S' , ' H' ) && tB_uc == ' N '
56+ elseif tA_uc in (' S' , ' H' )
5757 rangefun = isuppercase (tA) ? nzrangeup : nzrangelo
5858 diagop = tA_uc == ' S' ? identity : real
5959 odiagop = tA_uc == ' S' ? transpose : adjoint
6060 T = eltype (C)
61- _mul! (rangefun, diagop, odiagop, C, A, B , T (alpha), T (beta))
61+ _mul! (rangefun, diagop, odiagop, C, A, wrap (B, tB) , T (alpha), T (beta))
6262 else
6363 @stable_muladdmul LinearAlgebra. _generic_matmatmul! (C, wrap (A, tA), wrap (B, tB), MulAddMul (alpha, beta))
6464 end
@@ -108,7 +108,7 @@ function _At_or_Ac_mul_B!(tfun::Function, C, A, B, α, β)
108108 C
109109end
110110
111- Base. @constprop :aggressive function generic_matmatmul ! (C:: StridedMatrix , tA, tB, A:: DenseMatrixUnion , B:: SparseMatrixCSCUnion2 , alpha:: Number , beta:: Number )
111+ Base. @constprop :aggressive function generic_matmatmul_wrapper ! (C:: StridedMatrix , tA, tB, A:: DenseMatrixUnion , B:: SparseMatrixCSCUnion2 , alpha:: Number , beta:: Number , :: LinearAlgebra.BlasFlag.SyrkHerkGemm )
112112 transA = tA == ' N' ? identity : tA == ' T' ? transpose : adjoint
113113 if tB == ' N'
114114 _spmul! (C, transA (A), B, alpha, beta)
@@ -119,6 +119,9 @@ Base.@constprop :aggressive function generic_matmatmul!(C::StridedMatrix, tA, tB
119119 end
120120 return C
121121end
122+ Base. @constprop :aggressive generic_matmatmul_wrapper! (C:: StridedMatrix , tA, tB, A:: DenseMatrixUnion , B:: SparseMatrixCSCUnion2 , alpha:: Number , beta:: Number , @nospecialize (val)) =
123+ LinearAlgebra. _generic_matmatmul! (C, wrap (A, tA), wrap (B, tB), alpha, beta)
124+
122125function _spmul! (C:: StridedMatrix , X:: DenseMatrixUnion , A:: SparseMatrixCSCUnion2 , α:: Number , β:: Number )
123126 mX, nX = size (X)
124127 nX == size (A, 1 ) ||
@@ -1733,7 +1736,7 @@ function opnormestinv(A::AbstractSparseMatrixCSC{T}, t::Integer = min(2,maximum(
17331736 repeated = true
17341737 end
17351738 end
1736- if ! repeated
1739+ if ! repeated && 2 ^ (n - 1 ) ≥ 2 t # we need enough non-parallel ±1 vectors
17371740 saux2 = S[1 : n,j]' * S_old[1 : n,1 : t]
17381741 if _any_abs_eq (saux2,n)
17391742 repeated = true
0 commit comments