Function vector_swap_openmp (o2scl)¶
-
template<class vec_t, class vec2_t, class data_t>
void o2scl::vector_swap_openmp(size_t N, vec_t &v1, vec2_t &v2)¶ Swap the first
N
elements of two vectors (with OpenMP)This function swaps the elements of
v1
andv2
, one element at a time.Note
This OpenMP swap is only faster for sufficiently large vectors (depending on the nature of the actual vector type).
-
template<class vec_t, class vec2_t, class data_t>
void o2scl::vector_swap_openmp(vec_t &v1, vec2_t &v2)¶ Swap all elements in two vectors (with OpenMP)
This function swaps the elements of
v1
andv2
, one element at a time.Note
It is better to use
std::swap
than this function. This function is provided for use in cases where one is using vector types which do not provide astd::swap
method.Note
This OpenMP swap is only faster for sufficiently large vectors (depending on the nature of the actual vector type).