Skip to content

Commit

Permalink
avoid repeated variables (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub authored Jan 4, 2023
1 parent 935b82a commit 4163420
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ApproxFunSingularities"
uuid = "f8fcb915-6b99-5be2-b79a-d6dbef8e6e7e"
version = "0.3.6"
version = "0.3.7"

[deps]
ApproxFunBase = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
Expand Down
27 changes: 15 additions & 12 deletions src/JacobiWeight.jl
Original file line number Diff line number Diff line change
Expand Up @@ -414,22 +414,25 @@ function Multiplication(f::Fun{<:JacobiWeight{<:ConstantSpace,<:IntervalOrSegmen
# this implements (1+x)*P and (1-x)*P special case
# see DLMF (18.9.6)
d=domain(f)
if ((space(f).β==1 && space(f).α==0 && S.b >0) ||
(space(f).β==0 && space(f).α==1 && S.a >0))
Sf = space(f)
if ((Sf.β==1 && Sf.α==0 && S.b >0) ||
(Sf.β==0 && Sf.α==1 && S.a >0))
ConcreteMultiplication(f,S)
elseif isapproxinteger(space(f).β) && space(f).β 1 && S.b >0
elseif isapproxinteger(Sf.β) && Sf.β 1 && S.b >0
# decrement β and multiply again
M=Multiplication(f.coefficients[1]*jacobiweight(1.,0.,d),S)
MultiplicationWrapper(f,Multiplication(jacobiweight(space(f).β-1,space(f).α,d),rangespace(M))*M)
elseif isapproxinteger(space(f).α) && space(f).α 1 && S.a >0
M1 = ConcreteMultiplication(f.coefficients[1]*jacobiweight(1.,0.,d),S)
M1_out = Multiplication(jacobiweight(Sf.β-1,Sf.α,d), rangespace(M1)) * M1
MultiplicationWrapper(f, M1_out)
elseif isapproxinteger(Sf.α) && Sf.α 1 && S.a >0
# decrement α and multiply again
M=Multiplication(f.coefficients[1]*jacobiweight(0.,1.,d),S)
MultiplicationWrapper(f,Multiplication(jacobiweight(space(f).β,space(f).α-1,d),rangespace(M))*M)
M2 = ConcreteMultiplication(f.coefficients[1]*jacobiweight(0.,1.,d),S)
M2_out = Multiplication(jacobiweight(Sf.β,Sf.α-1,d), rangespace(M2)) * M2
MultiplicationWrapper(f, M2_out)
else
# default JacobiWeight
M=Multiplication(Fun(space(f).space,f.coefficients),S)
rsp=JacobiWeight(space(f).β,space(f).α,rangespace(M))
MultiplicationWrapper(f,SpaceOperator(M,S,rsp))
# default JacobiWeight
M = Multiplication(Fun(Sf.space, f.coefficients), S)
rsp = JacobiWeight(Sf.β, Sf.α, rangespace(M))
MultiplicationWrapper(f, SpaceOperator(M,S,rsp))
end
end

Expand Down
12 changes: 6 additions & 6 deletions src/JacobiWeightOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ function jacobiweightDerivative(S::JacobiWeight{<:Any,<:ChebyshevInterval})
elseif S.β==0
w=Fun(JacobiWeight(0,1,ConstantSpace(d)),[1.])

DD=-S.α + w*Derivative(S.space)
rs=S.α==1 ? rangespace(DD) : JacobiWeight(0.,S.α-1,rangespace(DD))
DerivativeWrapper(SpaceOperator(DD,S,rs),1)
DDβ0=-S.α + w*Derivative(S.space)
rsβ0=S.α==1 ? rangespace(DDβ0) : JacobiWeight(0.,S.α-1,rangespace(DDβ0))
DerivativeWrapper(SpaceOperator(DDβ0,S,rsβ0),1)
elseif S.α==0
w=Fun(JacobiWeight(1,0,ConstantSpace(d)),[1.])

DD=S.β + w*Derivative(S.space)
rs=S.β==1 ? rangespace(DD) : JacobiWeight(S.β-1,0.,rangespace(DD))
DerivativeWrapper(SpaceOperator(DD,S,rs),1)
DDα0=S.β + w*Derivative(S.space)
rsα0=S.β==1 ? rangespace(DDα0) : JacobiWeight(S.β-1,0.,rangespace(DDα0))
DerivativeWrapper(SpaceOperator(DDα0,S,rsα0),1)
else
w=Fun(JacobiWeight(1,1,ConstantSpace(d)),[1.])
x=Fun()
Expand Down

2 comments on commit 4163420

@jishnub
Copy link
Member Author

@jishnub jishnub commented on 4163420 Jan 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/75064

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.7 -m "<description of version>" 4163420d632abe4e62728e08d8e6c970aec8db88
git push origin v0.3.7

Please sign in to comment.