|
3 | 3 | BatchedDiagonalOperator(diag; update_func, update_func!, accepted_kwargs) |
4 | 4 |
|
5 | 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: |
| 6 | +Acts on `AbstractArray`s of the same size as `diag`. The update function is |
| 7 | +called by `update_coefficients!` and is assumed to have the following signature: |
8 | 8 |
|
9 | 9 | update_func(diag::AbstractArray, u, p, t; <accepted kwarg fields>) -> [modifies diag] |
10 | 10 | """ |
@@ -48,13 +48,23 @@ Base.iszero(L::BatchedDiagonalOperator) = iszero(L.diag) |
48 | 48 | Base.transpose(L::BatchedDiagonalOperator) = L |
49 | 49 | Base.adjoint(L::BatchedDiagonalOperator) = conj(L) |
50 | 50 | function Base.conj(L::BatchedDiagonalOperator) # TODO - test this thoroughly |
51 | | - diag = conj(L.diag) |
52 | | - update_func = if isreal(L) |
53 | | - L.update_func |
| 51 | + |
| 52 | + update_func, update_func! = if isreal(L) |
| 53 | + L.update_func, L.update_func! |
54 | 54 | else |
55 | | - (L,u,p,t; kwargs...) -> conj(L.update_func(conj(L.diag),u,p,t; kwargs...)) |
| 55 | + uf = (L, u, p, t; kwargs...) -> conj(L.update_func(conj(L.diag), u, p, t; kwargs...)) |
| 56 | + uf! = (L, u, p, t; kwargs...) -> begin |
| 57 | + L.update_func(conj!(L.diag), u, p, t; kwargs...) |
| 58 | + conj!(L.diag) |
| 59 | + end |
| 60 | + uf, uf! |
56 | 61 | end |
57 | | - BatchedDiagonalOperator(diag; update_func=update_func) |
| 62 | + |
| 63 | + DiagonalOperator(conj(L.diag); |
| 64 | + update_func = update_func, |
| 65 | + update_func! = update_func!, |
| 66 | + accepted_kwargs = NoKwargFilter(), |
| 67 | + ) |
58 | 68 | end |
59 | 69 |
|
60 | 70 | LinearAlgebra.issymmetric(L::BatchedDiagonalOperator) = true |
|
0 commit comments