From aac28e7f444fa7394cceb3d76b86a87615b1f282 Mon Sep 17 00:00:00 2001 From: "C. Brenhin Keller" Date: Wed, 31 Jan 2024 19:55:58 -0500 Subject: [PATCH] Have interpolate_ll return very negative, but finite ll in case of out-of-bounds --- src/Utilities.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Utilities.jl b/src/Utilities.jl index 9b90e56..27e3e8e 100644 --- a/src/Utilities.jl +++ b/src/Utilities.jl @@ -120,7 +120,7 @@ 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 @@ -128,7 +128,7 @@ 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