def _test_copy_vector(x): # use fff y0 = fb.copy_vector(x, 0) # use numpy y1 = fb.copy_vector(x, 1) yield assert_equal, y0, x yield assert_equal, y1, x
def time_copy_vector(x): t0 = time.clock() y0 = fb.copy_vector(x, 0) dt0 = time.clock()-t0 t1 = time.clock() y1 = fb.copy_vector(x, 1) dt1 = time.clock()-t1 ratio = time_ratio(dt0,dt1) print(' using fff_array: %f sec' % dt0) print(' using numpy C API: %f sec' % dt1) print(' ratio: %f' % ratio)