Skip to content

Commit

Permalink
Merge pull request #373 from Circuitscape/RA/adv
Browse files Browse the repository at this point in the history
Speedup a common advanced mode calc
  • Loading branch information
ranjanan authored Dec 28, 2022
2 parents 541656f + 38cf9c9 commit 189e654
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/raster/advanced.jl
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,9 @@ function advanced_kernel(prob::AdvancedProblem{T,V,S}, flags, cfg)::Tuple{Matrix
accum_currents!(outcurr, voltages, cfg, G, voltages, finitegrounds, local_nodemap, hbmeta)
end

for i in eachindex(volt)
_i = Int(local_nodemap[i])
_i != 0 && (volt[i] = voltages[c][_i])
end
_is = map(i -> Int(local_nodemap[i]), 1:length(volt))
_isn0 = findall(!iszero, _is)
volt[_isn0] .= voltages[c][_is[_isn0]]
end

name = src == 0 ? "" : "_$(V(src))"
Expand Down

0 comments on commit 189e654

Please sign in to comment.