You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/SciML/ColPrac)
9
+
[](https://github.com/SciML/ColPrac)
SciMLBase.jl is the core interface definition of the SciML ecosystem. It is a
@@ -17,11 +17,11 @@ supply the common interface and allow for interexchange of mathematical problems
17
17
18
18
The breaking changes in v2.0 are:
19
19
20
-
*`IntegralProblem` has moved to an interface with `IntegralFunction` and `BatchedIntegralFunction` which requires specifying `prototype`s for the values to be modified
21
-
instead of `nout` and `batch`. https://github.com/SciML/SciMLBase.jl/pull/497
22
-
*`ODEProblem` was made temporarily into a `mutable struct` to allow for EnzymeRules support. Using the mutation throws a warning that this is only experimental and should not be relied on.
23
-
https://github.com/SciML/SciMLBase.jl/pull/501
24
-
*`BVProblem` now has a new interface for `TwoPointBVProblem` which splits the bc terms for the two sides, forcing a true two-point BVProblem to allow for further specializations and to allow
25
-
for wrapping Fortran solvers in the interface. https://github.com/SciML/SciMLBase.jl/pull/477
26
-
*`SDEProblem` constructor was changed to remove an anti-pattern which required passing the diffusion function `g` twice, i.e. `SDEProblem(SDEFunction(f,g),g, ...)`.
27
-
Now this is simply `SDEProblem(SDEFunction(f,g),...)`. https://github.com/SciML/SciMLBase.jl/pull/489
20
+
-`IntegralProblem` has moved to an interface with `IntegralFunction` and `BatchedIntegralFunction` which requires specifying `prototype`s for the values to be modified
21
+
instead of `nout` and `batch`. https://github.com/SciML/SciMLBase.jl/pull/497
22
+
-`ODEProblem` was made temporarily into a `mutable struct` to allow for EnzymeRules support. Using the mutation throws a warning that this is only experimental and should not be relied on.
23
+
https://github.com/SciML/SciMLBase.jl/pull/501
24
+
-`BVProblem` now has a new interface for `TwoPointBVProblem` which splits the bc terms for the two sides, forcing a true two-point BVProblem to allow for further specializations and to allow
25
+
for wrapping Fortran solvers in the interface. https://github.com/SciML/SciMLBase.jl/pull/477
26
+
-`SDEProblem` constructor was changed to remove an anti-pattern which required passing the diffusion function `g` twice, i.e. `SDEProblem(SDEFunction(f,g),g, ...)`.
27
+
Now this is simply `SDEProblem(SDEFunction(f,g),...)`. https://github.com/SciML/SciMLBase.jl/pull/489
Copy file name to clipboardExpand all lines: docs/src/interfaces/Array_and_Number.md
+36-36Lines changed: 36 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,12 @@ the rules which are required on container and number types which are allowable
5
5
in SciML tools.
6
6
7
7
!!! warn
8
-
8
+
9
9
In general as of 2023, strict adherence to this interface is an early work-in-progress.
10
10
If anything does not conform to the documented interface, please open an issue.
11
11
12
12
!!! note
13
-
13
+
14
14
There are many types which can work with a specific solver that do satisfy this
15
15
interface. Many times as part of prototyping you may want to side-step the
16
16
high level interface checks in order to simply test whether a new type is working.
@@ -35,45 +35,45 @@ independent variables (`t` or `tspan`). These two types can be different, and ca
35
35
different restrictions depending on the type of solver which is employed. The following
36
36
rules for a Number type are held in general:
37
37
38
-
* Number types can be used in SciML directly or in containers. If a problem defines a value like `u0`
39
-
using a Number type, the out-of-place form must be used for the problem definition.
40
-
*`x::T + y::T = z::T`
41
-
*`x::T * y::T = z::T`
42
-
*`oneunit(x::T)::T`
43
-
*`one(x::T) * oneunit(x::T) = z::T`
44
-
*`t::T2 * x::T + y::T = z::T` for `T2` a time type and `T` the dependent variable type (this includes the
45
-
`muladd` equivalent form).
38
+
- Number types can be used in SciML directly or in containers. If a problem defines a value like `u0`
39
+
using a Number type, the out-of-place form must be used for the problem definition.
40
+
-`x::T + y::T = z::T`
41
+
-`x::T * y::T = z::T`
42
+
-`oneunit(x::T)::T`
43
+
-`one(x::T) * oneunit(x::T) = z::T`
44
+
-`t::T2 * x::T + y::T = z::T` for `T2` a time type and `T` the dependent variable type (this includes the
45
+
`muladd` equivalent form).
46
46
47
47
Additionally, the following rules apply to subsets of uses:
48
48
49
49
### Adaptive Number Types
50
50
51
-
*`x::T / y::T = z::T`
52
-
* Default choices of norms can assume `sqrt(x::T)::T` exists. If `internalnorm` is overridden then this
53
-
may not be required (for example, changing the norm to inf-norm).
54
-
*`x::T ^ y::T = z::T`
51
+
-`x::T / y::T = z::T`
52
+
- Default choices of norms can assume `sqrt(x::T)::T` exists. If `internalnorm` is overridden then this
53
+
may not be required (for example, changing the norm to inf-norm).
54
+
-`x::T ^ y::T = z::T`
55
55
56
56
### Time Types (Independent Variables)
57
57
58
-
* If a solver is time adaptive, the time type must be a floating point number. `Rational` is only allowed
59
-
for non-adaptive solves.
58
+
- If a solver is time adaptive, the time type must be a floating point number. `Rational` is only allowed
59
+
for non-adaptive solves.
60
60
61
61
## SciML Container (Array) Types
62
62
63
-
Container types are types which hold number types. They can be used to define objects like the state vector
63
+
Container types are types which hold number types. They can be used to define objects like the state vector
64
64
(`u0`) of a problem. The following operations are required in a container type to be used with SciML
65
65
solvers:
66
66
67
-
* Broadcast is defined [according to the Julia broadcast interface](https://docs.julialang.org/en/v1/manual/interfaces/#man-interfaces-broadcasting).
68
-
* The container type correctly defines [interface overloads to satisfy the ArrayInterface.jl specification](https://docs.sciml.ai/ArrayInterface/stable/).
69
-
*`ArrayInterface.zeromatrix(x::T)::T2` defines a compatible matrix type (see below)
70
-
*`eltype(x::T)::T2` is a compatible Number type.
71
-
*`x::T .+ y::T = z::T` (i.e. broadcast similar is defined to be type-presurving)
72
-
* Indexing is only required if `ArrayInterface.fast_scalar_indexing(x::T)==true`. If true,
73
-
scalar indexing `x[i]` is assumed to be defined and run through all variables.
67
+
- Broadcast is defined [according to the Julia broadcast interface](https://docs.julialang.org/en/v1/manual/interfaces/#man-interfaces-broadcasting).
68
+
- The container type correctly defines [interface overloads to satisfy the ArrayInterface.jl specification](https://docs.sciml.ai/ArrayInterface/stable/).
69
+
-`ArrayInterface.zeromatrix(x::T)::T2` defines a compatible matrix type (see below)
70
+
-`eltype(x::T)::T2` is a compatible Number type.
71
+
-`x::T .+ y::T = z::T` (i.e. broadcast similar is defined to be type-presurving)
72
+
- Indexing is only required if `ArrayInterface.fast_scalar_indexing(x::T)==true`. If true,
73
+
scalar indexing `x[i]` is assumed to be defined and run through all variables.
74
74
75
75
!!! note
76
-
76
+
77
77
"`eltype(x::T)::T2` is a compatible Number type" excludes `Array{Array{T}}` types of types. However, recursive
78
78
vectors can conformed to the interface with zero overhead using tools from RecursiveArrayTools.jl such as
79
79
`VectorOfArray(x)`. Since this greatly simplifies the interfaces and the ability to check for correctness,
@@ -83,21 +83,21 @@ Additionally, the following rules apply to subsets of uses:
83
83
84
84
### SciML Mutable Array Types
85
85
86
-
*`similar(x::T)::T`
87
-
*`zero(x::T)::T`
88
-
*`z::T .= x::T .+ y::T` is defined
89
-
*`z::T .= x::T .* y::T` is defined
90
-
*`z::T .= t::T2 .* x::T` where `T2` is the time type (a Number) and `T` is the container type.
91
-
* (Optional) `Base.resize!(x,i)` is required for `resize!(integrator,i)` to be supported.
86
+
-`similar(x::T)::T`
87
+
-`zero(x::T)::T`
88
+
-`z::T .= x::T .+ y::T` is defined
89
+
-`z::T .= x::T .* y::T` is defined
90
+
-`z::T .= t::T2 .* x::T` where `T2` is the time type (a Number) and `T` is the container type.
91
+
- (Optional) `Base.resize!(x,i)` is required for `resize!(integrator,i)` to be supported.
92
92
93
93
### SciML Matrix (Operator) Type
94
94
95
95
Note that the matrix type may not match the type of the initial container `u0`. An example is `ComponentMatrix`
96
96
as the matrix structure corresponding to a `ComponentArray`. However, the following actions are assumed
97
97
to hold on the resulting matrix type:
98
98
99
-
*`solve(LinearProblem(A::T,b::T2),linsolve)` must be defined for a solver to work on a given SciML matrix
100
-
type `T2`.
101
-
*If the matrix is an operator, i.e. a lazy construct, it should conform to the
0 commit comments