Skip to content

Fix #139 #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ArrayLayouts = "1.3.1"
BandedMatrices = "1"
BlockArrays = "1"
BlockBandedMatrices = "0.13"
ContinuumArrays = "0.18"
ContinuumArrays = "0.18.3"
DomainSets = "0.6, 0.7"
FFTW = "1.1"
FastGaussQuadrature = "1"
Expand Down
17 changes: 13 additions & 4 deletions test/test_chebyshev.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using ClassicalOrthogonalPolynomials, QuasiArrays, ContinuumArrays, BandedMatrices, LazyArrays,
FastTransforms, ArrayLayouts, Test, FillArrays, Base64, BlockArrays, LazyBandedMatrices, ForwardDiff
FastTransforms, ArrayLayouts, Test, FillArrays, Base64, BlockArrays, LazyBandedMatrices
using ForwardDiff
import ClassicalOrthogonalPolynomials: Clenshaw, recurrencecoefficients, clenshaw, paddeddata, jacobimatrix, oneto, Weighted, MappedOPLayout
import LazyArrays: ApplyStyle
import QuasiArrays: MulQuasiMatrix
Expand Down Expand Up @@ -104,7 +105,7 @@ import BandedMatrices: isbanded
@testset "ChebyshevU" begin
U = ChebyshevU()
@test U == chebyshevu()
@test U ≠ ChebyshevT()
@test U ≠ ChebyshevT()
x = axes(U,1)
F = factorize(U[:,oneto(5)])
@test @inferred(F \ x) ≈ [0,0.5,0,0,0]
Expand Down Expand Up @@ -261,7 +262,7 @@ import BandedMatrices: isbanded

WT̃ = w[2x .- 1] .* T[2x .- 1, :]
@test MemoryLayout(WT̃) isa WeightedBasisLayout{MappedOPLayout}
@test WT̃ ≠ T[2x .- 1, :]
@test WT̃ ≠ T[2x .- 1, :]
v = WT̃ * (WT̃ \ @.(exp(x)/(sqrt(x)*sqrt(1-x))))
@test v[0.1] ≈ let x = 0.1; exp(x)/(sqrt(x)*sqrt(1-x)) end

Expand Down Expand Up @@ -364,7 +365,7 @@ import BandedMatrices: isbanded
@test Chebyshev() == ChebyshevT() == ChebyshevT{Float32}()
@test ChebyshevU() == ChebyshevU{Float32}()
@test Chebyshev{3}() == Chebyshev{3,Float32}()
@test Chebyshev() ≠ ChebyshevU()
@test Chebyshev() ≠ ChebyshevU()
end

@testset "sum" begin
Expand Down Expand Up @@ -569,6 +570,14 @@ import BandedMatrices: isbanded
A = T \ (a.(x, 0.) .* T)
@test iszero(A[1,1])
end

@testset "complex rhs (#139)" begin
T = Chebyshev()
x = axes(T,1)
@test T[:,OneTo(5)] \ exp.(im*x) == T[:,1:5] \ exp.(im*x) == ChebyshevT{ComplexF64}()[:,1:5] \ exp.(im*x)
@test T \ exp.(im*x) ≈ transform(T, x -> exp(im*x))
@test expand(T, x -> exp(im*x))[0.1] ≈ exp(im*0.1)
end
end

struct QuadraticMap{T} <: Map{T} end
Expand Down
2 changes: 1 addition & 1 deletion test/test_jacobi.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ClassicalOrthogonalPolynomials, FillArrays, BandedMatrices, ContinuumArrays, QuasiArrays, LazyArrays, LazyBandedMatrices, FastGaussQuadrature, Test
import ClassicalOrthogonalPolynomials: recurrencecoefficients, basis, MulQuasiMatrix, arguments, Weighted, HalfWeighted
import ClassicalOrthogonalPolynomials: recurrencecoefficients, basis, MulQuasiMatrix, arguments, Weighted, HalfWeighted, grammatrix

@testset "Jacobi" begin
@testset "JacobiWeight" begin
Expand Down
Loading