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

Defines a subarray.

Pascal
procedure SetSubIndex(BeginIndex: integer; EndIndex: integer); overload;

The method will define a sub array starting at BeginIndex and ending at EndIndex (inclusive). All values of the original vector/matrix will be preserved. An exception will be raised if an attempt is made to change the size of calling vector/matrix. 

A subarray is array which does not have its own memory allocated. Instead it adopts the memory of the source object and all operations done on the either of the objects affect the same elements. The use of subarrays increases CPU cache reuse, lower's memory requirements, increases application performance and improves code readability.

To again obtain a view of the full vector see SetFullRange

Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!