@@ -13,6 +13,9 @@ function test_warm_start(FC)
1313 z0 = - 2 * ones (FC, n)
1414 d = - 10 * ones (FC, n)
1515
16+ # For relevant bipartite methods, it's also important to test asymmetric sizes
17+ A3x2, b3, c2, M3x3, N2x2 = small_sqd (false ; FC)
18+
1619 # BILQR
1720 @testset " bilqr" begin
1821 x, y, stats = bilqr (A, b, c, x0, y0)
@@ -51,6 +54,14 @@ function test_warm_start(FC)
5154 resid = norm (s) / norm (c)
5255 @test (resid ≤ tol)
5356
57+ x30, y20, _ = trilqr (A3x2, b3, c2)
58+ x3, y2, stats = trilqr (A3x2, b3, c2, x30, y20)
59+ @test_broken x3 ≈ x30 atol= 1e-12
60+ @test y2 ≈ y20 atol= 1e-12
61+ @test_broken stats. niter <= 1
62+ @test_throws " x0 should have size $(length (x30)) " trilqr (A3x2, b3, c2, [1.0 ], y20)
63+ @test_throws " y0 should have size $(length (y20)) " trilqr (A3x2, b3, c2, x30, [1.0 ])
64+
5465 workspace = TrilqrWorkspace (A, b)
5566 krylov_solve! (workspace, A, b, c, x0, y0)
5667 r = b - A * workspace. x
@@ -76,6 +87,13 @@ function test_warm_start(FC)
7687 resid = norm (r) / norm ([b; b])
7788 @test (resid ≤ tol)
7889
90+ x30, y20, _ = tricg (A3x2, b3, c2)
91+ x3, y2, stats = tricg (A3x2, b3, c2, x30, y20)
92+ @test x3 ≈ x30 atol= 1e-12
93+ @test y2 ≈ y20 atol= 1e-12
94+ @test stats. niter <= 1
95+ @test_throws " x0 should have size $(length (x30)) " tricg (A3x2, b3, c2, [1.0 ], y20)
96+ @test_throws " y0 should have size $(length (y20)) " tricg (A3x2, b3, c2, x30, [1.0 ])
7997 workspace = TricgWorkspace (A, b)
8098 krylov_solve! (workspace, A, b, b, x0, y0)
8199 r = [b - workspace. x - A * workspace. y; b - A' * workspace. x + workspace. y]
@@ -97,6 +115,13 @@ function test_warm_start(FC)
97115 resid = norm (r) / norm ([b; b])
98116 @test (resid ≤ tol)
99117
118+ x30, y20, _ = trimr (A3x2, b3, c2)
119+ x3, y2, stats = trimr (A3x2, b3, c2, x30, y20)
120+ @test x3 ≈ x30 atol= 1e-12
121+ @test y2 ≈ y20 atol= 1e-12
122+ @test stats. niter <= 1
123+ @test_throws " x0 should have size $(length (x30)) " trimr (A3x2, b3, c2, [1.0 ], y20)
124+ @test_throws " y0 should have size $(length (y20)) " trimr (A3x2, b3, c2, x30, [1.0 ])
100125 workspace = TrimrWorkspace (A, b)
101126 krylov_solve! (workspace, A, b, b, x0, y0)
102127 r = [b - workspace. x - A * workspace. y; b - A' * workspace. x + workspace. y]
@@ -118,6 +143,11 @@ function test_warm_start(FC)
118143 resid = norm (r) / norm ([b; b])
119144 @test (resid ≤ tol)
120145
146+ x30, y20, _ = gpmr (A3x2, A3x2' , b3, c2)
147+ x3, y2, stats = gpmr (A3x2, A3x2' , b3, c2, x30, y20)
148+ @test stats. niter <= 1
149+ @test_throws " x0 should have size $(length (x30)) " gpmr (A3x2, A3x2' , b3, c2, [1.0 ], y20)
150+ @test_throws " y0 should have size $(length (y20)) " gpmr (A3x2, A3x2' , b3, c2, x30, [1.0 ])
121151 workspace = GpmrWorkspace (A, b)
122152 krylov_solve! (workspace, A, A' , b, b, x0, y0)
123153 r = [b - workspace. x - A * workspace. y; b - A' * workspace. x - workspace. y]
0 commit comments