<p>In <a href="https://github.com/mlpack/mlpack/pull/374#discussion-diff-22745947">src/mlpack/methods/matrix_completion/matrix_completion.hpp</a>:</p>
<pre style='color:#555'>&gt; +   * Construct a matrix completion problem, specifying the maximum rank of the
&gt; +   * solution.
&gt; +   *
&gt; +   * @param m Number of rows of original matrix.
&gt; +   * @param n Number of columns of original matrix.
&gt; +   * @param indices Matrix containing the indices of the known entries (must be
&gt; +   *    [2 x p]).
&gt; +   * @param values Vector containing the values of the known entries (must be
&gt; +   *    length p).
&gt; +   * @param r Maximum rank of solution.
&gt; +   */
&gt; +  MatrixCompletion(const size_t m,
&gt; +                   const size_t n,
&gt; +                   const arma::umat&amp; indices,
&gt; +                   const arma::vec&amp; values,
&gt; +                   const size_t r);
</pre>
<p>I like the idea of <code>arma::sp_mat</code>. However, it does leave open the following ambiguity: what if i want a particular entry (i, j) to be zero? How do i distinguish this from the case where I don't know the value of entry (i, j). The only way seems to be to force us to break the abstraction of a sparse matrix. Sure, I could say something like <code>X(i, j) = 0</code> explicitly, but what if the particular setter implementation does <code>if (value == 0) return;</code>?</p>

<p>Alternatively, you could have the semantic that the <code>sp_mat</code> constructor doesn't the constraint that a particular entry is zero, but then you push the burden onto API callers to determine if this is the case for their data. </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/pull/374/files#r22745947">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFHNM6UsLieew-H7M4xUiO3Y2pqzfks5ngEVQgaJpZM4DOLPX.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/374/files#r22745947"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>