File tree Expand file tree Collapse file tree 4 files changed +35
-5
lines changed
Expand file tree Collapse file tree 4 files changed +35
-5
lines changed Original file line number Diff line number Diff line change 11name = " ClassicalOrthogonalPolynomials"
22uuid = " b30e2e7b-c4ee-47da-9d5f-2c5c27239acd"
3- version = " 0.15.13 "
3+ version = " 0.15.14 "
44authors = [
" Sheehan Olver <[email protected] >" ]
55
66[deps ]
@@ -51,7 +51,7 @@ IntervalSets = "0.7"
5151LazyArrays = " 2.8"
5252LazyBandedMatrices = " 0.11"
5353MutableArithmetics = " 1"
54- QuasiArrays = " 0.13"
54+ QuasiArrays = " 0.13.2 "
5555RecurrenceRelationshipArrays = " 0.1.2"
5656RecurrenceRelationships = " 0.2"
5757SpecialFunctions = " 1.0, 2"
Original file line number Diff line number Diff line change 1010
1111function colleaguematrix (P, c)
1212 cₙ = paddeddata (c)
13+ isempty (cₙ) && return Matrix {eltype(P)} (undef, 0 , 0 )
1314 n = findlast (! iszero, cₙ)- 1
1415 J = jacobimatrix (P)'
1516 C = Matrix (J[1 : n,1 : n])
2930# ###
3031function minimum_layout (:: ExpansionLayout{<:AbstractOPLayout} , f:: AbstractQuasiVector , dims)
3132 r = findall (iszero, diff (f))
32- min (first (f), minimum (f[r]), last (f))
33+ if isempty (r)
34+ min (first (f), last (f))
35+ else
36+ min (first (f), minimum (f[r]), last (f))
37+ end
3338end
3439
3540function maximum_layout (:: ExpansionLayout{<:AbstractOPLayout} , f:: AbstractQuasiVector , dims)
3641 r = findall (iszero, diff (f))
37- max (first (f), maximum (f[r]), last (f))
42+ if isempty (r)
43+ max (first (f), last (f))
44+ else
45+ max (first (f), maximum (f[r]), last (f))
46+ end
3847end
3948
4049function extrema_layout (:: ExpansionLayout{<:AbstractOPLayout} , f:: AbstractQuasiVector , dims... )
4150 r = findall (iszero, diff (f))
42- extrema ([first (f); f[r]; last (f)])
51+ if isempty (r)
52+ extrema ([first (f); last (f)])
53+ else
54+ extrema ([first (f); f[r]; last (f)])
55+ end
4356end
Original file line number Diff line number Diff line change @@ -237,4 +237,16 @@ import QuasiArrays: MulQuasiArray
237237 f = P * (P \ exp .(x))
238238 @test P \ cumsum (f) ≈ P \ (exp .(x) .- exp (- 1 ))
239239 end
240+
241+ @testset " norm" begin
242+ f = expand (Legendre (), x -> exp (im* x))
243+ @test norm (f) isa Float64
244+ @test norm (f,1 ) isa Float64
245+ @test norm (f,3 ) isa Float64
246+ @test norm (f,Inf ) isa Float64
247+ @test norm (f) ≈ norm (expand (legendre (- 1 .. 1 ), x -> exp (im* x))) ≈ sqrt (2 )
248+ @test norm (f,1 ) ≈ 2
249+ @test norm (f,Inf ) ≈ 1
250+ @test norm (f,3 ) ≈ cbrt (2 )
251+ end
240252end
Original file line number Diff line number Diff line change 3737 @test minimum (f) ≈ - 2.682833127491678
3838 @test maximum (f) ≈ 2.6401248792053362
3939 @test extrema (f) == (minimum (f), maximum (f))
40+
41+ f = expand (ChebyshevT (), exp)
42+ @test minimum (f) ≈ 1 / ℯ
43+ @test maximum (f) ≈ ℯ
44+ @test extrema (f) == (minimum (f), maximum (f))
4045end
You can’t perform that action at this time.
0 commit comments