[mlpack-git] [mlpack] Implementation of primal-dual interior point SDP solver (#391)
Stephen Tu
notifications at github.com
Mon Jan 26 13:40:51 EST 2015
> + 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?
Yes, I'm not sure why I didn't see that in the docs! Thanks
---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/391/files#r23552980
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150126/b0c77f46/attachment.html>
More information about the mlpack-git
mailing list