Skip to content

Commit

Permalink
remove nan checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed May 7, 2024
1 parent 8f9370c commit 0cef80e
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/growth.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ modifyrule(rule::LogisticGrowth, data) = precalc_nsteps(rule, data)
else
N * exp(rt)
end
isnan(new_NS) && _nan_pop_error(new_N, Ns, k)
return min(max(zero(new_N), new_N), k)
end
@inline function applyrule(data, rule::LogisticGrowth, Ns::AbstractArray, I)
Expand All @@ -125,14 +124,9 @@ end
N * exp(rt)
end
end
any(isnan, new_Ns) && return zero(Ns)#_nan_pop_error(new_Ns, Ns, ks)
any(isinf, new_Ns) && return ks #_inf_pop_error(new_Ns, Ns, ks)
return min.(max.(zero(eltype(new_Ns)), new_Ns), ks)
end

@noinline _nan_pop_error(new_N, N, k) = error("NaN population found: $new_N, from original $N and carrycap $k")
@noinline _inf_pop_error(new_N, N, k) = error("Inf population found: $new_N, from original $N and carrycap $k")

"""
ThresholdGrowth <: CellRule
Expand Down

0 comments on commit 0cef80e

Please sign in to comment.