Example #1
0
def slow_threshold_search(results, fps, threshold, query_start, query_end,
                          target_start, target_end):
    N = len(fps)
    query_end = min(N, query_end)
    target_end = min(N, target_end)

    for row in range(query_start, query_end):
        row_fp = fps[row][1]
        for col in range(max(row + 1, target_start), target_end):
            col_fp = fps[col][1]
            score = bitops.byte_tanimoto(row_fp, col_fp)
            if score >= threshold:
                if row != col:
                    #print row, col, "X"
                    results[row].append((col, score))
Example #2
0
def slow_counts(counts, fps, threshold, query_start, query_end, target_start,
                target_end):
    N = len(fps)
    query_end = min(N, query_end)
    target_end = min(N, target_end)

    for row in range(query_start, query_end):
        row_fp = fps[row][1]
        for col in range(max(row + 1, target_start), target_end):
            col_fp = fps[col][1]
            if bitops.byte_tanimoto(row_fp, col_fp) >= threshold:
                if row != col:
                    #print row, col, "X"
                    counts[row] += 1
                    counts[col] += 1
def slow_threshold_search(results, fps, threshold,
                          query_start, query_end,
                          target_start, target_end):
    N = len(fps)
    query_end = min(N, query_end)
    target_end = min(N, target_end)
    
    for row in range(query_start, query_end):
        row_fp = fps[row][1]
        for col in range(max(row+1, target_start), target_end):
            col_fp = fps[col][1]
            score = bitops.byte_tanimoto(row_fp, col_fp)
            if score >= threshold:
                if row != col:
                    #print row, col, "X"
                    results[row].append((col, score))
def slow_counts(counts, fps, threshold,
                query_start, query_end,
                target_start, target_end):
    N = len(fps)
    query_end = min(N, query_end)
    target_end = min(N, target_end)

    for row in range(query_start, query_end):
        row_fp = fps[row][1]
        for col in range(max(row+1, target_start), target_end):
            col_fp = fps[col][1]
            if bitops.byte_tanimoto(row_fp, col_fp) >= threshold:
                if row != col:
                    #print row, col, "X"
                    counts[row] += 1
                    counts[col] += 1