Classes | |
class | podarray< eT > |
A lightweight array for POD types. If the amount of memory requested is small, the stack is used. More... | |
Functions | |
podarray::~podarray () | |
podarray::podarray () | |
podarray::podarray (const podarray &x) | |
const podarray & | podarray::operator= (const podarray &x) |
arma_inline | podarray::podarray (const u32 new_N) |
arma_inline | podarray::podarray (const eT *X, const u32 new_N) |
arma_inline eT | podarray::operator[] (const u32 i) const |
arma_inline eT & | podarray::operator[] (const u32 i) |
arma_inline eT | podarray::operator() (const u32 i) const |
arma_inline eT & | podarray::operator() (const u32 i) |
void | podarray::set_size (const u32 new_n_elem) |
void | podarray::fill (const eT val) |
void | podarray::zeros () |
void | podarray::zeros (const u32 new_n_elem) |
arma_inline eT * | podarray::memptr () |
arma_inline const eT * | podarray::memptr () const |
void | podarray::init (const u32 new_n_elem) |
Definition at line 23 of file podarray_meat.hpp.
References arma_config::debug, podarray< eT >::mem, podarray< eT >::mem_local, podarray< eT >::n_elem, and access::rw().
00024 { 00025 arma_extra_debug_sigprint_this(this); 00026 00027 if(n_elem > sizeof(mem_local)/sizeof(eT) ) 00028 { 00029 delete [] mem; 00030 } 00031 00032 if(arma_config::debug == true) 00033 { 00034 access::rw(n_elem) = 0; 00035 access::rw(mem) = 0; 00036 } 00037 }
Definition at line 43 of file podarray_meat.hpp.
Definition at line 54 of file podarray_meat.hpp.
References podarray< eT >::operator=().
const podarray< eT > & podarray< eT >::operator= | ( | const podarray< eT > & | x | ) | [inline, inherited] |
Definition at line 68 of file podarray_meat.hpp.
References syslib::copy_elem(), podarray< eT >::init(), podarray< eT >::memptr(), and podarray< eT >::n_elem.
Referenced by podarray< eT >::podarray().
arma_inline podarray< eT >::podarray | ( | const u32 | new_N | ) | [inline, explicit, inherited] |
Definition at line 86 of file podarray_meat.hpp.
References podarray< eT >::init().
arma_inline podarray< eT >::podarray | ( | const eT * | X, | |
const u32 | new_N | |||
) | [inline, explicit, inherited] |
Definition at line 99 of file podarray_meat.hpp.
References syslib::copy_elem(), podarray< eT >::init(), and podarray< eT >::memptr().
00100 : n_elem(0) 00101 , mem (0) 00102 { 00103 arma_extra_debug_sigprint_this(this); 00104 00105 init(new_n_elem); 00106 00107 syslib::copy_elem( memptr(), X, new_n_elem ); 00108 }
arma_inline eT podarray< eT >::operator[] | ( | const u32 | i | ) | const [inline, inherited] |
Definition at line 115 of file podarray_meat.hpp.
References podarray< eT >::mem.
00116 { 00117 return mem[i]; 00118 }
arma_inline eT & podarray< eT >::operator[] | ( | const u32 | i | ) | [inline, inherited] |
Definition at line 125 of file podarray_meat.hpp.
References podarray< eT >::mem, and access::rw().
00126 { 00127 return access::rw(mem[i]); 00128 }
arma_inline eT podarray< eT >::operator() | ( | const u32 | i | ) | const [inline, inherited] |
Definition at line 135 of file podarray_meat.hpp.
References podarray< eT >::mem, and podarray< eT >::n_elem.
arma_inline eT & podarray< eT >::operator() | ( | const u32 | i | ) | [inline, inherited] |
Definition at line 146 of file podarray_meat.hpp.
References podarray< eT >::mem, podarray< eT >::n_elem, and access::rw().
00147 { 00148 arma_debug_check( (i >= n_elem), "podarray::operator(): index out of bounds"); 00149 return access::rw(mem[i]); 00150 }
Definition at line 157 of file podarray_meat.hpp.
References podarray< eT >::init().
Referenced by auxlib::inv_inplace(), auxlib::inv_noalias(), auxlib::lu(), auxlib::qr(), and auxlib::svd().
00158 { 00159 arma_extra_debug_sigprint(); 00160 00161 init(new_n_elem); 00162 }
void podarray< eT >::fill | ( | const eT | val | ) | [inline, inherited] |
Definition at line 169 of file podarray_meat.hpp.
References podarray< eT >::mem, podarray< eT >::n_elem, and access::rw().
Referenced by podarray< eT >::zeros().
00170 { 00171 arma_extra_debug_sigprint(); 00172 00173 for(u32 i=0; i<n_elem; ++i) 00174 { 00175 access::rw(mem[i]) = val; 00176 } 00177 }
void podarray< eT >::zeros | ( | ) | [inline, inherited] |
Definition at line 184 of file podarray_meat.hpp.
References podarray< eT >::fill().
00185 { 00186 arma_extra_debug_sigprint(); 00187 00188 fill(eT(0)); 00189 }
Definition at line 196 of file podarray_meat.hpp.
References podarray< eT >::fill(), and podarray< eT >::init().
arma_inline eT * podarray< eT >::memptr | ( | ) | [inline, inherited] |
Definition at line 209 of file podarray_meat.hpp.
References podarray< eT >::mem.
Referenced by op_var::apply(), op_stddev::apply(), op_sort::apply(), op_diagmat::apply(), gemm_mixed_cache< do_trans_A, do_trans_B, use_alpha, use_beta >::apply(), glue_times::apply_inplace(), auxlib::det(), op_var::direct_var(), auxlib::eig_gen(), auxlib::eig_sym(), auxlib::inv_inplace(), auxlib::inv_noalias(), diskio::load_pgm_binary(), diskio::load_ppm_binary(), auxlib::log_det(), auxlib::lu(), podarray< eT >::operator=(), podarray< eT >::podarray(), auxlib::qr(), auxlib::solve(), auxlib::solve_od(), auxlib::solve_ud(), and auxlib::svd().
00210 { 00211 return const_cast<eT*>(mem); 00212 }
arma_inline const eT * podarray< eT >::memptr | ( | ) | const [inline, inherited] |
Definition at line 219 of file podarray_meat.hpp.
References podarray< eT >::mem.
00220 { 00221 return mem; 00222 }
void podarray< eT >::init | ( | const u32 | new_n_elem | ) | [inline, protected, inherited] |
Definition at line 229 of file podarray_meat.hpp.
References podarray< eT >::mem, podarray< eT >::mem_local, podarray< eT >::n_elem, and access::rw().
Referenced by podarray< eT >::operator=(), podarray< eT >::podarray(), podarray< eT >::set_size(), and podarray< eT >::zeros().
00230 { 00231 arma_extra_debug_sigprint(); 00232 00233 if(n_elem == new_n_elem) 00234 { 00235 return; 00236 } 00237 00238 if(n_elem > sizeof(mem_local)/sizeof(eT) ) 00239 { 00240 delete [] mem; 00241 } 00242 00243 if(new_n_elem <= sizeof(mem_local)/sizeof(eT) ) 00244 { 00245 access::rw(mem) = mem_local; 00246 } 00247 else 00248 { 00249 access::rw(mem) = new eT[new_n_elem]; 00250 } 00251 00252 access::rw(n_elem) = new_n_elem; 00253 }