Skip to content

Commit 6115c58

Browse files
committed
Fixes eval errors
1 parent 4c6cfe1 commit 6115c58

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

test/runtests.jl

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,15 @@ function trianglecfsmat{T}(cfs::AbstractVector{T})
228228
cfsmat=Array(T,n+2,n+1)
229229
cfsmat=fill!(cfsmat,0)
230230
m=1
231-
for d=1:n+1, k=1:d
232-
j=d-k+1
233-
cfsmat[k,j]=cfs[m]
234-
if m==N
235-
return cfsmat
236-
else
237-
m+=1
231+
for d=1:n+1
232+
@inbounds for k=1:d
233+
j=d-k+1
234+
cfsmat[k,j]=cfs[m]
235+
if m==N
236+
return cfsmat
237+
else
238+
m+=1
239+
end
238240
end
239241
end
240242
return cfsmat
@@ -245,10 +247,11 @@ Interpolates a 2d function at a given point using 2d Chebyshev series.
245247
function paduaeval(f::Function,x::AbstractFloat,y::AbstractFloat,m::Integer)
246248
T=promote_type(typeof(x),typeof(y))
247249
M=div((m+1)*(m+2),2)
250+
pvals=Array(T,M)
248251
p=paduapoints(T,m)
249-
map!(f,p,p[:,1],p[:,2])
250-
plan=plan_paduatransform(p)
251-
coeffs=paduatransform(plan,p)
252+
map!(f,pvals,p[:,1],p[:,2])
253+
plan=plan_paduatransform(pvals)
254+
coeffs=paduatransform(plan,pvals)
252255
cfs_mat=trianglecfsmat(coeffs)
253256
cfs_mat=view(cfs_mat,1:m+1,:)
254257
f_x=sum([cfs_mat[k,j]*cos((j-1)*acos(x))*cos((k-1)*acos(y)) for k=1:m+1, j=1:m+1])

0 commit comments

Comments
 (0)