Skip to content

Commit

Permalink
Add rowmult fucntion.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebKrantz committed May 6, 2024
1 parent e0d8540 commit edcc476
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/helper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ function gsum(x, ng, g)
return res
end

function rowmult(A, v)
r = similar(A)
@inbounds for j = 1:size(A,2)
@simd for i = 1:size(A,1)
r[i,j] = v[j] * A[i,j]
end
end
return r
end

function represent_edges(graph)
# Create matrix A
Expand Down Expand Up @@ -172,4 +181,5 @@ function rescale_network!(param, graph, I1, Il, Iu; max_iter = 100)
end

return I1
end
end

0 comments on commit edcc476

Please sign in to comment.