From fcbfa9d9bc2f3c20531b926057261e2ce961f04c Mon Sep 17 00:00:00 2001 From: Sheehan Olver Date: Mon, 22 May 2023 22:17:51 +0100 Subject: [PATCH] Support removal of DFunction --- src/GreensFun/CauchyWeight.jl | 4 ++-- src/GreensFun/GreensFun.jl | 11 ++++------- src/GreensFun/convolutionProductFun.jl | 6 ++---- src/GreensFun/skewProductFun.jl | 6 +++--- src/SingularIntegralEquations.jl | 3 +-- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/GreensFun/CauchyWeight.jl b/src/GreensFun/CauchyWeight.jl index 8ffde05..f7c8083 100644 --- a/src/GreensFun/CauchyWeight.jl +++ b/src/GreensFun/CauchyWeight.jl @@ -34,7 +34,7 @@ cauchyweight(C::CauchyWeight{O},x,y) where {O} = cauchyweight(O,tocanonical(C,x, for Func in (:ProductFun,:convolutionProductFun) @eval begin - function $Func(f::DFunction,cwsp::CauchyWeight{O};kwds...) where O + function $Func(f::Function,cwsp::CauchyWeight{O};kwds...) where O F = domain(factor(cwsp.space,1)) == domain(factor(cwsp.space,2)) ? $Func(f,factor(cwsp.space,1),factor(cwsp.space,2);kwds...) : $Func((x,y)->f(x,y)*cauchyweight(O,x,y),factor(cwsp.space,1),factor(cwsp.space,2);kwds...) @@ -43,7 +43,7 @@ for Func in (:ProductFun,:convolutionProductFun) end end -function LowRankFun(f::DFunction,cwsp::CauchyWeight{O};retmax::Bool=false,kwds...) where O +function LowRankFun(f::Function,cwsp::CauchyWeight{O};retmax::Bool=false,kwds...) where O if retmax F,maxabsf = domain(factor(cwsp.space,1)) == domain(factor(cwsp.space,2)) ? LowRankFun(f,factor(cwsp.space,1),factor(cwsp.space,2);retmax=retmax,kwds...) : diff --git a/src/GreensFun/GreensFun.jl b/src/GreensFun/GreensFun.jl index dff1215..6b5877d 100644 --- a/src/GreensFun/GreensFun.jl +++ b/src/GreensFun/GreensFun.jl @@ -130,10 +130,7 @@ end ## Constructors -GreensFun(f::Function,args...;kwds...) = GreensFun(dynamic(f),args...;kwds...) -GreensFun(f::Function,g::Function,args...;kwds...) = GreensFun(dynamic(f),dynamic(g),args...;kwds...) - -function GreensFun(f::DFunction,ss::SS;method::Symbol=:lowrank,kwds...) where SS<:AbstractProductSpace +function GreensFun(f::Function,ss::SS;method::Symbol=:lowrank,kwds...) where SS<:AbstractProductSpace if method == :standard F = ProductFun(f,ss,kwds...) elseif method == :convolution @@ -163,7 +160,7 @@ function GreensFun(f::DFunction,ss::SS;method::Symbol=:lowrank,kwds...) where SS GreensFun(F) end -function GreensFun(f::DFunction,g::DFunction,ss::SS;method::Symbol=:unsplit,kwds...) where SS<:AbstractProductSpace +function GreensFun(f::Function,g::Function,ss::SS;method::Symbol=:unsplit,kwds...) where SS<:AbstractProductSpace if method == :unsplit # Approximate Riemann function of operator. G = skewProductFun(g,ss.space;kwds...) @@ -183,7 +180,7 @@ end # Array of GreensFun on TensorSpace of PiecewiseSpaces -function GreensFun(f::DFunction,ss::AbstractProductSpace{Tuple{PWS1,PWS2}};method::Symbol=:lowrank,tolerance::Symbol=:absolute,kwds...) where {PWS1<:PiecewiseSpace,PWS2<:PiecewiseSpace} +function GreensFun(f::Function,ss::AbstractProductSpace{Tuple{PWS1,PWS2}};method::Symbol=:lowrank,tolerance::Symbol=:absolute,kwds...) where {PWS1<:PiecewiseSpace,PWS2<:PiecewiseSpace} M,N = ncomponents(factor(ss,1)),ncomponents(factor(ss,2)) @assert M == N G = Array{GreensFun}(undef,N,N) @@ -239,7 +236,7 @@ function GreensFun(f::DFunction,ss::AbstractProductSpace{Tuple{PWS1,PWS2}};metho G end -function GreensFun(f::DFunction,g::DFunction,ss::AbstractProductSpace{Tuple{PWS1,PWS2}};method::Symbol=:unsplit,tolerance::Symbol=:absolute,kwds...) where {PWS1<:PiecewiseSpace,PWS2<:PiecewiseSpace} +function GreensFun(f::Function,g::Function,ss::AbstractProductSpace{Tuple{PWS1,PWS2}};method::Symbol=:unsplit,tolerance::Symbol=:absolute,kwds...) where {PWS1<:PiecewiseSpace,PWS2<:PiecewiseSpace} M,N = ncomponents(factor(ss.space,1)),ncomponents(factor(ss.space,2)) @assert M == N G = Array{GreensFun}(undef,N,N) diff --git a/src/GreensFun/convolutionProductFun.jl b/src/GreensFun/convolutionProductFun.jl index ff3b170..96e013a 100644 --- a/src/GreensFun/convolutionProductFun.jl +++ b/src/GreensFun/convolutionProductFun.jl @@ -5,9 +5,7 @@ export convolutionProductFun # defined as the distance of their arguments. # -convolutionProductFun(f::Function,args...;kwds...) = convolutionProductFun(dynamic(f),args...;kwds...) - -function convolutionProductFun(f::DFunction,u::UnivariateSpace,v::UnivariateSpace;tol=eps()) +function convolutionProductFun(f::Function,u::UnivariateSpace,v::UnivariateSpace;tol=eps()) du,dv = domain(u),domain(v) ext = extrema(du,dv) if ext[1] == 0 @@ -28,7 +26,7 @@ function convolutionProductFun(f::DFunction,u::UnivariateSpace,v::UnivariateSpac end end -convolutionProductFun(f::DFunction, +convolutionProductFun(f::Function, ss::TensorSpace{Tuple{U,V},DD,RR};kwds...) where {U<:UnivariateSpace,V<:UnivariateSpace,DD,RR} = convolutionProductFun(f,ss[1],ss[2];kwds...) diff --git a/src/GreensFun/skewProductFun.jl b/src/GreensFun/skewProductFun.jl index c614f56..76189a2 100644 --- a/src/GreensFun/skewProductFun.jl +++ b/src/GreensFun/skewProductFun.jl @@ -7,7 +7,7 @@ export skewProductFun, skewpoints, skewtransform!, iskewtransform! skewProductFun(f::Function,args...;kwds...) = skewProductFun(F(f),args...;kwds...) -function skewProductFun(f::DFunction,sp::TensorSpace{Tuple{Chebyshev{D1},Chebyshev{D2}}};tol=100eps()) where {D1,D2} +function skewProductFun(f::Function,sp::TensorSpace{Tuple{Chebyshev{D1},Chebyshev{D2}}};tol=100eps()) where {D1,D2} for logn = 4:10 X = coefficients(skewProductFun(f,sp,2^logn,2^logn+1;tol=tol)) if size(X,1)<2^logn && size(X,2)<2^logn+1 @@ -18,7 +18,7 @@ function skewProductFun(f::DFunction,sp::TensorSpace{Tuple{Chebyshev{D1},Chebysh skewProductFun(f,sp,2^11,2^11+1;tol=tol) end -function skewProductFun(f::DFunction,sp::TensorSpace{Tuple{Laurent{D1},Laurent{D2}}};tol=100eps()) where {D1,D2} +function skewProductFun(f::Function,sp::TensorSpace{Tuple{Laurent{D1},Laurent{D2}}};tol=100eps()) where {D1,D2} for logn = 4:10 X = coefficients(skewProductFun(f,sp,2^logn,2^logn;tol=tol)) if size(X,1)<2^logn && size(X,2)<2^logn @@ -29,7 +29,7 @@ function skewProductFun(f::DFunction,sp::TensorSpace{Tuple{Laurent{D1},Laurent{D skewProductFun(f,sp,2^11,2^11;tol=tol) end -function skewProductFun(f::DFunction,S::TensorSpace,M::Integer,N::Integer;tol=100eps()) +function skewProductFun(f::Function,S::TensorSpace,M::Integer,N::Integer;tol=100eps()) xy = checkpoints(S) T = promote_type(eltype(f(first(xy)...)),eltype(S)) ptsx,ptsy=skewpoints(S,M,N) diff --git a/src/SingularIntegralEquations.jl b/src/SingularIntegralEquations.jl index 84301bd..d61f92f 100644 --- a/src/SingularIntegralEquations.jl +++ b/src/SingularIntegralEquations.jl @@ -31,8 +31,7 @@ import ApproxFunBase: bandwidths, blockbandwidths, SpaceOperator, bilinearform, ConstantSpace, DirectSumSpace, ArraySpace, ZeroSpace, LowRankPertOperator, setcanonicaldomain, SubSpace, reverseorientation, @wrapper, mobius, - defaultgetindex, WeightSpace, spacescompatible, ∞, LowRankMatrix, SubOperator, - DFunction, + defaultgetindex, WeightSpace, spacescompatible, ∞, LowRankMatrix, SubOperator, component, ncomponents, factor, nfactors, components, factors, rangetype, VFun, Point, dynamic, pieces, npieces, piece, cfstype, isreal, IntervalOrSegmentDomain, IntervalOrSegment, canonicaldomain,