cotila  1.2.1
A compile time linear algebra system
All Classes Files Functions Variables Modules Pages

◆ rotate()

template<std::size_t N, typename T >
constexpr vector<T, N> cotila::rotate ( vector< T, N >  v,
int  n 
)
Parameters
van N-vector of type T
nthe amount to shift each element
Returns
an N-vector of type T $ \textbf{v} \gg n $ such that $ \left(\textbf{v} \gg n\right)_i = \textbf{v}_{(i + n)\ \textrm{mod}\ N} $

Rotates a vector by shifting its elements.