'Return a matrix containing the cofactor of each element.
See Also
cofactor
minor
minor_submatrix
adjugate'

def cofactor_matrix(self, method='berkowitz'):

    if ((self.rows != self.cols) or (self.rows < 1)):
        raise NonSquareMatrixError()
    return self._new(self.rows, self.cols, (lambda i, j: self.cofactor(i, j, method)))
