Function matrix_copy_openmp (o2scl)¶
-
template<class mat_t, class mat2_t>
void o2scl::matrix_copy_openmp(mat_t &src, mat2_t &dest)¶ Simple matrix copy (with OpenMP)
Copy
srctodest, resizingdestonly if either of the two dimensions are too small.This function will work for any classes
mat_tandmat2_twhich have suitably definedoperator(),size(), andresize()methods.Note
This OpenMP copy is only faster for sufficiently large matrices (depending on the nature of the actual vector type).
-
template<class mat_t, class mat2_t>
void o2scl::matrix_copy_openmp(size_t M, size_t N, mat_t &src, mat2_t &dest)¶ Simple matrix copy of the first \( (M,N) \) matrix elements (with OpenMP)
Copy the first
(M,N)elements ofsrctodest. It is assumed that the memory allocation fordesthas already been performed.This function will work for any class
vec2_twhich has an operator[][] which returns a reference to the corresponding element and classvec_twith an operator[][] which returns either a reference or the value of the corresponding element.Note
This OpenMP copy is only faster for sufficiently large matrices (depending on the nature of the actual vector type).