Skip to content
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

Support removal of DFunction #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions src/GreensFun/CauchyWeight.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand All @@ -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...) :
Expand Down
11 changes: 4 additions & 7 deletions src/GreensFun/GreensFun.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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...)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions src/GreensFun/convolutionProductFun.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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...)

Expand Down
6 changes: 3 additions & 3 deletions src/GreensFun/skewProductFun.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions src/SingularIntegralEquations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down