<blockquote>
<p>Why provide N2Bar()? The SDP class doesn't actually use it.</p>
</blockquote>

<p>It is used by <code>PrimalDualSolver::Optimize</code></p>

<blockquote>
<p>I don't know that I agree with storing both a sparse and dense objective. I'd actually lean towards templatizing SDP so you get SDP or something. This will accelerate code in the solver because you won't have to check if there is a sparse or dense objective. (A smart compiler could actually figure that out at compile time fairly easily, but I'm not sure that gcc actually will.)</p>
</blockquote>

<p>I'm starting to agree with this, after having written the solver to deal with both. I don't think I've seen a situation yet where we needed both. I think I'll go ahead and template it out. </p>

<blockquote>
<p>Optimize() returns a std::pair. The bool is the success indicator and the double is the objective. Other optimizers just return the final objective, though. It seems like false is only returned when the solver does not converge in the specified number of iterations. I'm not sure any higher-level code will ever use that information, though, so I don't know how useful it is to return both a bool and a double as opposed to just the objective value.</p>
</blockquote>

<p>Honestly, I wrote this for the tests. Basically, since the primal dual method here is unique in that it is able to certify its own optimality, I wanted the test cases to be able to have access to this information. What API would you prefer for communicating this? I'd like to avoid having to write the KKT conditions out for each test case. We could write a free function (something like <code>CheckKKT</code>) locally for the test cases. </p>

<blockquote>
<p>line 203: rd = - sz - Asparse.t() * ...: is that a typo? It's odd to see a negative sign separated from the argument like that, so I just wanted to check.</p>
</blockquote>

<p>It's not a typo, but this weirdness will go away once I templatize. </p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/387#issuecomment-70926232">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFN3vKzMINfmwwPbWFF5OoaJfWnlaks5nkBLZgaJpZM4DTlFe.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/issues/387#issuecomment-70926232"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>