@@ -288,34 +288,17 @@ function _jacobi_convert_b(a, b) # Jacobi(a, b+1) \ Jacobi(a, b)
288
288
end
289
289
end
290
290
291
- # TODO : implement ApplyArray(*, A) in LazyArrays.jl, then these can be simplified
292
- # the type specification is also because LazyArrays.jl is slow otherwise
293
- # getindex and print could be very slow. This needs to be fixed by LazyArrays.jl
294
291
function _jacobi_convert_a (a, b, k, T) # Jacobi(a+k, b) \ Jacobi(a, b)
295
292
j = round (k)
296
293
@assert j ≈ k
297
294
k = Integer (j)
298
- if iszero (k)
299
- Eye {T} (∞)
300
- elseif isone (k)
301
- _jacobi_convert_a (a, b)
302
- else
303
- list = tuple ([_jacobi_convert_a (a+ j, b) for j in k- 1 : - 1 : 0 ]. .. )
304
- ApplyArray {T,2,typeof(*),typeof(list)} (* , list)
305
- end
295
+ reduce (* , [_jacobi_convert_a (a+ j, b) for j in k- 1 : - 1 : 0 ], init= Eye {T} (∞))
306
296
end
307
297
function _jacobi_convert_b (a, b, k, T) # Jacobi(a, b+k) \ Jacobi(a, b)
308
298
j = round (k)
309
299
@assert j ≈ k
310
300
k = Integer (j)
311
- if iszero (k)
312
- Eye {T} (∞)
313
- elseif isone (k)
314
- _jacobi_convert_b (a, b)
315
- else
316
- list = tuple ([_jacobi_convert_b (a, b+ j) for j in k- 1 : - 1 : 0 ]. .. )
317
- ApplyArray {T,2,typeof(*),typeof(list)} (* , list)
318
- end
301
+ reduce (* , [_jacobi_convert_b (a, b+ j) for j in k- 1 : - 1 : 0 ], init= Eye {T} (∞))
319
302
end
320
303
321
304
function \ (A:: Jacobi , B:: Jacobi )
@@ -331,15 +314,7 @@ function \(A::Jacobi, B::Jacobi)
331
314
else
332
315
C2 = inv (_jacobi_convert_b (ba, ab, - kb, T))
333
316
end
334
- if iszero (ka)
335
- C2
336
- elseif iszero (kb)
337
- C1
338
- else
339
- list = (C1, C2)
340
- ApplyArray {T,2,typeof(*),typeof(list)} (* , list)
341
- C1 * C2
342
- end
317
+ C1 * C2
343
318
else
344
319
inv (B \ A)
345
320
end
@@ -355,14 +330,8 @@ function \(w_A::WeightedJacobi, B::Jacobi)
355
330
w_A \ (JacobiWeight (zero (a),zero (b)) .* B)
356
331
end
357
332
358
- function \ (A:: AbstractJacobi , w_B:: WeightedJacobi )
359
- Ã = Jacobi (A)
360
- (A \ Ã) * (Ã \ w_B)
361
- end
362
- function \ (w_A:: WeightedJacobi , B:: AbstractJacobi )
363
- B̃ = Jacobi (B)
364
- (w_A \ B̃) * (B̃ \ B)
365
- end
333
+ \ (A:: AbstractJacobi , w_B:: WeightedJacobi ) = Jacobi (A) \ w_B
334
+ \ (w_A:: WeightedJacobi , B:: AbstractJacobi ) = w_A \ Jacobi (B)
366
335
367
336
368
337
function broadcastbasis (:: typeof (+ ), w_A:: WeightedJacobi , w_B:: WeightedJacobi )
0 commit comments