From b08b5aad372e8aa73181b43356184e666393c514 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Thu, 18 Aug 2022 13:27:00 +0400 Subject: [PATCH] fix jacobi evaluation (#90) --- Project.toml | 2 +- src/Spaces/Jacobi/JacobiOperators.jl | 2 +- test/JacobiTest.jl | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 962f473..55af8dc 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ApproxFunOrthogonalPolynomials" uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211" -version = "0.4.15" +version = "0.4.16" [deps] AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c" diff --git a/src/Spaces/Jacobi/JacobiOperators.jl b/src/Spaces/Jacobi/JacobiOperators.jl index 26fd169..8b1a46b 100644 --- a/src/Spaces/Jacobi/JacobiOperators.jl +++ b/src/Spaces/Jacobi/JacobiOperators.jl @@ -90,7 +90,7 @@ end function getindex(op::ConcreteEvaluation{<:Jacobi,<:Number},kr::AbstractRange) @assert op.order == 0 - jacobip(eltype(op),kr-1,op.space.a,op.space.b,tocanonical(domain(op),op.x)) + jacobip(eltype(op),kr.-1,op.space.a,op.space.b,tocanonical(domain(op),op.x)) end diff --git a/test/JacobiTest.jl b/test/JacobiTest.jl index 266b785..1f37e8a 100644 --- a/test/JacobiTest.jl +++ b/test/JacobiTest.jl @@ -28,6 +28,13 @@ import ApproxFunOrthogonalPolynomials: jacobip @test norm((Fun(f,sp2)-f2).coefficients)<100eps() @test norm((Fun(f,sp3)-f3).coefficients)<100eps() @test norm((Fun(f,sp4)-f4).coefficients)<200eps() + + f = Fun(Jacobi(0,0), Float64[1,2,3]) + for x in [-1, 0, 1] + g = Evaluation(x) * f + @test ncoefficients(g) == 1 + @test coefficients(g)[1] == f(x) + end end @testset "Conversion" begin