Skip to content

Use setdiffdomain in spaces tests #340

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 4 commits into from
Mar 5, 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
3 changes: 2 additions & 1 deletion test/ODETest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module ODETest

using ApproxFunOrthogonalPolynomials
using ApproxFunBase
using DomainSets: setdiffdomain
using SpecialFunctions
using Test
using LazyArrays
Expand Down Expand Up @@ -130,7 +131,7 @@ include("testutils.jl")
end

@testset "Union of intervals" begin
x=Fun(identity,(-2..15) \ [-1,0])
x=Fun(identity, setdiffdomain(-2..15, [-1,0]))
sp=space(x)

B = [Dirichlet(sp);continuity(sp,0:1)]
Expand Down
3 changes: 2 additions & 1 deletion test/PDETest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module PDETest

using ApproxFunBase
using ApproxFunOrthogonalPolynomials
using DomainSets: setdiffdomain
using LinearAlgebra
using Test
using ApproxFunBase: Block, ldiv_coefficients
Expand Down Expand Up @@ -275,7 +276,7 @@ include("testutils.jl")
end

@testset "concatenate InterlaceOperator" begin
a=Fun(x -> 0 ≤ x ≤ 0.5 ? 0.5 : 1, Domain(-1..1) \ [0,0.5])
a=Fun(x -> 0 ≤ x ≤ 0.5 ? 0.5 : 1, setdiffdomain(Domain(-1..1), [0,0.5]))
@test a(0.1) == 0.5
@test a(0.7) == 1.0
s=space(a)
Expand Down
6 changes: 3 additions & 3 deletions test/SpacesTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using ApproxFunOrthogonalPolynomials
using SpecialFunctions
using LinearAlgebra
using Test
using DomainSets: UnionDomain
using DomainSets: UnionDomain, setdiffdomain
using ApproxFunBase: space, SpaceOperator
using ApproxFunBaseTest: testbandedoperator, testraggedbelowoperator,
testtransforms, testfunctional
Expand Down Expand Up @@ -90,7 +90,7 @@ using ApproxFunBaseTest: testbandedoperator, testraggedbelowoperator,
@test norm(max(x,x)-x)<100eps()
@test norm(min(x,x)-x)<100eps()

f3=Fun(x->x<-0.05 ? -1.0 : (x<0.45 ? 4*(x-.2) : 1), (-1..1) \ [-0.05,0.45])
f3=Fun(x->x<-0.05 ? -1.0 : (x<0.45 ? 4*(x-.2) : 1), setdiffdomain(-1..1, [-0.05,0.45]))
@test norm(f2.(range(-1,stop=1,length=10))-f3.(range(-1,stop=1,length=10))) < 4eps()
end

Expand Down Expand Up @@ -332,7 +332,7 @@ using ApproxFunBaseTest: testbandedoperator, testraggedbelowoperator,
end

@testset "remove point" begin
f = Fun(identity, (-1..1) \ 0)
f = Fun(identity, setdiffdomain(-1..1, 0))
@test f(0.1) ≈ 0.1
@test f(-0.1) ≈ -0.1
end
Expand Down
3 changes: 2 additions & 1 deletion test/SpeedODETest.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module SpeedODETest
using ApproxFunOrthogonalPolynomials
using SpecialFunctions
using DomainSets: setdiffdomain
using Test
using ApproxFunBase: ldiv_coefficients
using LinearAlgebra
Expand Down Expand Up @@ -82,7 +83,7 @@ println("Complex exp: Time should be 0.03")


## Piecewise
x=Fun(identity,Domain(-20..15) \ [-10.,-5.,0.,1.])
x=Fun(identity, setdiffdomain(Domain(-20..15), [-10.,-5.,0.,1.]))
sp=space(x)
D=Derivative(sp)
B=[Dirichlet(sp);continuity(sp,0:1)]
Expand Down