From 1db52d211da18aff644d2cfd34595b97dc90d4e5 Mon Sep 17 00:00:00 2001 From: andreasvarga Date: Mon, 23 Nov 2020 11:23:00 +0100 Subject: [PATCH] Tuning coverage. --- test/test_cplyap.jl | 8 ++++++++ test/test_dplyap.jl | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/test/test_cplyap.jl b/test/test_cplyap.jl index 4c71a86..c3eafeb 100644 --- a/test/test_cplyap.jl +++ b/test/test_cplyap.jl @@ -197,6 +197,14 @@ X = U*U'; @test norm(A*X*E'+E*X*A'+R*R')/max(1,norm(X))/norm(A) < reltol && norm(A*U-E*U*β)/max(1,norm(U))/norm(A) < reltol && norm(E*U*α - R)/max(1,norm(R)) < reltol +U = copy(R) +Q = qr(rand(2,2)).Q; A1 = Q*A; E1 = Q*E; +β, α = MatrixEquations.pglyap2!(A1, E1, U, adj = false, disc = false) +X = U*U'; @test norm(A1*X*E1'+E1*X*A1'+R*R')/max(1,norm(X))/norm(A) < reltol && + norm(A1*U-E1*U*β)/max(1,norm(U))/norm(A) < reltol && + norm(E1*U*α - R)/max(1,norm(R)) < reltol + + U = copy(0*R) β, α = MatrixEquations.pglyap2!(A, E, U, adj = false, disc = false) X = U*U'; @test norm(A*X*E'+E*X*A')/max(1,norm(X))/norm(A) < reltol && diff --git a/test/test_dplyap.jl b/test/test_dplyap.jl index 1214fc0..d6b4c57 100644 --- a/test/test_dplyap.jl +++ b/test/test_dplyap.jl @@ -191,6 +191,13 @@ X = U*U'; @test norm(A*X*A'-E*X*E'+R*R')/max(1,norm(X))/norm(A) < reltol && norm(A*U-E*U*β)/max(1,norm(U))/norm(A) < reltol && norm(E*U*α - R)/max(1,norm(R)) < reltol +U = copy(R) +Q = qr(rand(2,2)).Q; A1 = Q*A; E1 = Q*E; +β, α = MatrixEquations.pglyap2!(A1, E1, U, adj = false, disc = true) +X = U*U'; @test norm(A1*X*A1'-E1*X*E1'+R*R')/max(1,norm(X))/norm(A) < reltol && + norm(A1*U-E1*U*β)/max(1,norm(U))/norm(A) < reltol && + norm(E1*U*α - R)/max(1,norm(R)) < reltol + U = copy(0*R) β, α = MatrixEquations.pglyap2!(A, E, U, adj = false, disc = true) X = U*U'; @test norm(A*X*E'+E*X*A')/max(1,norm(X))/norm(A) < reltol &&