Skip to content

Commit 1d27caa

Browse files
committed
add better docs
1 parent 998333e commit 1d27caa

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

src/SciMLBase.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,8 @@ abstract type ADOriginator end
628628
"""
629629
$(TYPEDEF)
630630
631-
Used to specify which elements can be aliased in a solve.
631+
Used to specify which elements can be aliased in a solve.
632+
Every concrete AbstractAliasSpecifier should have at least the fields `alias_p` and `alias_f`.
632633
"""
633634
abstract type AbstractAliasSpecifier end
634635

src/problems/ode_problems.jl

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -512,12 +512,7 @@ function IncrementingODEProblem{iip}(f::IncrementingODEFunction, u0, tspan,
512512
ODEProblem(f, u0, tspan, p, IncrementingODEProblem{iip}(); kwargs...)
513513
end
514514

515-
@doc doc"""
516515

517-
Holds information on what variables to alias
518-
when solving an ODE. The field `alias_u0` determines whether the initial condition
519-
will be aliased when the ODE is solved.
520-
"""
521516
struct ODEAliasSpecifier <: AbstractAliasSpecifier
522517
alias_p::Union{Bool,Nothing}
523518
alias_f::Union{Bool,Nothing}
@@ -526,13 +521,22 @@ struct ODEAliasSpecifier <: AbstractAliasSpecifier
526521
alias_tstops::Union{Bool,Nothing}
527522
end
528523

529-
"""
530-
ODEAliasSpecifier(;alias_u0 = nothing)
524+
@doc doc"""
525+
526+
Holds information on what variables to alias
527+
when solving an ODE. Conforms to the AbstractAliasSpecifier interface.
528+
ODEAliasSpecifier(;alias_p = nothing, alias_f = nothing, alias_u0 = false, alias_du0 = false, alias_tstops = false, alias = nothing)
529+
530+
### Keywords
531+
* `alias_p::Bool`
532+
* `alias_f::Bool`
533+
* `alias_u0::Bool = false`: alias the u0 array
534+
* `alias_du0::Bool = false`: alias the du0 array for DAEs
535+
* `alias_tstops::Bool = false`: alias the tstops array
536+
* `alias::Bool`: sets all fields to `alias`
531537
532-
Creates an `ODEAliases`, with a default `alias_u0` value of `nothing`.
533-
When `alias_u0` is `nothing`, the solvers default to not aliasing `u0`.
534538
"""
535-
function ODEAliasSpecifier(;alias_p = nothing, alias_f = nothing, alias_u0 = nothing, alias_du0 = nothing, alias_tstops = nothing, alias = nothing)
539+
function ODEAliasSpecifier(;alias_p = nothing, alias_f = nothing, alias_u0 = false, alias_du0 = false, alias_tstops = false, alias = nothing)
536540
if alias == true
537541
ODEAliasSpecifier(true,true,true,true,true)
538542
elseif alias == false

0 commit comments

Comments
 (0)