WrapSortScorer

class corsort.WrapSortScorer(scorer, sort, compute_history=False)[source]

Examples

>>> my_sort = SortQuick(compute_history=False)
>>> jit_sort = WrapSortScorer(scorer=jit_scorer_rho, sort=my_sort, compute_history=False)
>>> my_xs = np.array([4, 1, 7, 6, 0, 8, 2, 3, 5])
>>> jit_sort(my_xs).n_comparisons_
16
>>> jit_sort.__name__
'quicksort_rho'
>>> jit_sort.history_comparisons_  
[(1, 0), (0, 2), (0, 3), (4, 0), (0, 5), (6, 0), (7, 0), (0, 8),
(4, 1), (1, 6), (1, 7), (6, 7), (3, 2), (2, 5), (8, 2), (8, 3)]
>>> jit_sort.history_comparisons_values_  
[(1, 4), (4, 7), (4, 6), (0, 4), (4, 8), (2, 4), (3, 4), (4, 5),
(0, 1), (1, 2), (1, 3), (2, 3), (6, 7), (7, 8), (5, 7), (5, 6)]
property history_comparisons_values_

History of the pairwise comparisons, in terms of compared values. Tuple (x, y) means that items of values x and y were compared, and that x < y.

Type:

list of tuple