<p>In <a href="https://github.com/mlpack/mlpack/pull/374#discussion-diff-22746527">src/mlpack/methods/matrix_completion/matrix_completion_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +                                     const size_t n,
&gt; +                                     const size_t p)
&gt; +{
&gt; +  const size_t mpn = m + n;
&gt; +  float r = 0.5 + sqrt(0.25 + 2 * p);
&gt; +  if (ceil(r) &gt; mpn)
&gt; +    r = mpn; // An upper bound on the dimension.
&gt; +  return ceil(r);
&gt; +}
&gt; +
&gt; +arma::mat MatrixCompletion::CreateInitialPoint(const size_t m,
&gt; +                                               const size_t n,
&gt; +                                               const size_t r)
&gt; +{
&gt; +  const size_t mpn = m + n;
&gt; +  return arma::randu&lt;arma::mat&gt;(mpn, r);
</pre>
<p>Ok on inlining the call to <code>randu</code>. However, I don't see the benefit of templatizing the initialization strategy, when we have a constructor which takes in an initial point. I don't have a whole list of initialization strategies that I would think are significantly better than random. It might be a stylistic thing, but my initial reaction when coding C++ is to avoid throwing templates at the problem unless there is a clear benefit :)</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#r22746527">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFLu0avf5BcC5ZlcmKT4r5GN_I-lEks5ngEd-gaJpZM4DOLPX.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#r22746527"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>