Skip to content

Commit dccc38c

Browse files
committed
clean up docs
1 parent 8f26668 commit dccc38c

File tree

4 files changed

+19
-35
lines changed

4 files changed

+19
-35
lines changed

docs/src/interface.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,30 @@ for it to work in the solvers.
99
being `AbstractArray`s. Specifically, a SciMLOperator, `L`, of size `(M,N)` accepts
1010
input argument `u` with leading length `N`, i.e. `size(u, 1) == N`, and returns an
1111
`AbstractArray` of the same dimension with leading length `M`, i.e. `size(L * u, 1) == M`.
12-
Internally, `L` lazily reshapes `u` to a matrix of size `(N, length(u) \div N)` and
13-
independently acts on the column-vectors. The reshape operation is skipped for
14-
`AbstractVecOrMat` arguments.
1512
2. SciMLOperators can be applied to an `AbstractArray` via overloaded `Base.*`, or
1613
the in-place `LinearAlgebra.mul!`. Additionally, operators are allowed to be time,
1714
or parameter dependent. The state of a SciMLOperator can be updated by calling
1815
the mutating function `update_coefficients!(L, u, p, t)` where `p` representes
1916
parameters, and `t`, time. Calling a SciMLOperator as `L(du, u, p, t)` or out-of-place
2017
`L(u, p, t)` will automatically update the state of `L` before applying it to `u`.
18+
`L(u, p, t)` is the same operation as `L(u, p, t) * u`.
2119
3. To support the update functionality, we have lazily implemented a comprehensive operator
2220
algebra. That means a user can add, subtract, scale, compose and invert SciMLOperators,
2321
and the state of the resultant operator would be updated as expected upon calling
2422
`L(du, u, p, t)` or `L(u, p, t)` so long as an update function is provided for the
2523
component operators.
26-
4. Out of place `L = update_coefficients(L, u, p, t)`
27-
2824

2925
## AbstractSciMLOperator Interface Description
3026

27+
1. `AbstractSciMLLinearOperator <: AbstractSciMLOperator`
28+
2. `AbstractSciMLScalarOperator <: AbstractSciMLLinearOperator`
3129
3. `isconstant(A)` trait for whether the operator is constant or not.
32-
33-
2. Can absorb under multiplication by a scalar. In all algorithms things like
34-
`dt*L` show up all the time, so the linear operator must be able to absorb
35-
such constants.
36-
4. `isconstant(A)` trait for whether the operator is constant or not.
37-
5. Optional: `diagonal`, `symmetric`, etc traits from LinearMaps.jl.
38-
6. Optional: `exp(A)`. Required for simple exponential integration.
39-
7. Optional: `expv(A,u,t) = exp(t*A)*u` and `expv!(v,A::AbstractSciMLOperator,u,t)`
30+
4. Optional: `exp(A)`. Required for simple exponential integration.
31+
5. Optional: `expv(A,u,t) = exp(t*A)*u` and `expv!(v,A::AbstractSciMLOperator,u,t)`
4032
Required for sparse-saving exponential integration.
41-
8. Optional: factorizations. `ldiv!`, `factorize` et. al. This is only required
33+
6. Optional: factorizations. `ldiv!`, `factorize` et. al. This is only required
4234
for algorithms which use the factorization of the operator (Crank-Nicolson),
4335
and only for when the default linear solve is used.
44-
1. `AbstractSciMLLinearOperator <: AbstractSciMLOperator`
4536

4637
## Note About Affine Operators
4738

src/batch.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
#
2+
"""
3+
BatchedDiagonalOperator(diag, [; update_func])
4+
5+
Represents a time-dependent elementwise scaling (diagonal-scaling) operation.
6+
Acts on `AbstractArray`s of the same size as `diag`. The update function is called
7+
by `update_coefficients!` and is assumed to have the following signature:
8+
9+
update_func(diag::AbstractVector,u,p,t) -> [modifies diag]
10+
"""
211
struct BatchedDiagonalOperator{T,D,F} <: AbstractSciMLLinearOperator{T}
312
diag::D
413
update_func::F

src/interface.jl

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,8 @@ has_mul!(L::AbstractSciMLOperator) = false # mul!(du, L, u)
8989
has_ldiv(L::AbstractSciMLOperator) = false # du = L\u
9090
has_ldiv!(L::AbstractSciMLOperator) = false # ldiv!(du, L, u)
9191

92-
### AbstractSciMLLinearOperator Interface
93-
94-
#=
95-
1. AbstractSciMLLinearOperator <: AbstractSciMLOperator
96-
2. Can absorb under multiplication by a scalar. In all algorithms things like
97-
dt*L show up all the time, so the linear operator must be able to absorb
98-
such constants.
99-
4. isconstant(A) trait for whether the operator is constant or not.
100-
5. Optional: diagonal, symmetric, etc traits from LinearMaps.jl.
101-
6. Optional: exp(A). Required for simple exponential integration.
102-
7. Optional: expmv(A,u,p,t) = exp(t*A)*u and expmv!(v,A::SciMLOperator,u,p,t)
103-
Required for sparse-saving exponential integration.
104-
8. Optional: factorizations. A_ldiv_B, factorize et. al. This is only required
105-
for algorithms which use the factorization of the operator (Crank-Nicholson),
106-
and only for when the default linear solve is used.
107-
=#
108-
109-
# Extra standard assumptions
92+
### Extra standard assumptions
93+
11094
isconstant(L) = true
11195
isconstant(L::AbstractSciMLOperator) = all(isconstant, getops(L))
11296
#isconstant(L::AbstractSciMLOperator) = L.update_func = DEFAULT_UPDATE_FUNC

src/matrix.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#
12
"""
23
MatrixOperator(A[; update_func])
34
@@ -83,8 +84,7 @@ LinearAlgebra.ldiv!(v::AbstractVecOrMat, L::MatrixOperator, u::AbstractVecOrMat)
8384
LinearAlgebra.ldiv!(L::MatrixOperator, u::AbstractVecOrMat) = ldiv!(L.A, u)
8485

8586
"""
86-
```julia
87-
DiagonalOperator(diag, [; update_func])
87+
DiagonalOperator(diag, [; update_func])
8888
8989
Represents a time-dependent elementwise scaling (diagonal-scaling) operation.
9090
The update function is called by `update_coefficients!` and is assumed to have

0 commit comments

Comments
 (0)