You are here: Symbol Reference > clMtxExpr Namespace > Classes > clMatrix Record > public > Reverse Method > clMatrix.Reverse Method (TOpenCLMtxVec, integer, integer, integer)
MtxVec VCL
ContentsIndex
PreviousUpNext
clMatrix.Reverse Method (TOpenCLMtxVec, integer, integer, integer)

Reverse vector elements.

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

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: 

 

 

 

This overload reverses calling vector elements in-place.

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