[mlpack-git] master: SDP primal-dual: use a more numerically stable starting point (660aa77)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 22:16:10 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40
>---------------------------------------------------------------
commit 660aa77179b75713f60163840117fe011ec960b1
Author: Stephen Tu <tu.stephenl at gmail.com>
Date: Fri Feb 13 01:07:52 2015 -0800
SDP primal-dual: use a more numerically stable starting point
>---------------------------------------------------------------
660aa77179b75713f60163840117fe011ec960b1
src/mlpack/tests/sdp_primal_dual_test.cpp | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/mlpack/tests/sdp_primal_dual_test.cpp b/src/mlpack/tests/sdp_primal_dual_test.cpp
index 35651fb..e442535 100644
--- a/src/mlpack/tests/sdp_primal_dual_test.cpp
+++ b/src/mlpack/tests/sdp_primal_dual_test.cpp
@@ -240,10 +240,7 @@ static void SolveMaxCutPositiveSDP(const SDP<arma::sp_mat>& sdp)
ydense0.set_size(0);
// infeasible, but positive starting point
- X0.randu(sdp.N(), sdp.N());
- X0 *= X0.t();
- X0 += 0.01 * arma::eye<arma::mat>(sdp.N(), sdp.N());
-
+ X0 = arma::eye<arma::mat>(sdp.N(), sdp.N());
ysparse0 = arma::randu<arma::vec>(sdp.NumSparseConstraints());
Z0.eye(sdp.N(), sdp.N());
@@ -264,11 +261,12 @@ BOOST_AUTO_TEST_CASE(SmallMaxCutSdp)
UndirectedGraph g;
UndirectedGraph::ErdosRenyiRandomGraph(g, 10, 0.3, true);
sdp = ConstructMaxCutSDPFromGraph(g);
- SolveMaxCutFeasibleSDP(sdp);
// the following was resulting in non-positive Z0 matrices on some
// random instances.
- //SolveMaxCutPositiveSDP(sdp);
+ //SolveMaxCutFeasibleSDP(sdp);
+
+ SolveMaxCutPositiveSDP(sdp);
}
BOOST_AUTO_TEST_CASE(SmallLovaszThetaSdp)
More information about the mlpack-git
mailing list