class_docstr: State of one execution of the Hungarian algorithm.
  
  Parameters
  ----------
  cost_matrix : 2D matrix
      The cost matrix. Does not have to be square.
class_docstr_tok: ["State","of","one","execution","of","the","Hungarian","algorithm",".","Parameters","--","--","--","--","--","cost_matrix",":","2D","matrix","The","cost","matrix",".","Does","not","have","to","be","square","."]
code: def __init__(self, cost_matrix):
      cost_matrix = np.atleast_2d(cost_matrix)
  
      # If there are more rows (n) than columns (m), then the algorithm
      # will not be able to work correctly. Therefore, we
      # transpose the cost function when needed. Just have to
      # remember to swap the result columns back later.
      transposed = cost_matrix.shape[1] < cost_matrix.shape[0]
      if transposed:
          self.C = (cost_matrix.T).copy()
      else:
          self.C = cost_matrix.copy()
      self.transposed = transposed
  
      # At this point, m >= n.
      n, m = self.C.shape
      self.row_uncovered = np.ones(n, dtype=np.bool)
      self.col_uncovered = np.ones(m, dtype=np.bool)
      self.Z0_r = 0
      self.Z0_c = 0
      self.path = np.zeros((n + m, 2), dtype=int)
      self.marked = np.zeros((n, m), dtype=int)
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/utils/linear_assignment_.py
imports: import numpy
  from .fixes import astype
label_desc: Use image node_id 1 to create a new _HungarianState object from inherited base classes: object with example: obj = _HungarianState(cost_matrix)