diff --git a/include/armadillo_bits/op_diff_meat.hpp b/include/armadillo_bits/op_diff_meat.hpp index 734235d8..65143dee 100644 --- a/include/armadillo_bits/op_diff_meat.hpp +++ b/include/armadillo_bits/op_diff_meat.hpp @@ -27,6 +27,8 @@ op_diff::apply_noalias(Mat& out, const Mat& X, const uword k, const uwor { arma_debug_sigprint(); + if(k == 0) { out = X; return; } + uword n_rows = X.n_rows; uword n_cols = X.n_cols; @@ -167,8 +169,6 @@ op_diff::apply(Mat& out, const Op& in) arma_conform_check( (dim > 1), "diff(): parameter 'dim' must be 0 or 1" ); - if(k == 0) { out = in.m; return; } - const quasi_unwrap U(in.m); if(U.is_alias(out)) @@ -199,8 +199,6 @@ op_diff::apply(Mat_noalias& out, const Op& i arma_conform_check( (dim > 1), "diff(): parameter 'dim' must be 0 or 1" ); - if(k == 0) { out = in.m; return; } - const quasi_unwrap U(in.m); op_diff::apply_noalias(out, U.M, k, dim); @@ -223,8 +221,6 @@ op_diff_vec::apply(Mat& out, const Op& i const uword k = in.aux_uword_a; - if(k == 0) { out = in.m; return; } - const quasi_unwrap U(in.m); const uword dim = (T1::is_xvec) ? uword(U.M.is_rowvec() ? 1 : 0) : uword((T1::is_row) ? 1 : 0);