def _pivot_col(T, tol=1e-12, bland=False):
 ma = np.ma.masked_where((T[(-1), :(-1)] >= (- tol)), T[(-1), :(-1)], copy=False)
 if (ma.count() == 0):
  return (False, np.nan)
 if bland:
  return (True, np.where((ma.mask == False))[0][0])
 return (True, np.ma.where((ma == ma.min()))[0][0])

def _pivot_col ( T , tol = 1e-12 , bland = False ) : ma = np . ma . masked_where ( ( T [ ( - 1 ) , : ( - 1 ) ] >= ( - tol ) ) , T [ ( - 1 ) , : ( - 1 ) ] , copy = False ) if ( ma . count ( ) == 0 ) : return ( False , np . nan ) if bland : return ( True , np . where ( ( ma . mask == False ) ) [ 0 ] [ 0 ] ) return ( True , np . ma . where ( ( ma == ma . min ( ) ) ) [ 0 ] [ 0 ] )
given a linear programming simplex tableau .