You are here: Symbol Reference > MtxExpr Namespace > Classes > Matrix Record > public > Reverse Method > Matrix.Reverse Method (TMtxVec, integer, integer, integer)
MtxVec VCL
ContentsIndex
PreviousUpNext
Matrix.Reverse Method (TMtxVec, integer, integer, integer)

Reverse Matrix elements.

Pascal
function Reverse(const Vec: TMtxVec; VecIndex: integer; Index: integer; Len: integer): TMtxVec; overload;

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

 

This overload reverses calling Matrix elements in-place.

var a: Matrix; begin a.SetIt(2,2,False,[1,2,3,4]); a.Reverse(0,2); // a = [2,1,3,4] end;
Examples on GitHub
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!