<p>In <a href="https://github.com/mlpack/mlpack/pull/694#discussion_r71879092">src/mlpack/core/data/imputation_methods/mean_imputation.hpp</a>:</p>
<pre style='color:#555'>> + {
> + output(target.first, target.second) = mean;
> + }
> + }
> +
> + /**
> + * Impute function searches through the input looking for mappedValue and
> + * replaces it with the mean of the given dimension. The result is overwritten
> + * to the input matrix.
> + *
> + * @param input Matrix that contains mappedValue.
> + * @param mappedValue Value that the user wants to get rid of.
> + * @param dimension Index of the dimension of the mappedValue.
> + * @param columnMajor State of whether the input matrix is columnMajor or not.
> + */
> + void Impute(arma::Mat<T>& input,
</pre>
<p>Thanks for the clarification. So, you mean you don't have to iterate over all dimension and you can avoid:</p>
<p><code><br>
output(row, col) = input(row, col);<br>
</code></p>
<p>in line 73? Do you think the self-assignment check is that inefficient?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<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/694/files/028c217057410e2e75691c32bf062202ce5dca3f#r71879092">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFKWCX5QkL2Pb5iiJyiz6BJXiiZ9tks5qYMdXgaJpZM4I07W-">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFFXj6SZd1ajDc31T2Z_pOW_Zijf6ks5qYMdXgaJpZM4I07W-.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/694/files/028c217057410e2e75691c32bf062202ce5dca3f#r71879092"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>