constructor with optional memory zeroing
This commit is contained in:
@@ -53,6 +53,9 @@ class podarray
|
||||
|
||||
arma_inline explicit podarray(const uword new_N);
|
||||
|
||||
template<bool do_zeros>
|
||||
inline explicit podarray(const uword new_N, const arma_initmode_indicator<do_zeros>&);
|
||||
|
||||
arma_inline explicit podarray(const eT* X, const uword new_N);
|
||||
|
||||
// template<typename T1>
|
||||
|
||||
@@ -94,6 +94,25 @@ podarray<eT>::podarray(const uword new_n_elem)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<bool do_zeros>
|
||||
inline
|
||||
podarray<eT>::podarray(const uword new_n_elem, const arma_initmode_indicator<do_zeros>&)
|
||||
: n_elem(new_n_elem)
|
||||
{
|
||||
arma_extra_debug_sigprint_this(this);
|
||||
|
||||
init_cold(new_n_elem);
|
||||
|
||||
if(do_zeros)
|
||||
{
|
||||
arma_extra_debug_print("podarray::constructor: zeroing memory");
|
||||
arrayops::fill_zeros(memptr(), n_elem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
arma_inline
|
||||
podarray<eT>::podarray(const eT* X, const uword new_n_elem)
|
||||
|
||||
Reference in New Issue
Block a user