[mlpack-svn] r11665 - mlpack/trunk/src/mlpack/tests
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Feb 29 16:30:32 EST 2012
Author: rcurtin
Date: 2012-02-29 16:30:31 -0500 (Wed, 29 Feb 2012)
New Revision: 11665
Modified:
mlpack/trunk/src/mlpack/tests/lrsdp_test.cpp
Log:
Changes according to the changes in the LRSDP API.
Modified: mlpack/trunk/src/mlpack/tests/lrsdp_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/lrsdp_test.cpp 2012-02-29 21:29:56 UTC (rev 11664)
+++ mlpack/trunk/src/mlpack/tests/lrsdp_test.cpp 2012-02-29 21:30:31 UTC (rev 11665)
@@ -66,23 +66,26 @@
// All of the matrices will just contain coordinates because they are
// super-sparse (two entries each). Except for A_0, which is I_n.
- lovasz.AModes().ones(edges.n_cols);
+ lovasz.AModes().ones();
lovasz.AModes()[0] = 0;
// A_0 = I_n.
- lovasz.A().push_back(arma::eye<arma::mat>(vertices, vertices));
+ lovasz.A()[0].eye(vertices, vertices);
// A_ij only has ones at (i, j) and (j, i) and 1 elsewhere.
for (size_t i = 0; i < edges.n_cols; ++i)
{
- arma::mat a(2, 2);
+ arma::mat a(3, 2);
a(0, 0) = edges(0, i);
a(1, 0) = edges(1, i);
+ a(2, 0) = 1;
+
a(0, 1) = edges(1, i);
a(1, 1) = edges(0, i);
+ a(2, 1) = 1;
- lovasz.A().push_back(a);
+ lovasz.A()[i + 1] = a;
}
// Set the Lagrange multipliers right.
@@ -106,7 +109,7 @@
createLovaszThetaInitialPoint(edges, coordinates);
- LRSDP lovasz(edges.n_cols, coordinates);
+ LRSDP lovasz(edges.n_cols + 1, coordinates);
setupLovaszTheta(edges, lovasz);
More information about the mlpack-svn
mailing list