@@ -268,6 +268,34 @@ function chebyshevmoments1(::Type{T}, N::Int) where T
268
268
μ
269
269
end
270
270
271
+ """
272
+ Modified Chebyshev moments of the first kind:
273
+
274
+ ```math
275
+ \\ int_^a T_n(x) {\\ rm\\ ,d}x.
276
+ ```
277
+ """
278
+ function chebyshevmoments1 (:: Type{T} , N:: Int , a:: T ) where T
279
+ μ = zeros (T, N)
280
+ μ[1 ] = a
281
+ μ[2 ] = a^ 2 / 2
282
+ θ = acos (a)
283
+ for i = 2 : N- 1
284
+ @inbounds μ[i+ 1 ] = (cos ((i+ 1 )* θ)/ (i+ 1 ) - cos ((i- 1 )* θ)/ (i- 1 ))/ 2
285
+ end
286
+ μ
287
+ end
288
+
289
+ function chebyshevmoments1 (:: Type{T} , N:: Int , a:: NTuple{L, T} , w:: NTuple{M, T} ) where {T, L, M}
290
+ @assert L == M+ 1
291
+ @assert M > 0
292
+ μ = zeros (T, N)
293
+ for k in 1 : M
294
+ μ .+ = w[k]* (chebyshevmoments1 (T, N, a[k+ 1 ]) - chebyshevmoments1 (T, N, a[k]))
295
+ end
296
+ μ
297
+ end
298
+
271
299
"""
272
300
Modified Chebyshev moments of the first kind with respect to the Jacobi weight:
273
301
@@ -291,22 +319,40 @@ end
291
319
Modified Chebyshev moments of the first kind with respect to the logarithmic weight:
292
320
293
321
```math
294
- \\ int_{-1}^{+1} T_n(x) \\ log\\ left(\\ frac{1-x}{2 }\\ right){\\ rm\\ ,d}x.
322
+ \\ int_{-1}^{+1} T_n(x) \\ log\\ left(\\ frac{2}{ 1-x}\\ right){\\ rm\\ ,d}x.
295
323
```
296
324
"""
297
325
function chebyshevlogmoments1 (:: Type{T} , N:: Int ) where T
298
326
μ = zeros (T, N)
299
- N > 0 && (μ[1 ] = - two (T))
327
+ N > 0 && (μ[1 ] = two (T))
300
328
if N > 1
301
- μ[2 ] = - one (T)
329
+ μ[2 ] = one (T)
302
330
for i= 1 : N- 2
303
- cst = isodd (i) ? T (4 )/ T (i^ 2 - 4 ) : T (4 )/ T (i^ 2 - 1 )
331
+ cst = isodd (i) ? T (4 )/ T (4 - i^ 2 ) : T (4 )/ T (1 - i^ 2 )
304
332
@inbounds μ[i+ 2 ] = ((i- 2 )* μ[i]+ cst)/ (i+ 2 )
305
333
end
306
334
end
307
335
μ
308
336
end
309
337
338
+ """
339
+ Modified Chebyshev moments of the first kind with respect to the log-Chebyshev weight:
340
+
341
+ ```math
342
+ \\ int_{-1}^{+1} T_n(x) \\ log\\ left(\\ frac{2}{1-x}\\ right)\\ frac{{\\ rm d}x}{\\ sqrt{1-x^2}}.
343
+ ```
344
+ """
345
+ function chebyshevlogchebyshevmoments1 (:: Type{T} , N:: Int ) where T
346
+ μ = zeros (T, N)
347
+ N > 0 && (μ[1 ] = 2 * log (T (2 ))* π)
348
+ if N > 1
349
+ for i= 1 : N- 1
350
+ @inbounds μ[i+ 1 ] = T (π)/ i
351
+ end
352
+ end
353
+ μ
354
+ end
355
+
310
356
"""
311
357
Modified Chebyshev moments of the first kind with respect to the absolute value weight:
312
358
0 commit comments