Révision 154 pobysoPythonSage/src/testPobyso.sage

testPobyso.sage (revision 154)
131 131
        precSa = pobyso_get_prec_of_constant_so_sa(constSo)
132 132
    wrapped = test_pobyso_wrapper(test)
133 133
    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
134
    print "\t...", functionName, "done."
134 135
    sollya_lib_clear_obj(constSo,None)
135
    print "\t...", functionName, "done."
136 136
    return timing
137
    sollya_lib_clear_obj(constSo)
138 137
# End test_pobyso_get_prec_of_constant_so_sa
139 138

  
140
def test_pobyso_guess_degree_so_sa(iterationsNum=10000):
141
    print "Running", inspect.stack()[0][3]
139
def test_pobyso_guess_degree_sa_sa(repeat=1000, number=10):
140
    functionName = inspect.stack()[0][3]
141
    print "Running", functionName, "..."
142
    funcExpSa(x) = exp(x)
143
    RRIF = RealIntervalField(113)
144
    intervalSa = RRIF(3/8 - 2^-68, 3/8 + 2^-68)
145
    print "Interval:", intervalSa.str(style='brackets')
146
    errorSa = RR(2^-227)
147
    weightSa(x) = 1
148
    degreeBoundSa = 150
149
    # Function definition
150
    def test():
151
        pobyso_guess_degree_sa_sa(funcExpSa, 
152
                                  intervalSa, 
153
                                  errorSa, 
154
                                  weightSa, 
155
                                  degreeBoundSa)
156
    wrapped = test_pobyso_wrapper(test)
157
    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
158
    print "\t...", functionName, "done."
159
    return timing
160
# End test_pobyso_guess_degree_sa_sa
161

  
162
def test_pobyso_guess_degree_so_sa(repeat=1000, number=10):
163
    functionName = inspect.stack()[0][3]
164
    print "Running", functionName, "..."
142 165
    funcExpSo = pobyso_parse_string_sa_so("exp(x)")
143 166
    RRIF = RealIntervalField(113)
144 167
    intervalSa = RRIF(3/8 - 2^-68, 3/8 + 2^-68)
145
    print ai.str(style='brackets')
168
    print "Interval:", intervalSa.str(style='brackets')
146 169
    intervalSo = pobyso_interval_to_range_sa_so(intervalSa)
147
    errorSo = pobyso_constant_sa_so(2^-227)
148
    # Compute the other arguments...
149
    for index in xrange(0,iterationsNum):
150
        pass
151
# End test_pobyso_guess_degree
170
    errorSo = pobyso_constant_sa_so(RR(2^-227))
171
    weightSo=pobyso_parse_string_sa_so("1")
172
    degreeBoundSo = pobyso_constant_from_int_sa_so(150)
173
    # Function definition
174
    def test():
175
        pobyso_guess_degree_so_sa(funcExpSo, 
176
                                  intervalSo, 
177
                                  errorSo, 
178
                                  weightSo, 
179
                                  degreeBoundSo)
180
    wrapped = test_pobyso_wrapper(test)
181
    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
182
    print "\t...", functionName, "done."
183
    sollya_lib_clear_obj(funcExpSo)
184
    sollya_lib_clear_obj(intervalSo)
185
    sollya_lib_clear_obj(errorSo)
186
    sollya_lib_clear_obj(weightSo)
187
    sollya_lib_clear_obj(degreeBoundSo)
188
    return timing
189
# End test_pobyso_guess_degree_so_sa
152 190

  
153 191
def test_pobyso_lib_init(iterationsNum=10000):
154 192
    """

Formats disponibles : Unified diff