Skip to content

Commit 32ae4dd

Browse files
committed
Add PadTransform tests to runtests
1 parent 230671a commit 32ae4dd

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

test/PadTransformTests.jl

Lines changed: 0 additions & 26 deletions
This file was deleted.

test/runtests.jl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,27 @@ c = randn(1000)./√(1:1000);
205205
@test norm(jac2jac(c,0.,2/2,-1/4,2/2)-jjt(c,0.,2/2,-1/4,2/2),Inf) < 10length(c)*eps()
206206

207207
@test norm(ultra2ultra(ultra2ultra(c,.5,.75),.75,.5)-c,Inf) < 10length(c)*eps()
208+
209+
println("Testing Pad Transforms and their inverse function property")
210+
n=100
211+
N=div((n+1)*(n+2),2)
212+
v=rand(N) # Length of v is the no. of Padua points
213+
@test norm(padtransform(ipadtransform(v))-v)< 100eps()
214+
@test norm(ipadtransform(padtransform(v))-v)< 100eps()
215+
@test_approx_eq padtransform(ipadtransform(v)) v
216+
@test_approx_eq ipadtransform(padtransform(v)) v
217+
218+
println("Testing runtimes for Pad Transforms")
219+
@time padtransform(v)
220+
@time ipadtransform(v)
221+
222+
println("Accuracy of 2d function interpolation at a point")
223+
f = (x,y) -> x^2*y+x^3
224+
g = (x,y) ->cos(exp(2*x+y))*sin(y)
225+
x=0.1;y=0.2
226+
m=20
227+
l=80
228+
f_x=padeval(f,x,y,m)
229+
g_x=padeval(g,x,y,l)
230+
@test_approx_eq f(x,y) f_x
231+
@test_approx_eq g(x,y) g_x

0 commit comments

Comments
 (0)