clVector::Rotate Method

Overload List

#SignatureDescription
1TOpenCLMtxVec *Rotate(TOpenCLMtxVec *Vec, int Offset, int VecIndex, int Index, int Len = MtxVecEOA) const;A cyclic shift on vector elements in range.
2TOpenCLVector *Rotate(TOpenCLMtxVec *Src, int Offset) const;A cyclic shift on vector elements.

Overload 1: TOpenCLMtxVec *Rotate(TOpenCLMtxVec *Vec, int Offset, int VecIndex, int Index, int Len = MtxVecEOA) const;

A cyclic shift on vector elements in range.

#NameTypeDescription
1VecTOpenCLMtxVec *
2Offsetint
3VecIndexint
4Indexint
5Len = MtxVecEOAint
Remarks:

Performs cyclic shift on source vector elements in specified range [Index..Index+Len] and stores them to calling vector. The number of elements to shift is specified in the Offset parameter. Offset can be any integer number, positive or negative.

See Also: clVector::Reverse, clVector::Shift
Declared in Dew::Math::clVector · Dew.Math/clMtxExpr.h · Cross-compiler

Overload 2: TOpenCLVector *Rotate(TOpenCLMtxVec *Src, int Offset) const;

A cyclic shift on vector elements.

#NameTypeDescription
1SrcTOpenCLMtxVec *
2Offsetint
Remarks:

Performs cyclic shift on vector elements. The number of elements to shift is specified in the Offset parameter. Offset can be any integer number, positive or negative.

Examples
#include "clMtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    clVector a, b;

    a.CopyFromArray(DewArray<float>{1, 2, 3, 4});
    b.Rotate(a, 2);   // b = [3,4,1,2]
}
See Also: clVector::Reverse, clVector::Shift
Declared in Dew::Math::clVector · Dew.Math/clMtxExpr.h · Cross-compiler