Normalize each row of the matrix that the sum of the row equals 1.

    :params matrix: a matrix (2d nested list) containing numbers, each isobaric
        channel must be present as a row.
    :returns: a matrix containing normalized values

def _normalizeImpurityMatrix(matrix):
    """Normalize each row of the matrix that the sum of the row equals 1.

    :params matrix: a matrix (2d nested list) containing numbers, each isobaric
        channel must be present as a row.
    :returns: a matrix containing normalized values
    """
    newMatrix = list()
    for line in matrix:
        total = sum(line)
        if total != 0:
            newMatrix.append([i / total for i in line])
        else:
            newMatrix.append(line)
    return newMatrix