Skip to content

Commit e6cc8b6

Browse files
committed
apply changes to other function
1 parent bd2b0a4 commit e6cc8b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/linalg.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -629,16 +629,16 @@ function dot(A::AbstractSparseMatrixCSC, B::Union{DenseMatrixUnion,WrapperMatrix
629629
return conj(dot(B, A))
630630
end
631631

632-
function dot(x::AbstractSparseVector, Q::Diagonal, y::AbstractVector)
633-
d = Q.diag
632+
function dot(x::AbstractSparseVector, D::Diagonal, y::AbstractVector)
633+
d = D.diag
634634
if length(x) != length(y) || length(y) != length(d)
635635
throw(
636-
DimensionMismatch("Vectors and matrix have different dimensions, x has a length $(length(x)), y has a length $(length(y)), Q has side dimension $(size(Q, 1))")
636+
DimensionMismatch("Vectors and matrix have different dimensions, x has a length $(length(x)), y has a length $(length(y)), D has side dimension $(length(d))")
637637
)
638638
end
639639
nzvals = nonzeros(x)
640640
nzinds = nonzeroinds(x)
641-
s = zero(Base.promote_eltype(x, Q, y))
641+
s = zero(typeof(dot(first(x), first(D), first(y))))
642642
@inbounds for nzidx in eachindex(nzvals)
643643
s += dot(nzvals[nzidx], d[nzinds[nzidx]], y[nzinds[nzidx]])
644644
end

0 commit comments

Comments
 (0)