diff --git a/src/main/java/com/manyangled/gibbous/optim/convex/NewtonOptimizer.java b/src/main/java/com/manyangled/gibbous/optim/convex/NewtonOptimizer.java index 519e432..50ddaf6 100644 --- a/src/main/java/com/manyangled/gibbous/optim/convex/NewtonOptimizer.java +++ b/src/main/java/com/manyangled/gibbous/optim/convex/NewtonOptimizer.java @@ -42,7 +42,7 @@ */ public class NewtonOptimizer extends ConvexOptimizer { private LinearEqualityConstraint eqConstraint; - private KKTSolver kktSolver = new CholeskySchurKKTSolver(); + private KKTSolver kktSolver = new SVDSchurKKTSolver(); private RealVector xStart; private double epsilon = ConvergenceEpsilon.CONVERGENCE_EPSILON_DEFAULT; private double alpha = BacktrackAlpha.BACKTRACK_ALPHA_DEFAULT; diff --git a/src/test/java/com/manyangled/gibbous/KKTSolverTest.java b/src/test/java/com/manyangled/gibbous/KKTSolverTest.java index e5298dc..646d1c1 100644 --- a/src/test/java/com/manyangled/gibbous/KKTSolverTest.java +++ b/src/test/java/com/manyangled/gibbous/KKTSolverTest.java @@ -27,6 +27,7 @@ import com.manyangled.gibbous.optim.convex.KKTSolver; import com.manyangled.gibbous.optim.convex.KKTSolution; import com.manyangled.gibbous.optim.convex.CholeskySchurKKTSolver; +import com.manyangled.gibbous.optim.convex.SVDSchurKKTSolver; import static com.manyangled.gibbous.COTestingUtils.eps; @@ -82,6 +83,7 @@ public void testSchurConstrained1() { double[] g = { 1.0, 2.0 }; double[] h = { 3.0 }; testWithConstraints(new CholeskySchurKKTSolver(), H, A, g, h); + testWithConstraints(new SVDSchurKKTSolver(), H, A, g, h); } @Test @@ -94,6 +96,7 @@ public void testSchurConstrained2() { double[] g = { 1.0, 4.0, 9.0 }; double[] h = { 3.0, 7.0 }; testWithConstraints(new CholeskySchurKKTSolver(), H, A, g, h); + testWithConstraints(new SVDSchurKKTSolver(), H, A, g, h); } @Test @@ -101,6 +104,7 @@ public void testSchurUnconstrained1() { double[][] H = { { 5.0, 1.0 }, { 1.0, 5.0 } }; double[] g = { 3.0, 7.0 }; testNoConstraints(new CholeskySchurKKTSolver(), H, g); + testNoConstraints(new SVDSchurKKTSolver(), H, g); } @Test @@ -110,5 +114,6 @@ public void testSchurUnconstrained2() { { 1.0, 2.0, 7.0 } }; double[] g = { 9.0, 4.0, 1.0 }; testNoConstraints(new CholeskySchurKKTSolver(), H, g); + testNoConstraints(new SVDSchurKKTSolver(), H, g); } }