You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function Base.A_mul_B!(Y::Matrix{T}, P::SynthesisPlan{T, Tuple{r2rFFTWPlan{T,(REDFT01,),true,1}, r2rFFTWPlan{T,(RODFT01,),true,1}}}, X::Matrix{T}) where T
36
56
M, N =size(X)
37
57
38
58
# Column synthesis
@@ -73,7 +93,52 @@ function Base.A_mul_B!(Y::Matrix{T}, P::SynthesisPlan{T}, X::Matrix{T}) where T
73
93
Y
74
94
end
75
95
76
-
function Base.A_mul_B!(Y::Matrix{T}, P::AnalysisPlan{T}, X::Matrix{T}) where T
96
+
function Base.A_mul_B!(Y::Matrix{T}, P::SynthesisPlan{T, Tuple{r2rFFTWPlan{T,(REDFT00,),true,1}, r2rFFTWPlan{T,(RODFT00,),true,1}}}, X::Matrix{T}) where T
97
+
M, N =size(X)
98
+
99
+
# Column synthesis
100
+
PCe = P.planθ[1]
101
+
PCo = P.planθ[2]
102
+
103
+
X[1] *=two(T)
104
+
X[M,1] *=two(T)
105
+
A_mul_B_col_J!(Y, PCe, X, 1)
106
+
X[1] *=half(T)
107
+
X[M,1] *=half(T)
108
+
109
+
for J =2:4:N
110
+
A_mul_B_col_J!(Y, PCo, X, J, false)
111
+
J < N &&A_mul_B_col_J!(Y, PCo, X, J+1, false)
112
+
end
113
+
for J =4:4:N
114
+
X[1,J] *=two(T)
115
+
X[M,J] *=two(T)
116
+
J < N && (X[1,J+1] *=two(T); X[M,J+1] *=two(T))
117
+
A_mul_B_col_J!(Y, PCe, X, J)
118
+
J < N &&A_mul_B_col_J!(Y, PCe, X, J+1)
119
+
X[1,J] *=half(T)
120
+
X[M,J] *=half(T)
121
+
J < N && (X[1,J+1] *=half(T); X[M,J+1] *=half(T))
122
+
end
123
+
scale!(half(T), Y)
124
+
125
+
# Row synthesis
126
+
scale!(inv(sqrt(π)), Y)
127
+
invsqrttwo =inv(sqrt(2))
128
+
@inboundsfor i =1:M Y[i] *= invsqrttwo end
129
+
130
+
temp = P.temp
131
+
planφ = P.planφ
132
+
C = P.C
133
+
for I =1:M
134
+
copy_row_I!(temp, Y, I)
135
+
row_synthesis!(planφ, C, temp)
136
+
copy_row_I!(Y, temp, I)
137
+
end
138
+
Y
139
+
end
140
+
141
+
function Base.A_mul_B!(Y::Matrix{T}, P::AnalysisPlan{T, Tuple{r2rFFTWPlan{T,(REDFT10,),true,1}, r2rFFTWPlan{T,(RODFT10,),true,1}}}, X::Matrix{T}) where T
77
142
M, N =size(X)
78
143
79
144
# Row analysis
@@ -109,6 +174,45 @@ function Base.A_mul_B!(Y::Matrix{T}, P::AnalysisPlan{T}, X::Matrix{T}) where T
109
174
Y
110
175
end
111
176
177
+
function Base.A_mul_B!(Y::Matrix{T}, P::AnalysisPlan{T, Tuple{r2rFFTWPlan{T,(REDFT00,),true,1}, r2rFFTWPlan{T,(RODFT00,),true,1}}}, X::Matrix{T}) where T
178
+
M, N =size(X)
179
+
180
+
# Row analysis
181
+
temp = P.temp
182
+
planφ = P.planφ
183
+
C = P.C
184
+
for I =1:M
185
+
copy_row_I!(temp, X, I)
186
+
row_analysis!(planφ, C, temp)
187
+
copy_row_I!(Y, temp, I)
188
+
end
189
+
190
+
# Column analysis
191
+
PCe = P.planθ[1]
192
+
PCo = P.planθ[2]
193
+
194
+
A_mul_B_col_J!(Y, PCe, Y, 1)
195
+
Y[1] *=half(T)
196
+
Y[M, 1] *=half(T)
197
+
for J =2:4:N
198
+
A_mul_B_col_J!(Y, PCo, Y, J, true)
199
+
J < N &&A_mul_B_col_J!(Y, PCo, Y, J+1, true)
200
+
Y[M-1,J] =zero(T)
201
+
J < N && (Y[M-1,J+1] =zero(T))
202
+
end
203
+
for J =4:4:N
204
+
A_mul_B_col_J!(Y, PCe, Y, J)
205
+
J < N &&A_mul_B_col_J!(Y, PCe, Y, J+1)
206
+
Y[1,J] *=half(T)
207
+
Y[M,J] *=half(T)
208
+
J < N && (Y[1,J+1] *=half(T); Y[M,J+1] *=half(T))
209
+
end
210
+
scale!(sqrt(π)*inv(T(M-1)), Y)
211
+
sqrttwo =sqrt(2)
212
+
@inboundsfor i =1:M Y[i] *= sqrttwo end
213
+
214
+
Y
215
+
end
112
216
113
217
114
218
@@ -185,3 +289,26 @@ function unsafe_execute_col_J!(plan::r2rFFTWPlan{T}, X::Matrix{T}, Y::Matrix{T},
0 commit comments