Function vector_rotate (o2scl)

O2scl : Function List

template<class vec_t, class data_t>
void o2scl::vector_rotate(size_t n, vec_t &data, size_t k)

“Rotate” a vector so that the kth element is now the beginning

This is a generic template function which will work for any types data_t and vec_t for which

  • data_t has an operator=

  • vec_t::operator[] returns a reference to an object of type data_t

This function is used, for example, in o2scl::pinside.

Note

This function is not the same as a Givens rotation, which is typically referred to in BLAS routines as drot().