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 c963859
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}
indices = (length(D.parameters)...,)
sum(zip(geometry.geometry, indices)) do args
geom, i = 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 c963859

Please sign in to comment.