コード例 #1
0
ファイル: execute.py プロジェクト: srzmldl/c1_compiler
def matrix_gen_test(func1,func2,distance):
    matrix = []
    block_index = []
    block_column = []
    print func1.getseq()
    engine_x = st.resort_block(func1.getseq(),func1)
    engine_y = st.resort_block(func2.getseq(),func2)
    print engine_x

    for block1 in func1.getblocks():
        block_index.append(block1.get_label())

    for block2 in func2.getblocks():
        block_column.append(block2.get_label())

    for block1 in engine_x:
        line = []
        for block2 in engine_y:
            line.append(distance(block1,block2))
        matrix.append(line)

    #print_matrix(matrix)


    #al.build_matrix_df(matrix,block_index,block_column)
    simi_mat = ex.public_sequence(matrix,func1.getseq(),func2.getseq(),cf.min_seq_length,cf.threshhold,cf.max_gap_length)

    li = []
    for item in matrix:
        li.append(max(item))

    i = len(matrix)
    j = len(matrix[0])

    visual.draw_matrix(matrix,i,j,max(li),simi_mat)
コード例 #2
0
ファイル: execute.py プロジェクト: srzmldl/c1_compiler
def matrix_gen(func1,func2,distance):
    matrix = []
    block_index = []
    block_column = []
    for block1 in func1.getblocks():
        block_index.append(block1.get_label())

    for block2 in func2.getblocks():
        block_column.append(block2.get_label())

    for block1 in func1.getblocks():
        line = []
        for block2 in func2.getblocks():
            line.append(distance(block1.get_list(),block2.get_list()))
        matrix.append(line)

    #print_matrix(matrix)


    #al.build_matrix_df(matrix,block_index,block_column)
    simi_mat = ex.public_sequence(matrix,block_index,block_column,4,0.33,1)

    li = []
    for item in matrix:
        li.append(max(item))

    i = len(matrix)
    j = len(matrix[0])

    visual.draw_matrix(matrix,i,j,max(li),simi_mat)