22:d5e10d963303 | 23:4399bf266660 |
---|---|
6 | 6 |
7 __precompile__() | 7 __precompile__() |
8 | 8 |
9 module LinOps | 9 module LinOps |
10 | 10 |
11 export LinOp, IdOp, AdjointOp, AdjointableOp, | 11 export LinOp, IdOp, AdjointOp, AdjointableOp, MatrixOp, |
12 calc_adjoint, calc_adjoint!, inplace!, | 12 calc_adjoint, calc_adjoint!, inplace!, |
13 opnorm_estimate | 13 opnorm_estimate |
14 | 14 |
15 # General type | 15 # General type |
16 | 16 |
73 return 1 | 73 return 1 |
74 end | 74 end |
75 | 75 |
76 # Matrix operator | 76 # Matrix operator |
77 | 77 |
78 struct MatrixOp{T<:Real} | 78 struct MatrixOp{T<:Real} <: LinOp{Vector{T}, Vector{T}} |
79 m :: AbstractArray{T, 2} | 79 m :: Matrix{T} |
80 end | 80 end |
81 | 81 |
82 function (op::MatrixOp{T})(v::Vector{T}) where T | 82 function (op::MatrixOp{T})(v::Vector{T}) where T |
83 return op.m*v | 83 return op.m*v |
84 end | 84 end |