Exemplo n.º 1
0
def dtw_between_two_testcases(width, height, iteration):
    ts_sum = 0
    tp_sum = 0
    for i in range(iteration):
        a = rand_test_case(width, height)
        b = rand_test_case(width, height)
        cs, ts = find_similarity_in_sequential(a,b,True)
        cp, tp =find_similarity_in_parallel(a,b,2,True)
        ts_sum += ts
        tp_sum += tp
    ts_avg = ts_sum / iteration
    tp_avg = tp_sum / iteration
    print
    print 'sequential: {0:.4f}'.format(ts_avg)
    print 'parallel: {0:.4f}'.format(tp_avg)
Exemplo n.º 2
0
def dtw_between_two_testcases(width, height, iteration):
    ts_sum = 0
    tp_sum = 0
    for i in range(iteration):
        a = rand_test_case(width, height)
        b = rand_test_case(width, height)
        cs, ts = find_similarity_in_sequential(a, b, True)
        cp, tp = find_similarity_in_parallel(a, b, 2, True)
        ts_sum += ts
        tp_sum += tp
    ts_avg = ts_sum / iteration
    tp_avg = tp_sum / iteration
    print
    print 'sequential: {0:.4f}'.format(ts_avg)
    print 'parallel: {0:.4f}'.format(tp_avg)
Exemplo n.º 3
0
def find_similarity(i):
    find_similarity_in_sequential(captured, predefined[i],False)
Exemplo n.º 4
0
def find_similarity(i):
    find_similarity_in_sequential(captured, predefined[i], False)