@@ -6,9 +6,9 @@ struct IdentityOperator{N} <: AbstractSciMLLinearOperator{Bool} end
66# constructors
77IdentityOperator (u:: AbstractArray ) = IdentityOperator {size(u,1)} ()
88
9- function Base. one (A :: AbstractSciMLOperator )
10- @assert issquare (A )
11- N = size (A , 1 )
9+ function Base. one (L :: AbstractSciMLOperator )
10+ @assert issquare (L )
11+ N = size (L , 1 )
1212 IdentityOperator {N} ()
1313end
1414
@@ -96,9 +96,9 @@ struct NullOperator{N} <: AbstractSciMLLinearOperator{Bool} end
9696# constructors
9797NullOperator (u:: AbstractArray ) = NullOperator {size(u,1)} ()
9898
99- function Base. zero (A :: AbstractSciMLOperator )
100- @assert issquare (A )
101- N = size (A , 1 )
99+ function Base. zero (L :: AbstractSciMLOperator )
100+ @assert issquare (L )
101+ N = size (L , 1 )
102102 NullOperator {N} ()
103103end
104104
@@ -305,7 +305,7 @@ for op in (
305305 :adjoint ,
306306 :transpose ,
307307 )
308- @eval Base.$ op (L:: ScaledOperator ) = ScaledOperator ($ op (L. λ), $ op (L. op ))
308+ @eval Base.$ op (L:: ScaledOperator ) = ScaledOperator ($ op (L. λ), $ op (L. L ))
309309end
310310LinearAlgebra. opnorm (L:: ScaledOperator , p:: Real = 2 ) = abs (L. λ) * opnorm (L. L, p)
311311
@@ -325,7 +325,7 @@ function cache_internals(L::ScaledOperator, u::AbstractVecOrMat)
325325end
326326
327327# getindex
328- Base. getindex (L:: ScaledOperator , i:: Int ) = L. coeff * L. op [i]
328+ Base. getindex (L:: ScaledOperator , i:: Int ) = L. coeff * L. L [i]
329329Base. getindex (L:: ScaledOperator , I:: Vararg{Int, N} ) where {N} = L. λ * L. L[I... ]
330330for fact in (
331331 :lu , :lu! ,
@@ -649,6 +649,9 @@ has_mul!(L::InvertedOperator) = has_ldiv!(L.L)
649649has_ldiv (L:: InvertedOperator ) = has_mul (L. L)
650650has_ldiv! (L:: InvertedOperator ) = has_mul! (L. L)
651651
652+ Base.:\ (A:: AbstractSciMLOperator , B:: AbstractSciMLOperator ) = inv (A) * B
653+ Base.:/ (A:: AbstractSciMLOperator , B:: AbstractSciMLOperator ) = A * inv (B)
654+
652655@forward InvertedOperator. L (
653656 # LinearAlgebra
654657 LinearAlgebra. issymmetric,
0 commit comments