def METHOD_NAME(
    self, matrix: Union[spmatrix, BlockMatrix], raise_on_error: bool = True
) -> LinearSolverResults:
    if not isspmatrix_coo(matrix):
        matrix = matrix.tocoo()
    matrix = tril(matrix)
    nrows, ncols = matrix.shape
    if nrows != ncols:
        raise ValueError("Matrix must be square")
    self._dim = nrows
    stat = self._ma27.METHOD_NAME(
        dim=self._dim, irn=matrix.row, icn=matrix.col
    )
    res = LinearSolverResults()
    if stat == 0:
        res.status = LinearSolverStatus.successful
    else:
        if raise_on_error:
            raise RuntimeError(
                "Symbolic factorization was not successful; return code: "
                + str(stat)
            )
        if stat in {-3, -4}:
            res.status = LinearSolverStatus.not_enough_memory
        elif stat in {-5, 3}:
            res.status = LinearSolverStatus.singular
        else:
            res.status = LinearSolverStatus.error
    return res