Skip to content

Commit 068dc31

Browse files
authored
Extend normalizedspace for PolynomialSpace (#242)
* Add normalized * map normalized * Extend normalizedspace from ApproxFunBase * Extend normalizedspace for NormalizedPolynomialSpace
1 parent cf888f9 commit 068dc31

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2020
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
2121

2222
[compat]
23-
ApproxFunBase = "0.8.16"
23+
ApproxFunBase = "0.8.21"
2424
ApproxFunBaseTest = "0.1"
2525
Aqua = "0.5"
2626
BandedMatrices = "0.16, 0.17"

src/ApproxFunOrthogonalPolynomials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import ApproxFunBase: Fun, SubSpace, WeightSpace, NoSpace, HeavisideSpace,
4444
ℓ⁰, recα, recβ, recγ, ℵ₀, ∞, RectDomain,
4545
assert_integer, supportsinplacetransform, ContinuousSpace, SpecialEvalPtType,
4646
isleftendpoint, isrightendpoint, evaluation_point, boundaryfn, ldiffbc, rdiffbc,
47-
LeftEndPoint, RightEndPoint
47+
LeftEndPoint, RightEndPoint, normalizedspace
4848

4949
import DomainSets: Domain, indomain, UnionDomain, FullSpace, Point,
5050
Interval, ChebyshevInterval, boundary, rightendpoint, leftendpoint,

src/Spaces/PolynomialSpace.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,9 @@ setdomain(NS::NormalizedPolynomialSpace, d::Domain) = NormalizedPolynomialSpace(
443443

444444
NormalizedPolynomialSpace(space::PolynomialSpace{D,R}) where {D,R} = NormalizedPolynomialSpace{typeof(space),D,R}(space)
445445

446+
normalizedspace(S::PolynomialSpace) = NormalizedPolynomialSpace(S)
447+
normalizedspace(S::NormalizedPolynomialSpace) = S
448+
446449
supportsinplacetransform(N::NormalizedPolynomialSpace) = supportsinplacetransform(N.space)
447450

448451
function Conversion(L::NormalizedPolynomialSpace{S}, M::S) where S<:PolynomialSpace

test/ChebyshevTest.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,4 +441,18 @@ using ApproxFunOrthogonalPolynomials: forwardrecurrence
441441
blk = @inferred ApproxFunBase.block(s, 2)
442442
@test Int(blk) == 1
443443
end
444+
445+
@testset "PiecewiseSpace" begin
446+
d = Segment(-1..0) Segment(0..1)
447+
S = PiecewiseSpace(Chebyshev.(components(d)))
448+
NS = normalizedspace(S)
449+
@test domain(NS) == domain(S)
450+
@test NS isa PiecewiseSpace{<:NTuple{<:Any,NormalizedChebyshev}}
451+
f = Fun(S)
452+
g = Conversion(S, NS) * f
453+
@test g(0.4) 0.4
454+
@test g(-0.4) -0.4
455+
456+
@test normalizedspace(NS) == NS
457+
end
444458
end

0 commit comments

Comments
 (0)