Define some basic operations for MatrixOps

Sat, 20 Feb 2021 19:10:50 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sat, 20 Feb 2021 19:10:50 -0500
changeset 24
da6c7475dd0e
parent 23
4399bf266660
child 25
90f92ee9cb81

Define some basic operations for MatrixOps

src/LinOps.jl file | annotate | diff | comparison | revisions
--- a/src/LinOps.jl	Sat Feb 20 16:26:41 2021 -0500
+++ b/src/LinOps.jl	Sat Feb 20 19:10:50 2021 -0500
@@ -91,4 +91,16 @@
     return opnorm(op.m, 2)
 end
 
+function Base.:+(a::MatrixOp{T}, b::MatrixOp{T}) where T
+    return MatrixOp(a.m+b.m)
 end
+
+function Base.:-(a::MatrixOp{T}, b::MatrixOp{T}) where T
+    return MatrixOp(a.m-b.m)
+end
+
+function Base.:*(a::MatrixOp{T}, b::MatrixOp{T}) where T
+    return MatrixOp(a.m*b.m)
+end
+
+end

mercurial