|
1 | 1 | using ClassicalOrthogonalPolynomials, QuasiArrays, ContinuumArrays, BandedMatrices, LazyArrays,
|
2 |
| - FastTransforms, ArrayLayouts, Test, FillArrays, Base64, BlockArrays, LazyBandedMatrices, ForwardDiff |
| 2 | + FastTransforms, ArrayLayouts, Test, FillArrays, Base64, BlockArrays, LazyBandedMatrices |
| 3 | +using ForwardDiff |
3 | 4 | import ClassicalOrthogonalPolynomials: Clenshaw, recurrencecoefficients, clenshaw, paddeddata, jacobimatrix, oneto, Weighted, MappedOPLayout
|
4 | 5 | import LazyArrays: ApplyStyle
|
5 | 6 | import QuasiArrays: MulQuasiMatrix
|
@@ -104,7 +105,7 @@ import BandedMatrices: isbanded
|
104 | 105 | @testset "ChebyshevU" begin
|
105 | 106 | U = ChebyshevU()
|
106 | 107 | @test U == chebyshevu()
|
107 |
| - @test U ≠ ChebyshevT() |
| 108 | + @test U ≠ ChebyshevT() |
108 | 109 | x = axes(U,1)
|
109 | 110 | F = factorize(U[:,oneto(5)])
|
110 | 111 | @test @inferred(F \ x) ≈ [0,0.5,0,0,0]
|
@@ -261,7 +262,7 @@ import BandedMatrices: isbanded
|
261 | 262 |
|
262 | 263 | WT̃ = w[2x .- 1] .* T[2x .- 1, :]
|
263 | 264 | @test MemoryLayout(WT̃) isa WeightedBasisLayout{MappedOPLayout}
|
264 |
| - @test WT̃ ≠ T[2x .- 1, :] |
| 265 | + @test WT̃ ≠ T[2x .- 1, :] |
265 | 266 | v = WT̃ * (WT̃ \ @.(exp(x)/(sqrt(x)*sqrt(1-x))))
|
266 | 267 | @test v[0.1] ≈ let x = 0.1; exp(x)/(sqrt(x)*sqrt(1-x)) end
|
267 | 268 |
|
@@ -364,7 +365,7 @@ import BandedMatrices: isbanded
|
364 | 365 | @test Chebyshev() == ChebyshevT() == ChebyshevT{Float32}()
|
365 | 366 | @test ChebyshevU() == ChebyshevU{Float32}()
|
366 | 367 | @test Chebyshev{3}() == Chebyshev{3,Float32}()
|
367 |
| - @test Chebyshev() ≠ ChebyshevU() |
| 368 | + @test Chebyshev() ≠ ChebyshevU() |
368 | 369 | end
|
369 | 370 |
|
370 | 371 | @testset "sum" begin
|
@@ -569,6 +570,14 @@ import BandedMatrices: isbanded
|
569 | 570 | A = T \ (a.(x, 0.) .* T)
|
570 | 571 | @test iszero(A[1,1])
|
571 | 572 | end
|
| 573 | + |
| 574 | + @testset "complex rhs (#139)" begin |
| 575 | + T = Chebyshev() |
| 576 | + x = axes(T,1) |
| 577 | + @test T[:,OneTo(5)] \ exp.(im*x) == T[:,1:5] \ exp.(im*x) == ChebyshevT{ComplexF64}()[:,1:5] \ exp.(im*x) |
| 578 | + @test T \ exp.(im*x) ≈ transform(T, x -> exp(im*x)) |
| 579 | + @test expand(T, x -> exp(im*x))[0.1] ≈ exp(im*0.1) |
| 580 | + end |
572 | 581 | end
|
573 | 582 |
|
574 | 583 | struct QuadraticMap{T} <: Map{T} end
|
|
0 commit comments