def DM(elems, domain): conv = lambda e: domain.from_sympy(sympify(e)) elems = [[conv(e) for e in row] for row in elems] return DomainMatrix(elems, (len(elems), len(elems[0])), domain)
def _eval_row_del(self, row): self._rep = DomainMatrix.vstack(self._rep[:row, :], self._rep[row + 1:, :]) self.rows -= 1
def _eval_eye(cls, rows, cols): rep = DomainMatrix.eye((rows, cols), ZZ) return cls._fromrep(rep)
def _eval_col_del(self, col): self._rep = DomainMatrix.hstack(self._rep[:, :col], self._rep[:, col + 1:]) self.cols -= 1
def _eval_zeros(cls, rows, cols): rep = DomainMatrix.zeros((rows, cols), ZZ) return cls._fromrep(rep)