Révision 210
pobysoPythonSage/src/testPobyso.sage (revision 210) | ||
---|---|---|
30 | 30 |
return wrapped |
31 | 31 |
|
32 | 32 |
# |
33 |
def test_pobyso_absolute_so_so(): |
|
34 |
for index in xrange(0,1000000): |
|
33 |
def test_pobyso_absolute_so_so(repeat=10000, number=100): |
|
34 |
functionName = inspect.stack()[0][3] |
|
35 |
print "Running", inspect.stack()[0][3], "..." |
|
36 |
# |
|
37 |
def test(): |
|
35 | 38 |
absoluteSo = pobyso_absolute_so_so() |
36 | 39 |
sollya_lib_clear_obj(absoluteSo) |
40 |
# |
|
41 |
wrapped = test_pobyso_wrapper(test) |
|
42 |
timing = min(timeit.repeat(wrapped, repeat=repeat, number=number)) |
|
43 |
print "\t...", functionName, "done." |
|
44 |
return timing |
|
37 | 45 |
# End test_absolute_so_so |
38 | 46 |
|
39 | 47 |
def test_pobyso_autoprint_so_so(iterationsNum=1000): |
... | ... | |
97 | 105 |
return timing |
98 | 106 |
# End test_pobyso_bounds_to_range_sa_so |
99 | 107 |
|
108 |
def test_pobyso_float_poly_sa_so(repeat=100, number=10): |
|
109 |
functionName = inspect.stack()[0][3] |
|
110 |
print "Running", functionName,"..." |
|
111 |
polynomialsList = [] |
|
112 |
|
|
113 |
i = var('i') |
|
114 |
RRR = RealField(12) |
|
115 |
P_RRR = RRR[i] |
|
116 |
polynomialsList.append(P_RRR(1/7 + 2/7*i + 3/7*i^2)) |
|
117 |
RRR = RealField(53) |
|
118 |
P_RRR = RRR[i] |
|
119 |
polynomialsList.append(P_RRR(1/7 + 2/7*i + 3/7*i^2)) |
|
120 |
RRR = RealField(1024) |
|
121 |
P_RRR = RRR[i] |
|
122 |
polynomialsList.append(P_RRR(1/7 + 2/7*i + 3/7*i^2)) |
|
123 |
def test(polynomialsList): |
|
124 |
for polynomial in polynomialsList: |
|
125 |
polySo = pobyso_float_poly_sa_so(polynomial) |
|
126 |
sollya_lib_clear_obj(polySo) |
|
127 |
|
|
128 |
wrapped = test_pobyso_wrapper(test, |
|
129 |
polynomialsList) |
|
130 |
timing = min(timeit.repeat(wrapped, repeat=repeat, number=number)) |
|
131 |
print "\t...", functionName, "done." |
|
132 |
return timing |
|
133 |
# End test_pobyso_float_poly_sa_so |
|
134 |
|
|
100 | 135 |
def test_pobyso_error_so(repeat=1000, number=10): |
101 | 136 |
functionName = inspect.stack()[0][3] |
102 | 137 |
print "Running", inspect.stack()[0][3], "..." |
... | ... | |
261 | 296 |
|
262 | 297 |
# End test_pobyso_parse_string_sa_so |
263 | 298 |
|
299 |
def test_pobyso_rat_poly_sa_so(repeat=100, number=10): |
|
300 |
functionName = inspect.stack()[0][3] |
|
301 |
print "Running", functionName,"..." |
|
302 |
precisionsList = [12, 53, 163, 1024] |
|
303 |
i = var('i') |
|
304 |
P_QQ = QQ[i] |
|
305 |
pr = P_QQ(1/7 + 2/7*i + 3/7*i^2) |
|
306 |
def test(polynomial, precisionsList): |
|
307 |
for prec in precisionsList: |
|
308 |
polySo = pobyso_rat_poly_sa_so(polynomial, prec) |
|
309 |
sollya_lib_clear_obj(polySo) |
|
310 |
|
|
311 |
wrapped = test_pobyso_wrapper(test, |
|
312 |
pr, |
|
313 |
precisionsList) |
|
314 |
timing = min(timeit.repeat(wrapped, repeat=repeat, number=number)) |
|
315 |
print "\t...", functionName, "done." |
|
316 |
return timing |
|
317 |
# End test_pobyso_rat_poly_sa_so |
|
318 |
|
|
264 | 319 |
def test_pobyso_taylor_expansion_no_change_var_so_so(repeat=1000, number=10): |
265 | 320 |
functionName = inspect.stack()[0][3] |
266 | 321 |
print "Running", functionName, "..." |
Formats disponibles : Unified diff