KrisLibrary  1.0.0
Functions
shift.h File Reference

Cyclical shifts of array elements. More...

#include <vector>

Go to the source code of this file.

Functions

template<class T >
void ShiftForward (T &a, T &b, T &c)
 Shift forward: set a'=c,b'=a,c'=b.
 
template<class T >
void ShiftBackward (T &a, T &b, T &c)
 Shift backward: set a'=b,b'=c,c'=a.
 
template<class T >
void ShiftForward (std::vector< T > &v)
 For all i, v'[i] = v[i-1], v'[0] = v[n-1].
 
template<class T >
void ShiftBackward (std::vector< T > &v)
 For all i, v'[i] = v[i+1], v'[n-1] = v[0].
 

Detailed Description

Cyclical shifts of array elements.