Skip to content

Commit

Permalink
Have interpolate_ll return very negative, but finite ll in case of ou…
Browse files Browse the repository at this point in the history
…t-of-bounds
  • Loading branch information
brenhinkeller committed Feb 1, 2024
1 parent 7c7c87c commit aac28e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@
function interpolate_ll(x::AbstractVector,p::AbstractMatrix{T}) where {T<:Number}
ll = zero(T)
@inbounds for i eachindex(x)
ll += linterp_at_index(view(p,:,i), x[i], -Inf)
ll += linterp_at_index(view(p,:,i), x[i], -1e9)
end
return ll
end
function interpolate_ll(x::AbstractVector,ages::AbstractVector{Radiocarbon{T}}) where T
ll = zero(T)
@inbounds for i eachindex(x,ages)
dist = ages[i].dist
ll += linterp_at_index(dist, x[i], -Inf)
ll += linterp_at_index(dist, x[i], -1e9)
end
return ll
end
Expand Down

0 comments on commit aac28e7

Please sign in to comment.