<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'>> + const size_t n,
> + const size_t p)
> +{
> + const size_t mpn = m + n;
> + float r = 0.5 + sqrt(0.25 + 2 * p);
> + if (ceil(r) > mpn)
> + r = mpn; // An upper bound on the dimension.
> + return ceil(r);
> +}
> +
> +arma::mat MatrixCompletion::CreateInitialPoint(const size_t m,
> + const size_t n,
> + const size_t r)
> +{
> + const size_t mpn = m + n;
> + return arma::randu<arma::mat>(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;">—<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>