Skip to content

Commit 7bd5d8e

Browse files
some fixes
1 parent d29431c commit 7bd5d8e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

docs/src/tutorials/operator_algebras.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ function f(w, v, u, p, t)
1313
w .= u .* v
1414
end
1515
16+
u = rand(4)
17+
p = nothing # parameter struct
18+
t = 0.0 # time
19+
1620
M = MatrixOperator(rand(N, N))
1721
D = DiagonalOperator(rand(N))
18-
F = FunctionOperator(f, zeros(N), zeros(N))
22+
F = FunctionOperator(f, zeros(N), zeros(N); u, p, t)
1923
```
2024

2125
Then, the following codes just work.
@@ -31,15 +35,9 @@ L5 = [M; D]' * [M F; F D] * [F; D]
3135
Each `L#` can be applied to `AbstractVector`s of appropriate sizes:
3236

3337
```@example operator_algebra
34-
p = nothing # parameter struct
35-
t = 0.0 # time
36-
37-
u = rand(N)
3838
v = rand(N)
3939
w = L1(v, u, p, t) # == L1 * v
4040
41-
L3 = cache_operator(L3, v)
42-
4341
v_kron = rand(N^3)
4442
w_kron = L3(v_kron, u, p, t) # == L3 * v_kron
4543
```

0 commit comments

Comments
 (0)