<p>Upon further thought, I do think there is an important reason to handle classes of constraints differently, as in the template approach: the optimal order of the calculations depends on the type of the constraint. When computing <code>L = 2*S*R</code>, with dense constraints you want to sum <code>S</code> first then multiply <code>S*R</code> (as is done currently), while with rank-1 constraints you compute each <code>a a^T R</code> efficiently and then sum.</p>

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