@@ -150,8 +150,8 @@ function testDirectionalGradOp(N=64;arrayType = Array)
150
150
G2 = GradientOp (eltype (x); shape= size (x), dims= 2 , S = typeof (xop))
151
151
G_1d = Bidiagonal (ones (N),- ones (N- 1 ), :U )[1 : N- 1 ,:]
152
152
153
- y1 = Array (G1* x )
154
- y2 = Array (G2* x )
153
+ y1 = Array (G1* xop )
154
+ y2 = Array (G2* xop )
155
155
y1_ref = zeros (ComplexF64, N- 1 ,N)
156
156
y2_ref = zeros (ComplexF64, N, N- 1 )
157
157
for i= 1 : N
@@ -183,7 +183,7 @@ function testSampling(N=64;arrayType = Array)
183
183
idx = shuffle (collect (1 : N^ 2 )[1 : N* div (N,2 )])
184
184
SOp = SamplingOp (ComplexF64, pattern= idx, shape= (N,N), S = typeof (xop))
185
185
y = Array (SOp* xop)
186
- x2 = Array (adjoint (SOp)* y )
186
+ x2 = Array (adjoint (SOp)* arrayType (y) )
187
187
# mask-based sampling
188
188
msk = zeros (Bool,N* N);msk[idx]. = true
189
189
SOp2 = SamplingOp (ComplexF64, pattern= msk, S = typeof (xop))
@@ -258,7 +258,7 @@ function testNFFT2d(N=16;arrayType = Array)
258
258
# test type stability;
259
259
# TODO : Ensure type stability for Trajectory objects and test here
260
260
nodes = Float32 .(nodes)
261
- F_nfft = NFFTOp (ComplexF32; shape= (N,N), nodes, symmetrize= false , S = typeof (xop))
261
+ F_nfft = NFFTOp (ComplexF32; shape= (N,N), nodes, symmetrize= false , S = typeof (ComplexF32 .( xop) ))
262
262
263
263
y_nfft = F_nfft * ComplexF32 .(xop)
264
264
y_adj_nfft = adjoint (F_nfft) * ComplexF32 .(xop)
@@ -316,31 +316,31 @@ end
316
316
# TODO RadonOp
317
317
318
318
@testset " Linear Operators" begin
319
- for arrayType in arrayTypes
320
- @info " test DCT-II and DCT-IV Ops"
319
+ @testset for arrayType in arrayTypes
320
+ @info " test DCT-II and DCT-IV Ops: $arrayType "
321
321
for N in [2 ,8 ,16 ,32 ]
322
- @test testDCT1d (N;arrayType) skip = ! isa ( arrayType, Array)
322
+ @test testDCT1d (N;arrayType) skip = arrayType != Array # Not implemented for GPUs
323
323
end
324
- @info " test FFTOp"
324
+ @info " test FFTOp: $arrayType "
325
325
for N in [8 ,16 ,32 ]
326
326
@test testFFT1d (N,false ;arrayType)
327
327
@test testFFT1d (N,true ;arrayType)
328
328
@test testFFT2d (N,false ;arrayType)
329
329
@test testFFT2d (N,true ;arrayType)
330
330
end
331
- @info " test WeightingOp"
331
+ @info " test WeightingOp: $arrayType "
332
332
@test testWeighting (512 ;arrayType)
333
- @info " test GradientOp"
333
+ @info " test GradientOp: $arrayType "
334
334
@test testGradOp1d (512 ;arrayType)
335
335
@test testGradOp2d (64 ;arrayType)
336
336
@test testDirectionalGradOp (64 ;arrayType)
337
- @info " test SamplingOp"
337
+ @info " test SamplingOp: $arrayType "
338
338
@test testSampling (64 ;arrayType)
339
- @info " test WaveletOp"
339
+ @info " test WaveletOp: $arrayType "
340
340
@test testWavelet (64 ,64 ;arrayType)
341
341
@test testWavelet (64 ,60 ;arrayType)
342
- @info " test NFFTOp"
343
- @test testNFFT2d (;arrayType) skip = arrayType == JLArray
344
- @test testNFFT3d (;arrayType) skip = arrayType == JLArray
342
+ @info " test NFFTOp: $arrayType "
343
+ @test testNFFT2d (;arrayType) skip = arrayType == JLArray # JLArray does not have a NFFTPlan
344
+ @test testNFFT3d (;arrayType) skip = arrayType == JLArray # JLArray does not have a NFFTPlan
345
345
end
346
346
end
0 commit comments