Skip to content

Commit eaebe6e

Browse files
Merge pull request #902 from jClugstor/alias_api
Add arguments for alias_noise and alias_jumps for RODEs, SDEs, SDDEs
2 parents 901e5c7 + 2aa2d39 commit eaebe6e

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

src/problems/rode_problems.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ When a keyword argument is `nothing`, the default behaviour of the solver is use
106106
* `alias_u0::Union{Bool, Nothing}`: alias the u0 array. Defaults to false .
107107
* `alias_du0::Union{Bool, Nothing}`: alias the du0 array for DAEs. Defaults to false.
108108
* `alias_tstops::Union{Bool, Nothing}`: alias the tstops array
109+
* `alias_noise::Union{Bool,Nothing}`: alias the noise process
110+
* `alias_jumps::Union{Bool, Nothing}`: alias jump process if wrapped in a JumpProcess
109111
* `alias::Union{Bool, Nothing}`: sets all fields of the `RODEAliasSpecifier` to `alias`
110112
111113
"""
@@ -116,15 +118,17 @@ struct RODEAliasSpecifier <: AbstractAliasSpecifier
116118
alias_u0::Union{Bool, Nothing}
117119
alias_du0::Union{Bool, Nothing}
118120
alias_tstops::Union{Bool, Nothing}
121+
alias_noise::Union{Bool, Nothing}
122+
alias_jumps::Union{Bool, Nothing}
119123

120124
function RODEAliasSpecifier(; alias_p = nothing, alias_f = nothing, alias_u0 = nothing,
121-
alias_du0 = nothing, alias_tstops = nothing, alias = nothing)
125+
alias_du0 = nothing, alias_tstops = nothing, alias_noise = nothing, alias_jumps = nothing, alias = nothing)
122126
if alias == true
123-
new(true, true, true, true, true)
127+
new(true, true, true, true, true, true, true)
124128
elseif alias == false
125-
new(false, false, false, false, false)
129+
new(false, false, false, false, false, false, false)
126130
elseif isnothing(alias)
127-
new(alias_p, alias_f, alias_u0, alias_du0, alias_tstops)
131+
new(alias_p, alias_f, alias_u0, alias_du0, alias_tstops, alias_noise, alias_jumps)
128132
end
129133
end
130134
end

src/problems/sdde_problems.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ When a keyword argument is `nothing`, the default behaviour of the solver is use
187187
* `alias_f::Union{Bool, Nothing}`
188188
* `alias_u0::Union{Bool, Nothing}`: alias the u0 array. Defaults to false .
189189
* `alias_tstops::Union{Bool, Nothing}`: alias the tstops array
190+
* `alias_jumps::Union{Bool, Nothing}`: alias jump process if wrapped in a JumpProcess
190191
* `alias::Union{Bool, Nothing}`: sets all fields of the `SDDEAliasSpecifier` to `alias`
191192
192193
"""
@@ -195,15 +196,16 @@ struct SDDEAliasSpecifier
195196
alias_f::Union{Bool, Nothing}
196197
alias_u0::Union{Bool, Nothing}
197198
alias_tstops::Union{Bool, Nothing}
199+
alias_jumps::Union{Bool, Nothing}
198200

199201
function SDDEAliasSpecifier(; alias_p = nothing, alias_f = nothing, alias_u0 = nothing,
200-
alias_du0 = nothing, alias_tstops = nothing, alias = nothing)
202+
alias_du0 = nothing, alias_tstops = nothing, alias_jumps = nothing, alias = nothing)
201203
if alias == true
202-
new(true, true, true, true)
204+
new(true, true, true, true, true)
203205
elseif alias == false
204-
new(false, false, false, false)
206+
new(false, false, false, false, false)
205207
elseif isnothing(alias)
206-
new(alias_p, alias_f, alias_u0, alias_tstops)
208+
new(alias_p, alias_f, alias_u0, alias_tstops, alias_jumps)
207209
end
208210
end
209211
end

src/problems/sde_problems.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ When a keyword argument is `nothing`, the default behaviour of the solver is use
229229
* `alias_f::Union{Bool, Nothing}`
230230
* `alias_u0::Union{Bool, Nothing}`: alias the u0 array. Defaults to false .
231231
* `alias_tstops::Union{Bool, Nothing}`: alias the tstops array
232+
* `alias_jumps::Union{Bool, Nothing}`: alias jump process if wrapped in a JumpProcess
232233
* `alias::Union{Bool, Nothing}`: sets all fields of the `SDEAliasSpecifier` to `alias`
233234
234235
"""
@@ -237,15 +238,16 @@ struct SDEAliasSpecifier <: AbstractAliasSpecifier
237238
alias_f::Union{Bool, Nothing}
238239
alias_u0::Union{Bool, Nothing}
239240
alias_tstops::Union{Bool, Nothing}
241+
alias_jumps::Union{Bool,Nothing}
240242

241243
function SDEAliasSpecifier(; alias_p = nothing, alias_f = nothing, alias_u0 = nothing,
242-
alias_du0 = nothing, alias_tstops = nothing, alias = nothing)
244+
alias_du0 = nothing, alias_tstops = nothing, alias_jumps = nothing, alias = nothing)
243245
if alias == true
244-
new(true, true, true, true)
246+
new(true, true, true, true, true)
245247
elseif alias == false
246-
new(false, false, false, false)
248+
new(false, false, false, false, false)
247249
elseif isnothing(alias)
248-
new(alias_p, alias_f, alias_u0, alias_tstops)
250+
new(alias_p, alias_f, alias_u0, alias_tstops, alias_jumps)
249251
end
250252
end
251253
end

0 commit comments

Comments
 (0)