Révision 120 pobysoPythonSage/src/testPobyso.sage

testPobyso.sage (revision 120)
66 66
    return timing
67 67
# End test_pobyso_bounds_to_range_sa_so
68 68

  
69
def test_pobyso_clear_taylorform_sa_so(repeat=1000, number=10):
70
    functionName =  inspect.stack()[0][3]
71
    print "Running", inspect.stack()[0][3], "..."
72
    intervalSa = RIF(1,2)
73
    functionSo = pobyso_parse_string("exp(x)")
74
    degreeSo   = pobyso_
75
    #RealIntervalField
76
    pointSo    = pobyso_constant_sa_so(RR("1.5"))
77
    intervalSo = pobyso_interval_to_range_sa_so(intervalSa)
78
    #
79
    def test(lowerBoundSa, upperBoundSa):
80
        taylorformSo = pobyso_taylorform_so_so(functionSo,
81
                                               degreeSo,
82
                                               pointSo,
83
                                               intervalSo)
84
        sollya_lib_clear_obj(rangeSo)
85
    #
86
    wrapped = test_pobyso_wrapper(test,lowerBoundSa, upperBoundSa)
87
    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
88
    #
89
    precSo = pobyso_get_prec_so()
90
    #pobyso_autoprint(precSo)
91
    sollya_lib_clear_obj(precSo)
92
    print "\t...", functionName, "done."
93
    return timing
94
# End test_pobyso_bounds_to_range_sa_so
95

  
69 96
def test_pobyso_get_list_elements_so_so(repeat = 1000, number=10):
70 97
    functionName = inspect.stack()[0][3]
71 98
    print "Running", functionName, "..."
......
85 112
    return timing
86 113
# End test_pobyso_get_list_elements    
87 114

  
88
def test_pobyso_get_prec_so_sa(iterationsNum=10000):
89
    print "Running", inspect.stack()[0][3]
90
    for index in xrange(0,iterationsNum):
115
def test_pobyso_get_prec_so_sa(repeat=1000, number=10):
116
    functionName = inspect.stack()[0][3]
117
    print "Running", functionName, "..."
118
    def test():
91 119
        precSa = pobyso_get_prec_so_sa()
120
    wrapped = test_pobyso_wrapper(test)
121
    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
122
    print "\t...", functionName, "done."
123
    return timing
92 124
# End test_pobyso_get_prec_so_sa  
93 125

  
94
def test_pobyso_get_prec_of_constant_so_sa(iterationsNum=10000):
95
    print "Running", inspect.stack()[0][3]
96
    constSo = pobyso_constant_from_int_sa_so(2)
97
    for index in xrange(0,iterationsNum):
126
def test_pobyso_get_prec_of_constant_so_sa(repeat=1000, number=10):
127
    functionName = inspect.stack()[0][3]
128
    print "Running", functionName, "..."
129
    constSo = pobyso_constant_1_sa_so()
130
    def test():
98 131
        precSa = pobyso_get_prec_of_constant_so_sa(constSo)
132
    wrapped = test_pobyso_wrapper(test)
133
    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
134
    sollya_lib_clear_obj(constSo,None)
135
    print "\t...", functionName, "done."
136
    return timing
99 137
    sollya_lib_clear_obj(constSo)
100 138
# End test_pobyso_get_prec_of_constant_so_sa
101 139

  
......
146 184
    return timing
147 185
# End test_pobyso_taylor_expansion_no_change_var_so_so
148 186

  
149
def test_pobyso_taylor_form_so_so_2(repeat=1000, number=10):
187
def test_pobyso_taylorform_so_so_2(repeat=1000, number=10):
150 188
    functionName = inspect.stack()[0][3]
151 189
    print "Running", functionName, "..."
152 190
    functionSo  = pobyso_parse_string('exp(x)')
......
182 220
    wrapped = test_pobyso_wrapper(test)
183 221
    timing = timeit.timeit(wrapped, number=executionsNum)
184 222
    return timing
185
print "\t...testPobyso loaded"
223
print "\t...testPobyso loaded"
224
print

Formats disponibles : Unified diff