Skip to content

Commit 8c393e2

Browse files
committed
add global nullrate function
1 parent e271864 commit 8c393e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/jumps.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ struct VariableRateJump{R, F, R2, R3, R4, I, T, T2} <: AbstractJump
145145
reltol::T2
146146
end
147147

148+
nullrate(u, p, t::T) where {T <: Number} = zero(T)
149+
148150
"""
149151
```
150152
function VariableRateJump(rate, affect!; lrate = nothing, urate = nothing,
@@ -168,7 +170,7 @@ function VariableRateJump(rate, affect!;
168170
end
169171

170172
if (urate !== nothing && lrate === nothing)
171-
lrate = (u, p, t) -> zero(typeof(t))
173+
lrate = nullrate
172174
end
173175

174176
VariableRateJump(rate, affect!, lrate, urate, rateinterval, idxs, rootfind,

0 commit comments

Comments
 (0)