示例#1
0
def test_dense(n, m, with_E, trans, lyap_solver):
    _check_availability(lyap_solver)

    np.random.seed(0)
    A = np.random.randn(n, n)
    E = np.eye(n) + np.random.randn(n, n) / n if with_E else None
    B = np.random.randn(n, m)
    if trans:
        B = B.T

    X = solve_lyap_dense(A, E, B, trans=trans, options=lyap_solver)

    assert relative_residual(A, E, B, X, trans=trans) < 1e-10
示例#2
0
文件: lyapunov.py 项目: pymor/pymor
def test_dense(n, m, with_E, trans, lyap_solver):
    _check_availability(lyap_solver)

    np.random.seed(0)
    A = np.random.randn(n, n)
    E = np.eye(n) + np.random.randn(n, n) / n if with_E else None
    B = np.random.randn(n, m)
    if trans:
        B = B.T

    X = solve_lyap_dense(A, E, B, trans=trans, options=lyap_solver)

    assert relative_residual(A, E, B, X, trans=trans) < 1e-10