Skip to content

Commit f3819a4

Browse files
committed
Use broadcast
1 parent 84c086a commit f3819a4

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/ChebyshevJacobiPlan.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function ForwardChebyshevJacobiPlan{T}(c_jac::AbstractVector{T},α::T,β::T,M::I
140140
@inbounds for i=1:N+1 tempcosβsinα[i] = tempcos[i]^+1/2)*tempsin[i]^+1/2) end
141141

142142
# Initialize normalizing constant
143-
cnαβ = Cnαβ(0:N,α,β)
143+
cnαβ = Cnαβ.(0:N,α,β)
144144
cnmαβ = zero(cnαβ)
145145

146146
# Get indices
@@ -182,11 +182,11 @@ function BackwardChebyshevJacobiPlan{T}(c_cheb::AbstractVector{T},α::T,β::T,M:
182182
@inbounds for i=1:2N+1 tempcosβsinα[i] = tempcos[i]^+1/2)*tempsin[i]^+1/2) end
183183

184184
# Initialize normalizing constant
185-
cnαβ = Cnαβ(0:2N,α,β)
185+
cnαβ = Cnαβ.(0:2N,α,β)
186186
cnmαβ = zero(cnαβ)
187187

188188
# Initialize orthonormality constants
189-
anαβ = Anαβ(0:N,α,β)
189+
anαβ = Anαβ.(0:N,α,β)
190190

191191
# Get indices
192192
CJI = ChebyshevJacobiIndices(α,β,CJC,tempmindices,cfs,tempcos,tempsin,tempcosβsinα)

src/ChebyshevUltrasphericalPlan.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function ForwardChebyshevUltrasphericalPlan{T}(c_ultra::AbstractVector{T},λ::T,
139139
tempsinλm = similar(tempsinλ)
140140

141141
# Initialize normalizing constant
142-
cnλ = Cnλ(0:N,λ)
142+
cnλ = Cnλ.(0:N,λ) # broadcast is overloaded
143143
cnmλ = similar(cnλ)
144144

145145
# Get indices
@@ -180,7 +180,7 @@ function BackwardChebyshevUltrasphericalPlan{T}(c_ultra::AbstractVector{T},λ::T
180180
tempsinλm = similar(tempsinλ)
181181

182182
# Initialize normalizing constant
183-
cnλ = Cnλ(0:2N,λ)
183+
cnλ = Cnλ.(0:2N,λ) # broadcast is overloaded
184184
cnmλ = similar(cnλ)
185185

186186
# Initialize orthonormality constants

test/runtests.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ n = 0:1000_000
88
@time FastTransforms.Cnλ.(n,λ);
99

1010
x = linspace(0,20,81);
11-
@test norm((FastTransforms.Λ.(x)-FastTransforms.Λ.(big.(x)))./FastTransforms.Λ.(big.(x)),Inf) < 2eps()
11+
@test norm((FastTransforms.Λ.(x).-FastTransforms.Λ.(big.(x)))./FastTransforms.Λ.(big.(x)),Inf) < 2eps()
1212

1313
x = 0:0.5:10_000
1414
λ₁,λ₂ = 0.125,0.875
@@ -20,11 +20,11 @@ n = 0:1000
2020
α = 0.125
2121
β = 0.375
2222

23-
@time FastTransforms.Cnαβ(n,α,β);
24-
@test norm(FastTransforms.Cnαβ(n,α,β)./FastTransforms.Cnαβ(n,big(α),big(β))-1,Inf) < 3eps()
23+
@time FastTransforms.Cnαβ.(n,α,β);
24+
@test norm(FastTransforms.Cnαβ.(n,α,β)./FastTransforms.Cnαβ.(n,big(α),big(β))-1,Inf) < 3eps()
2525

26-
@time FastTransforms.Anαβ(n,α,β);
27-
@test norm(FastTransforms.Anαβ(n,α,β)./FastTransforms.Anαβ(n,big(α),big(β))-1,Inf) < 4eps()
26+
@time FastTransforms.Anαβ.(n,α,β);
27+
@test norm(FastTransforms.Anαβ.(n,α,β)./FastTransforms.Anαβ.(n,big(α),big(β))-1,Inf) < 4eps()
2828

2929

3030
N = 20

0 commit comments

Comments
 (0)