@jit(nopython=True, cache=True)
def lex_min_ratio_test(tableau, pivot, slack_start, argmins):
 nrows = tableau.shape[0]
 num_candidates = nrows
 for i in range(nrows):
  argmins[i] = i
 num_argmins = min_ratio_test_no_tie_breaking(tableau, pivot, (-1), argmins, num_candidates)
 if (num_argmins == 1):
  return argmins[0]
 for j in range(slack_start, (slack_start + nrows)):
  if (j == pivot):
   continue
  num_argmins = min_ratio_test_no_tie_breaking(tableau, pivot, j, argmins, num_argmins)
  if (num_argmins == 1):
   break
 return argmins[0]

@ jit ( nopython = True , cache = True ) def lex_min_ratio_test ( tableau , pivot , slack_start , argmins ) : nrows = tableau . shape [ 0 ] num_candidates = nrows for i in range ( nrows ) : argmins [ i ] = i num_argmins = min_ratio_test_no_tie_breaking ( tableau , pivot , ( - 1 ) , argmins , num_candidates ) if ( num_argmins == 1 ) : return argmins [ 0 ] for j in range ( slack_start , ( slack_start + nrows ) ) : if ( j == pivot ) : continue num_argmins = min_ratio_test_no_tie_breaking ( tableau , pivot , j , argmins , num_argmins ) if ( num_argmins == 1 ) : break return argmins [ 0 ]
perform the lexico-minimum ratio test .