zero memory by default

This commit is contained in:
conrad
2021-04-30 17:13:56 +10:00
parent aeb1b18d55
commit b42e48120a
3 changed files with 18 additions and 0 deletions
+6
View File
@@ -1177,6 +1177,12 @@ Col<eT>::fixed<fixed_n_elem>::fixed()
: Col<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat<eT>::mem_local) )
{
arma_extra_debug_sigprint_this(this);
arma_extra_debug_print("Col::fixed::constructor: zeroing memory");
eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat<eT>::mem_local[0]);
arrayops::inplace_set_fixed<eT,fixed_n_elem>( mem_use, eT(0) );
}
+6
View File
@@ -9040,6 +9040,12 @@ Mat<eT>::fixed<fixed_n_rows, fixed_n_cols>::fixed()
: Mat<eT>( arma_fixed_indicator(), fixed_n_rows, fixed_n_cols, 0, ((use_extra) ? mem_local_extra : Mat<eT>::mem_local) )
{
arma_extra_debug_sigprint_this(this);
arma_extra_debug_print("Mat::fixed::constructor: zeroing memory");
eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(mem_local[0]);
arrayops::inplace_set_fixed<eT,fixed_n_elem>( mem_use, eT(0) );
}
+6
View File
@@ -1177,6 +1177,12 @@ Row<eT>::fixed<fixed_n_elem>::fixed()
: Row<eT>( arma_fixed_indicator(), fixed_n_elem, ((use_extra) ? mem_local_extra : Mat<eT>::mem_local) )
{
arma_extra_debug_sigprint_this(this);
arma_extra_debug_print("Row::fixed::constructor: zeroing memory");
eT* mem_use = (use_extra) ? &(mem_local_extra[0]) : &(Mat<eT>::mem_local[0]);
arrayops::inplace_set_fixed<eT,fixed_n_elem>( mem_use, eT(0) );
}