VectorInt::Reverse Method

Overload List

#SignatureDescription
1TVecInt *Reverse() const;Reverse vector elements.
2TVecInt *Reverse(TMtxVecInt *Vec) const;Reverse all Vec elements.
3TMtxVecInt *Reverse(TMtxVecInt *Vec, const int VecIndex, const int Index, const int Len) const;Reverse vector elements.
4TMtxVecInt *Reverse(const int Index, const int Len) const;Reverses the calling object elements [Index]..[Index+Len-1].

Overload 1: TVecInt *Reverse() const;

Reverse vector elements.

Remarks:

The method reverses vector elements by using the following equation:

V[k]=Vec[Nk],0kN,where N=Vec.Length1\text{V}[k]=\text{Vec}[N-k],\quad 0\leq k \leq N, \quad \text{where } N=\text{Vec.Length}-1

This overload reverses all calling vector elements in-place.

See Also: VectorInt::Rotate, VectorInt::Shift
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler

Overload 2: TVecInt *Reverse(TMtxVecInt *Vec) const;

Reverse all Vec elements.

#NameTypeDescription
1VecTMtxVecInt *
Remarks:

Xtore the result in the calling vector elements. The TMtxVecBase::Length property of the calling vector is set to implicitly match Vec vector.

Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler

Overload 3: TMtxVecInt *Reverse(TMtxVecInt *Vec, const int VecIndex, const int Index, const int Len) const;

Reverse vector elements.

#NameTypeDescription
1VecTMtxVecInt *
2VecIndexconst int
3Indexconst int
4Lenconst int
Remarks:

The method reverses Vec vector elements from [VecIndex].. [VecIndex+Len-1] and stores them in the calling vector from [Index]...[Index+Len-1] by using the following equation:

V[k]=Vec[Nk],0kN,where N=Vec.Length1\text{V}[k]=\text{Vec}[N-k],\quad 0\leq k \leq N, \quad \text{where } N=\text{Vec.Length}-1

This overload reverses calling vector elements in-place.

See Also: VectorInt::Rotate, VectorInt::Shift
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler

Overload 4: TMtxVecInt *Reverse(const int Index, const int Len) const;

Reverses the calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1Indexconst int
2Lenconst int
Remarks:

An exception is raised if array borders are overrun.

Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler