Skip to content

Commit d48c0c6

Browse files
committed
Add workaround to WaveletOp to skip dimensions with size 1
1 parent 5d2fe7d commit d48c0c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/LinearOperatorWaveletExt/WaveletOp.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ a given input array.
1111
* (`wt=wavelet(WT.db2)`) - Wavelet to apply
1212
"""
1313
function LinearOperatorCollection.WaveletOp(::Type{T}; shape::Tuple, wt=wavelet(WT.db2)) where T <: Number
14+
shape = filter(x-> x != 1, shape) # Drop dimension with 1
1415
return LinearOperator(T, prod(shape), prod(shape), false, false
1516
, (res,x)->dwt!(reshape(res,shape), reshape(x,shape), wt)
1617
, nothing

0 commit comments

Comments
 (0)