Пример #1
0
 def cmp_elems(a, b):
     fa = abs(fixed_vertex_info[a[0]])
     fb = abs(fixed_vertex_info[b[0]])
     if (fa > fb): return -1
     if (fa < fb): return 1
     if (a[1] > b[1]): return -1
     if (a[1] < b[1]): return 1
     return cmp(a[0], b[0])
Пример #2
0
 def cmp_clusters(a, b):
     if (len(a) != 0 and len(b) != 0):
         fa = O.cluster_indices[a[0]] < len(O.fixed_vertex_lists)
         fb = O.cluster_indices[b[0]] < len(O.fixed_vertex_lists)
         if (fa):
             if (not fb): return -1
         else:
             if (fb): return 1
     if (len(a) > len(b)): return -1
     if (len(a) < len(b)): return 1
     if len(a): return cmp(a[0], b[0])
     return 0
Пример #3
0
def compare_cb_op_as_hkl(a, b):
    # Deprecated. Do not use.
    if (len(a) < len(b)): return -1
    if (len(a) > len(b)): return 1
    from libtbx.math_utils import cmp
    return cmp(a, b)
Пример #4
0
 def __cmp__(self, other) : # sort in descending order
   return cmp(self.overlap, other.overlap)
def match_sort_function(match_a, match_b):
    # Deprecated. Do not use
    from libtbx.math_utils import cmp
    i = -cmp(len(match_a.pairs), len(match_b.pairs))
    if (i): return i
    return cmp(match_a.rms, match_b.rms)
def pair_sort_function(pair_a, pair_b):
    # Deprecated. Do not use
    from libtbx.math_utils import cmp
    return cmp(pair_a[0], pair_b[0])
Пример #7
0
def compare_redundancies(a, b):
    # Deprecated. Do not use
    return cmp(len(b[1]), len(a[1]))