Skip to content

Commit

Permalink
fix: enormously reduce allocations in composite disc tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
fjebaker committed Jun 8, 2024
1 parent 38c5e06 commit 245cf7c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/tracing/radiative-transfer-problem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,21 @@ function _intensity_delta(
m,
x,
k::AbstractArray{T},
geometry::CompositeGeometry,
geometry::CompositeGeometry{K,D},
within,
I,
ν₀,
r_isco,
λ,
) where {T}
total::T = zero(T)
for i in eachindex(geometry.geometry)
total += _intensity_delta(
) where {T,K,D}
indexed_geom = (enumerate(geometry.geometry)...,)
sum(indexed_geom) do args
i, geom = args
_intensity_delta(
m,
x,
k,
geometry.geometry[i],
geom,
within,
I,
ν₀,
Expand All @@ -87,7 +88,6 @@ function _intensity_delta(
index = i,
)
end
total
end

function _intensity_delta(
Expand Down

0 comments on commit 245cf7c

Please sign in to comment.