<p>In <a href="https://github.com/mlpack/mlpack/pull/748#discussion_r73198805">src/mlpack/core/dists/gamma_distribution.cpp</a>:</p>
<pre style='color:#555'>&gt; +    Train(logMeanx, meanLogx, meanx, tol);
&gt; +
&gt; +    // The function above modifies the state of this object. Get the parameters
&gt; +    // it fit. (This is not very good design...).
&gt; +    tempAlpha(row) = alpha(0);
&gt; +    tempBeta(row) = beta(0);
&gt; +  }
&gt; +  alpha = tempAlpha;
&gt; +  beta = tempBeta;
&gt; +
&gt; +}
&gt; +
&gt; +// Fits an alpha and beta parameter to each dimension of the data.
&gt; +void GammaDistribution::Train(const double logMeanx, const double meanLogx,
&gt; +                              const double meanx,
&gt; +                              const double tol)
</pre>
<p>Hmm, do you think that instead of taking <code>const double</code>s here, we should take <code>const arma::vec&amp;</code>, and fit all dimensions at once? That would remove the need to call this overload multiple times in the <code>Train()</code> overload that takes data, and <code>tempAlpha</code> and <code>tempBeta</code> would be unnecessary in that method.</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, <a href="https://github.com/mlpack/mlpack/pull/748/files/09a90ee81a8ae3b69be94d8f84ff32794af2b7d6#r73198805">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFP1wFTO-iPVFgNbXIAl_LjGmOFffks5qb30fgaJpZM4Jaqw0">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFJwFXKXN_x4OF5cj_1HtfKzncOeYks5qb30fgaJpZM4Jaqw0.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/748/files/09a90ee81a8ae3b69be94d8f84ff32794af2b7d6#r73198805"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>