Skip to content

Commit 690980d

Browse files
committed
introduce string based constructor again
1 parent 0c9e324 commit 690980d

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LinearOperatorCollection"
22
uuid = "a4a2c56f-fead-462a-a3ab-85921a5f2575"
33
authors = ["Tobias Knopp <[email protected]> and contributors"]
4-
version = "1.0.0"
4+
version = "1.1.0"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/LinearOperatorCollection.jl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,30 @@ for op in linearOperatorList()
6060
end
6161
end
6262

63+
# String constructor
64+
function createLinearOperator(op::String, ::Type{T}; kargs...) where T <: Number
65+
if contains(op, "DCT")
66+
strToOp = Dict("DCT-I"=>(DCTOp{T},1), "DCT-II"=>(DCTOp{T},2),
67+
"DCT-III"=>(DCTOp{T},3), "DCT-IV"=>(DCTOp{T},4))
68+
trafo, dcttype = strToOp[op]
69+
return createLinearOperator(trafo; dcttype, kargs...)
70+
elseif contains(op, "DST")
71+
return createLinearOperator(DSTOp{T}; kargs...)
72+
elseif contains(op, "FFT")
73+
return createLinearOperator(FFTOp{T}; kargs...)
74+
elseif contains(op, "NFFT")
75+
return createLinearOperator(NFFTOp{T}; kargs...)
76+
elseif contains(op, "NFFT")
77+
return createLinearOperator(NFFTOp{T}; kargs...)
78+
elseif contains(op, "Wavelet")
79+
return createLinearOperator(WaveletOp{T}; kargs...)
80+
else
81+
error("Linear operator $(op) currently not implemented")
82+
end
83+
end
84+
85+
86+
6387
include("GradientOp.jl")
6488
include("SamplingOp.jl")
6589
include("WeightingOp.jl")

0 commit comments

Comments
 (0)