18 |
# ============================================================== |
# ============================================================== |
19 |
|
|
20 |
arglist = [ \ |
arglist = [ \ |
21 |
|
3.0, \ |
22 |
[3,4], \ |
[3,4], \ |
23 |
[[1,2],[3,4]], \ |
[[1,2],[3,4]], \ |
|
[[15,8],[12,8]], \ |
|
24 |
[[[15,8],[12,8]],[[-9,9],[13,8]]], \ |
[[[15,8],[12,8]],[[-9,9],[13,8]]], \ |
25 |
3.0 \ |
[[[[35,9],[82,1]],[[-3,5],[33,8]]],[[[95,8],[-18,2]],[[-2,7],[113,-8]]]] \ |
26 |
] |
] |
27 |
|
|
28 |
# ============================================================== |
# ============================================================== |
33 |
else: |
else: |
34 |
exx=False |
exx=False |
35 |
out=Data(val,what=wh,expand=exx) |
out=Data(val,what=wh,expand=exx) |
36 |
|
if ex=="Tagged": |
37 |
|
out.tag() |
38 |
return out |
return out |
39 |
|
|
40 |
def doTest(a,ex,wh): |
def doTest(arg,ex,wh): |
|
|
|
|
arg=prepareArg(a,ex,wh) |
|
41 |
|
|
42 |
arg._wherePositive() |
arg._wherePositive() |
43 |
arg._whereZero() |
arg._whereZero() |
44 |
arg._trace() |
arg._trace() |
45 |
arg._log() |
arg._log() |
46 |
|
arg._sin() |
47 |
|
arg._acosh() |
48 |
arg._Lsup() |
arg._Lsup() |
49 |
arg._maxval() |
arg._maxval() |
50 |
arg._sign() |
arg._sign() |
60 |
|
|
61 |
totalTime = 0 |
totalTime = 0 |
62 |
|
|
63 |
for x0 in [10, 100]: |
for x0 in [10, 100, 1000]: |
64 |
for x1 in [10, 100]: |
for x1 in [10, 100, 1000]: |
65 |
|
|
66 |
print "#### x0:", x0, "#### x1:", x1, "####" |
print "#### x0:", x0, "#### x1:", x1, "####" |
|
msh=bruce.Rectangle(x0,x1) |
|
67 |
|
|
68 |
|
msh=bruce.Rectangle(x0,x1) |
69 |
for wh in [ContinuousFunction(msh),Function(msh)]: |
for wh in [ContinuousFunction(msh),Function(msh)]: |
70 |
|
|
71 |
for ex in ["Constant","Expanded"]: |
print wh |
|
|
|
|
for a in arglist: |
|
72 |
|
|
73 |
testNum+=1 |
for ex in ["Constant","Tagged","Expanded"]: |
|
print testNum, ": ----------------------------------------------" |
|
|
print a, ex, wh |
|
74 |
|
|
75 |
testElapsed = 0 |
for a in arglist: |
76 |
|
|
77 |
for j in range(10): |
arg=prepareArg(a,ex,wh) |
78 |
|
|
79 |
starttime = time.clock() |
testNum+=1 |
80 |
|
print "Test", testNum, ": ----------------------------------------------" |
81 |
|
print ex, "Rank", arg.getRank() |
82 |
|
|
83 |
for i in range(1000): |
starttime = time.clock() |
84 |
|
|
85 |
doTest(a,ex,wh) |
for i in range(1000): |
86 |
|
|
87 |
stoptime = time.clock() |
doTest(arg,ex,wh) |
|
elapsed = stoptime - starttime |
|
|
testElapsed += elapsed |
|
|
totalTime += elapsed |
|
88 |
|
|
89 |
print elapsed |
stoptime = time.clock() |
90 |
|
testElapsed = stoptime - starttime |
91 |
|
totalTime += testElapsed |
92 |
|
|
93 |
print "Test elapsed time: ", testElapsed |
print "Test elapsed time: ", testElapsed |
94 |
|
|