use arma_config::zero_init

This commit is contained in:
conrad
2022-04-19 14:51:48 +10:00
parent c83fb3c635
commit a0142265dd
+4 -8
View File
@@ -51,12 +51,11 @@ Col<eT>::Col(const uword in_n_elem)
{
arma_extra_debug_sigprint();
#if (!defined(ARMA_DONT_ZERO_INIT))
if(arma_config::zero_init)
{
arma_extra_debug_print("Col::constructor: zeroing memory");
arrayops::fill_zeros(Mat<eT>::memptr(), Mat<eT>::n_elem);
}
#endif
}
@@ -70,12 +69,11 @@ Col<eT>::Col(const uword in_n_rows, const uword in_n_cols)
Mat<eT>::init_warm(in_n_rows, in_n_cols);
#if (!defined(ARMA_DONT_ZERO_INIT))
if(arma_config::zero_init)
{
arma_extra_debug_print("Col::constructor: zeroing memory");
arrayops::fill_zeros(Mat<eT>::memptr(), Mat<eT>::n_elem);
}
#endif
}
@@ -89,12 +87,11 @@ Col<eT>::Col(const SizeMat& s)
Mat<eT>::init_warm(s.n_rows, s.n_cols);
#if (!defined(ARMA_DONT_ZERO_INIT))
if(arma_config::zero_init)
{
arma_extra_debug_print("Col::constructor: zeroing memory");
arrayops::fill_zeros(Mat<eT>::memptr(), Mat<eT>::n_elem);
}
#endif
}
@@ -1236,7 +1233,7 @@ Col<eT>::fixed<fixed_n_elem>::fixed()
{
arma_extra_debug_sigprint_this(this);
#if (!defined(ARMA_DONT_ZERO_INIT))
if(arma_config::zero_init)
{
arma_extra_debug_print("Col::fixed::constructor: zeroing memory");
@@ -1244,7 +1241,6 @@ Col<eT>::fixed<fixed_n_elem>::fixed()
arrayops::inplace_set_fixed<eT,fixed_n_elem>( mem_use, eT(0) );
}
#endif
}