TVec.Shift Method

Overload List

#SignatureDescription
1TVec Shift(TMtxVec Src, Int32 Offset)Shift vector elements left or right in the array.
└ indexed: TMtxVec Shift(TMtxVec Vec, Int32 Offset, Int32 VecIndex, Int32 Index, Int32 Len)
2TVec Shift(Int32 Offset)Shift vector elements left or right in the array.
└ indexed: TMtxVec Shift(Int32 Offset, Int32 Index, Int32 Len)

Overload 1: TVec Shift(TMtxVec Src, Int32 Offset)

Shift vector elements left or right in the array.

#NameTypeDescription
1SrcTMtxVecsource TVec or TMtx
2OffsetInt32

Result: stored in self (calling object), returns self for chaining

Remarks:

Shifts Src vector elements and stores the result in the calling object. The number of elements to shift is specified in the Offset parameter. Offset can be any integer number, positive or negative.

See Also: TVec.Rotate

Indexed: TMtxVec Shift(TMtxVec Vec, Int32 Offset, Int32 VecIndex, Int32 Index, Int32 Len)

A shift on vector elements in range.

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2OffsetInt32
3VecIndexInt32
4IndexInt32start index
5LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

Performs 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.

Overload 2: TVec Shift(Int32 Offset)

Shift vector elements left or right in the array.

#NameTypeDescription
1OffsetInt32

Result: stored in self (calling object), returns self for chaining

Remarks:

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

Examples
TVec a;
MtxVec.CreateIt(out a);
try
    {
        a.SetIt(false,new double[] {1,-2,3,0});
        a.Shift(1); // a = 1,1,-2,3
    }
finally
    {
        MtxVec.FreeIt(ref a);
    }
See Also: TVec.Rotate

Indexed: TMtxVec Shift(Int32 Offset, Int32 Index, Int32 Len)

Shift vector elements in range.

#NameTypeDescription
1OffsetInt32
2IndexInt32start index
3LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

Shifts calling vector elements in specified range [Index..Index+Len]. The number of elements by which to shift is specified in the Offset parameter.

Offset can be any integer number, positive or negative.