Skip to content
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Ben Greiner <code@bnavigator.de>
  • Loading branch information
saasaa and bnavigator authored Sep 23, 2023
commit eb937648e45d0ca4a3cc0ea0d2e21438a904f1bc
8 changes: 4 additions & 4 deletions slycot/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import numpy as np


def mb02ed(typet: str,T: np.ndarray, B: np.ndarray, n: int, k: int, nrhs: int):
def mb02ed(typet: str, T: np.ndarray, B: np.ndarray, n: int, k: int, nrhs: int):
""" X, T = mb02ed(typet, T, B, n, k, nrhs)

Solve a system of linear equations T*X = B or X*T = B with a positive
Expand All @@ -39,10 +39,10 @@ def mb02ed(typet: str,T: np.ndarray, B: np.ndarray, n: int, k: int, nrhs: int):
and the system T*X = B is solved.
Note: the notation x / y means that x corresponds to
typet = 'R' and y corresponds to typet = 'C'.
Comment thread
saasaa marked this conversation as resolved.
T : ndarray
T : array_like
The leading k-by-n*k or n*k-by-k part of this array must contain the first
block row/column of an s.p.d. block Toeplitz matrix.
B : ndarray
B : array_like
The leading nrhs-by-n*k or n*k-by-nrhs part of this array must contain the
right-hand side matrix B.
n : int
Expand All @@ -66,7 +66,7 @@ def mb02ed(typet: str,T: np.ndarray, B: np.ndarray, n: int, k: int, nrhs: int):
------
SlycotArithmeticError
:info = 1:
the reduction algorithm failed. The Toeplitz matrix associated
The reduction algorithm failed. The Toeplitz matrix associated
with T is not numerically positive definite.
SlycotParameterError
:info = -1:
Expand Down
5 changes: 1 addition & 4 deletions slycot/tests/test_mb.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ def test_mb02ed_parameter_errors():
assert cm.value.info == -4



def test_mb02ed_matrix_error():
Comment thread
saasaa marked this conversation as resolved.
"""Test for a negative definite input matrix in MB02ED"""
n = 3
Expand Down Expand Up @@ -178,15 +177,13 @@ def test_mb02ed_matrix_error():
)

with pytest.raises(SlycotArithmeticError,
match = "\nthe reduction algorithm failed. "
match = "The reduction algorithm failed. "
"The Toeplitz matrix associated\nwith T "
r"is not numerically positive definite.") as cm:
mb02ed(T=T, B=B, n=n, k=k, typet=TYPET, nrhs=nrhs)
assert cm.value.info == 1




def test_mb03rd():
Comment thread
saasaa marked this conversation as resolved.
""" Test for Schur form reduction.

Expand Down