Skip to content

Commit 750511d

Browse files
update
1 parent e2bb2f3 commit 750511d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1212
FunctionWrappers = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e"
1313
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1414
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
15-
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
1615
PoissonRandom = "e409e4f3-bfea-5376-8464-e040bb5c01ab"
1716
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1817
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"

src/simple_regular_solve.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function DiffEqBase.solve(jump_prob::JumpProblem, alg::SimpleAdaptiveTauLeaping;
137137
hor[j] = sum(abs.(nu[:, j])) > maximum(abs.(nu[:, j])) ? 2 : 1
138138
end
139139

140-
saveat_times = isnothing(saveat) ? Float64[] : saveat isa Number ? collect(range(tspan[1], tspan[2], step=saveat)) : collect(saveat)
140+
saveat_times = isnothing(saveat) ? Vector{typeof(t)}() : saveat isa Number ? collect(range(tspan[1], tspan[2], step=saveat)) : collect(saveat)
141141
save_idx = 1
142142

143143
while t[end] < t_end
@@ -161,7 +161,7 @@ function DiffEqBase.solve(jump_prob::JumpProblem, alg::SimpleAdaptiveTauLeaping;
161161
counts .= pois_rand.(rng, max.(rate_cache * tau, 0.0))
162162
c(du, u_prev, p, t_prev, counts, nothing)
163163
u_new = u_prev + du
164-
if any(u_new .< 0)
164+
if any(<(0), u_new)
165165
# Halve tau to avoid negative populations, as per Cao et al. (2006, J. Chem. Phys., DOI: 10.1063/1.2159468)
166166
tau /= 2
167167
continue

0 commit comments

Comments
 (0)