<p>In <a href="https://github.com/mlpack/mlpack/pull/457#discussion_r40674816">src/mlpack/methods/softmax_regression/softmax_regression_function.hpp</a>:</p>
<pre style='color:#555'>&gt; @@ -38,12 +37,25 @@ class SoftmaxRegressionFunction
&gt;    const arma::mat InitializeWeights();
&gt;  
&gt;    /**
&gt; +   * Initialize Softmax Regression weights(trainable parameters) with
&gt; +   * the given parameters.
&gt; +   * @param featureSize The features size of the training set
&gt; +   * @param numClasses Number of classes for classification.
&gt; +   * @param fitIntercept Intercept term flag.
&gt; +   * @return weights after initialize
&gt; +   */
&gt; +  static const arma::mat InitializeWeights(const size_t featureSize,
&gt; +                                           const size_t numClasses,
&gt; +                                           const bool fitIntercept = false);
</pre>
<p>Ah, I can not find any information about rvalue reference being used by Armadillo.</p>

<p>This function do not looks like performance critical part, but the optimization(pass by reference) is quite easy to do.<br>
I like the api of return value more since it do not have any site effect, but pass by reference may get better performance in this case. Maybe provide both of them?</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/457/files#r40674816">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFEMnak7M5ydl7uGWFesiLIua8NE6ks5o2pIcgaJpZM4GFbCy.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/457/files#r40674816"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>