@jit(nopython=True, cache=True)
def pivoting(tableau, pivot, pivot_row):
 (nrows, ncols) = tableau.shape
 pivot_elt = tableau[(pivot_row, pivot)]
 for j in range(ncols):
  tableau[(pivot_row, j)] /= pivot_elt
 for i in range(nrows):
  if (i == pivot_row):
   continue
  multiplier = tableau[(i, pivot)]
  if (multiplier == 0):
   continue
  for j in range(ncols):
   tableau[(i, j)] -= (tableau[(pivot_row, j)] * multiplier)
 return tableau

@ jit ( nopython = True , cache = True ) def pivoting ( tableau , pivot , pivot_row ) : ( nrows , ncols ) = tableau . shape pivot_elt = tableau [ ( pivot_row , pivot ) ] for j in range ( ncols ) : tableau [ ( pivot_row , j ) ] /= pivot_elt for i in range ( nrows ) : if ( i == pivot_row ) : continue multiplier = tableau [ ( i , pivot ) ] if ( multiplier == 0 ) : continue for j in range ( ncols ) : tableau [ ( i , j ) ] -= ( tableau [ ( pivot_row , j ) ] * multiplier ) return tableau
perform a pivoting step .