Skip to content

Commit fc4bf13

Browse files
committed
Merge branch 'master' into fixes
2 parents 6041da8 + 230c025 commit fc4bf13

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SciMLOperators"
22
uuid = "c0aeaf25-5076-4817-a8d5-81caf7dfa961"
33
authors = ["Vedant Puri <[email protected]>"]
4-
version = "0.2.5"
4+
version = "0.2.6"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/SciMLOperators.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ import SparseArrays: sparse, issparse
2020

2121
"""
2222
$(TYPEDEF)
23+
24+
## Interface
25+
26+
An `L::AbstractSciMLOperator` can be called like a function. This behaves
27+
like multiplication by the linear operator represented by the
28+
`AbstractSciMLOperator`. Possible signatures are
29+
30+
- `L(du, u, p, t)` for in-place operator evaluation
31+
- `du = L(u, p, t)` for out-of-place operator evaluation
32+
33+
If the operator is not a constant, update it with `(u, p, t)`.
34+
A mutating form, i.e. `update_coefficients!(L, u, p, t)` that changes the
35+
internal coefficients, and an out-of-place form
36+
`L_new = update_coefficients(L, u, p, t)`.
2337
"""
2438
abstract type AbstractSciMLOperator{T} end
2539

src/interface.jl

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,6 @@
33
# Operator interface
44
###
55

6-
"""
7-
Function call and multiplication:
8-
- L(du, u, p, t) for in-place operator evaluation,
9-
- du = L(u, p, t) for out-of-place operator evaluation
10-
11-
If the operator is not a constant, update it with (u,p,t). A mutating form, i.e.
12-
update_coefficients!(A,u,p,t) that changes the internal coefficients, and a
13-
out-of-place form B = update_coefficients(A,u,p,t).
14-
15-
"""
16-
function (::AbstractSciMLOperator) end
17-
186
DEFAULT_UPDATE_FUNC(A,u,p,t) = A
197

208
update_coefficients(L,u,p,t) = L
@@ -42,7 +30,7 @@ function iscached(L::AbstractSciMLOperator)
4230
has_cache = hasfield(typeof(L), :cache) # TODO - confirm this is static
4331
isset = has_cache ? !isnothing(L.cache) : true
4432

45-
return isset & all(iscached, getops(L))
33+
return isset & all(iscached, getops(L))
4634
end
4735

4836
iscached(L) = true

0 commit comments

Comments
 (0)