Maybe memcpy could accelerate your function or you could use the stl-function rotate...
I didnt test this code. Tell me if it works or not!Code:void Roatate( std::vector<float> &v, int shift ) { typedef std::vector<float>::iterator Iter; Iter begin, end, middel; begin = v.begin(); end = v.end(); if( abs(shift) >= v.size() ) shift = v.size()-1; if( shift<0 ) middel = begin+shift; else middle = end-shift; rotate( begin, middel, end ); }
Hope i could help you...
cu




Reply With Quote