algorithm_functions.scale_matrix#

algorithm_functions.scale_matrix(matrix: ndarray, initial_trans_matrix: ndarray, C: ndarray) ndarray#

Scales a matrix.

The matrix is scaled so that row sums are equal to 1 while taking the elements that cannot be optimized (C=0) into account. These elements receive the value of the initial transition matrix.

Parameters:
  • matrix (np.ndarray) – The matrix that is scaled.

  • initial_trans_matrix (np.ndarray) – The initial transition matrix.

  • C (np.ndarray) – The binary adjustment matrix.

Returns:

np.ndarray – The scaled matrix.