@@ -244,19 +244,22 @@ end
244
244
245
245
coefficients (f:: ProductFun )= funlist2coefficients (f. coefficients)
246
246
247
- function coefficients (f:: ProductFun ,ox:: Space ,oy:: Space )
247
+ function coefficients (f:: ProductFun , ox:: Space , oy:: Space )
248
248
T= cfstype (f)
249
249
m= size (f,1 )
250
- B= Matrix {T} (m, length (f. coefficients))
250
+ B = zeros (T, m, length (f. coefficients))
251
251
# convert in x direction
252
252
# TODO : adaptively grow in x?
253
253
for k= 1 : length (f. coefficients)
254
- B[:,k]= pad! (coefficients (f. coefficients[k],ox),m)
254
+ B[:,k] = pad (coefficients (f. coefficients[k],ox), m)
255
255
end
256
256
257
+ sp = space (f)
258
+ spf2 = factor (sp, 2 )
259
+
257
260
# convert in y direction
258
261
for k= 1 : size (B,1 )
259
- ccfs= coefficients (vec (B[ k,:]), space (f, 2 ), oy)
262
+ ccfs= coefficients (view (B, k,:), spf2, oy)
260
263
if length (ccfs)> size (B,2 )
261
264
B= pad (B,size (B,1 ),length (ccfs))
262
265
end
273
276
# ProductFun does only support BivariateFunctions, this function below just does not work
274
277
# (f::ProductFun)(x,y,z) = evaluate(f,x,y,z)
275
278
276
- coefficients (f:: ProductFun ,ox:: TensorSpace ) = coefficients (f,ox[ 1 ],ox[ 2 ] )
279
+ coefficients (f:: ProductFun , ox:: TensorSpace ) = coefficients (f, factors (ox) ... )
277
280
278
281
279
282
0 commit comments