Example #1
0
    def __init__(self, matrix):
        """ Constructs a reduced row echelon form matrix from a given input """

        assert isinstance(matrix, Matrix)

        Matrix.__init__(self, matrix.rows, matrix.cols)
        self.set(matrix)
        self._pivots = inplace_gauss_elimination(self)

        self._original = matrix
        self._pivot_columns = [column for row, column in self._pivots]
        self._free_columns = [
            i for i in range(0, matrix.cols) if i not in self._pivot_columns
        ]
Example #2
0
	def __init__(self):
		Matrix.__init__(self, 9, 9)