From edcc4760c706d5bf0d021efad50c97e10a35ee47 Mon Sep 17 00:00:00 2001 From: Sebastian Krantz Date: Mon, 6 May 2024 14:41:29 +0200 Subject: [PATCH] Add rowmult fucntion. --- src/main/helper.jl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/helper.jl b/src/main/helper.jl index cfaf0dd..9e9d3bf 100644 --- a/src/main/helper.jl +++ b/src/main/helper.jl @@ -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 @@ -172,4 +181,5 @@ function rescale_network!(param, graph, I1, Il, Iu; max_iter = 100) end return I1 -end \ No newline at end of file +end +