<p>In <a href="https://github.com/mlpack/mlpack/pull/391#discussion_r23552980">src/mlpack/tests/sdp_primal_dual_test.cpp</a>:</p>
<pre style='color:#555'>> + SDP<arma::mat> sdp(g.NumVertices(), g.NumEdges() + 1, 0);
> + sdp.C().ones();
> + sdp.C() *= -1.;
> + sdp.SparseA()[0].eye(g.NumVertices(), g.NumVertices());
> + for (size_t i = 0; i < g.NumEdges(); i++)
> + {
> + sdp.SparseA()[i + 1].zeros(g.NumVertices(), g.NumVertices());
> + sdp.SparseA()[i + 1](g.Edges()(0, i), g.Edges()(1, i)) = 1.;
> + sdp.SparseA()[i + 1](g.Edges()(1, i), g.Edges()(0, i)) = 1.;
> + }
> + sdp.SparseB().zeros();
> + sdp.SparseB()[0] = 1.;
> + return sdp;
> +}
> +
> +// TODO(stephentu): does arma have a builtin way to do this?
</pre>
<p>Yes, I'm not sure why I didn't see that in the docs! Thanks</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/391/files#r23552980">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFOBe5dtamPU6wdQB0kkhvd54FZa-ks5nloGzgaJpZM4DVljE.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/391/files#r23552980"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>