Skip to content

Commit b8740b5

Browse files
authored
Normalized polynomial spaces contain constant (#134)
* contains const for normalized poly space * version bump to v0.5.12
1 parent 27aa712 commit b8740b5

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunOrthogonalPolynomials"
22
uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211"
3-
version = "0.5.11"
3+
version = "0.5.12"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Spaces/PolynomialSpace.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ struct NormalizedPolynomialSpace{S,D,R} <: Space{D,R}
342342
NormalizedPolynomialSpace{S,D,R}(space) where {S,D,R} = new{S,D,R}(space)
343343
end
344344

345+
@containsconstants NormalizedPolynomialSpace
346+
345347
domain(S::NormalizedPolynomialSpace) = domain(S.space)
346348
canonicalspace(S::NormalizedPolynomialSpace) = S.space
347349
setdomain(NS::NormalizedPolynomialSpace, d::Domain) = NormalizedPolynomialSpace(setdomain(canonicalspace(NS), d))

test/ChebyshevTest.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ import ApproxFunOrthogonalPolynomials: forwardrecurrence
272272
f = (Derivative() + Fun(s)) * Fun(s)
273273
g = ones(s) + Fun(s)^2
274274
@test f g
275+
276+
@test space(1 + Fun(NormalizedChebyshev())) == NormalizedChebyshev()
277+
@test space(1 + Fun(NormalizedChebyshev(0..1))) == NormalizedChebyshev(0..1)
275278
end
276279
end
277280

test/JacobiTest.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,11 @@ import ApproxFunOrthogonalPolynomials: jacobip
389389
@test ApproxFunBase.isbanded(Multiplication(xC, NormalizedJacobi(1,1)))
390390
@test ApproxFunBase.isbanded(Multiplication(xNC, NormalizedJacobi(1,1)))
391391
end
392+
393+
@testset "space promotion" begin
394+
@test space(1 + Fun(NormalizedLegendre())) == NormalizedLegendre()
395+
@test space(1 + Fun(NormalizedJacobi(1,1,0..1))) == NormalizedJacobi(1,1,0..1)
396+
end
392397
end
393398

394399
@testset "casting bug ApproxFun.jl#770" begin

test/runtests.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ macro verbose(ex)
2828
if VERSION >= v"1.8"
2929
insert!(args, 3, Expr(:(=), :verbose, true))
3030
end
31-
quote
32-
$(Expr(head, args...))
33-
@info "Finished " * $name * " tests"
34-
end
31+
Expr(head, args...)
3532
end
3633

3734
include("ClenshawTest.jl")

0 commit comments

Comments
 (0)