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

Defines a sub Matrix/matrix.

Pascal
procedure SetSubRange(Index: integer; Len: integer); overload;

The method will define a subarray starting at Index and ending at Index+Len-1. No copying will occur, only pointers will be shifted. All values of the original Vector will be preserved. An exception will be raised if an attempt is made to change the size of calling object. 

A sub-Matrix/matrix is Matrix/matrix which does not neccessarily 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 subvectors/submatrices increases CPU cache reuse, lower's memory requirements, increases application performance and improves code readability. 

To again obtain a view of the full Matrix/matrix, see SetFullRange

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