Skip to content

Commit

Permalink
run CI x4
Browse files Browse the repository at this point in the history
  • Loading branch information
sumiya11 committed Nov 19, 2024
1 parent 3575468 commit 308b093
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/f4/linalg/backend.jl
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,28 @@ function linalg_vector_addmul_sparsedense_mod_p!(
mul
end

# Linear combination of dense vector and sparse vector.
function linalg_vector_addmul_sparsedense!(
row::Vector{A},
indices::Vector{I},
coeffs::Vector{T},
arithmetic::AbstractArithmeticZp
) where {I, A <: Union{CoeffZp, CompositeCoeffZp}, T <: Union{CoeffZp, CompositeCoeffZp}}
@invariant isone(coeffs[1])
@invariant length(indices) == length(coeffs)
@invariant !isempty(indices)

@inbounds mul = divisor(arithmetic) - row[indices[1]]
@inbounds for j in 1:length(indices)
idx = indices[j]
# if A === T, then the type cast is a no-op
a = row[idx] + A(mul) * A(coeffs[j])
row[idx] = a
end

nothing
end

# Linear combination of dense vector and sparse vector.
function linalg_vector_addmul_sparsedense!(
row::Vector{A},
Expand Down

0 comments on commit 308b093

Please sign in to comment.