TMtxInt::SetSubRange Method

Overload List

#SignatureDescription
1void SetSubRange(int Index, int Len = MtxVecEOA);Defines a sub vector/matrix.
2void SetSubRange(TMtxVecBase *Src, int Index, int Len = MtxVecEOA);Define a subvector of the Src vector.
3void SetSubRange();Sets the subarray size to full size.
4void SetSubRange(TMtxVecInt *Src, int Index, int aRows, int aCols);Defines a sub vector/matrix.

Overload 1: void SetSubRange(int Index, int Len = MtxVecEOA);

Defines a sub vector/matrix.

#NameTypeDescription
1Indexint
2Len = MtxVecEOAint
Remarks:

The method will define a subarray starting at Index and ending at Index+Len-1. No copying will occur, only pointers will be shifted or indices adjusted.

All values of the original TMtxVecBase will be preserved. An exception will be raised, if an attempt is made to change the size of calling object.

A sub-vector/matrix is vector/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 vector/matrix, see TMtxInt::SetFullRange

Declared in Dew::Math::TMtxVecBase · Dew.Math/MtxVecBase.h · Cross-compiler

Overload 2: void SetSubRange(TMtxVecBase *Src, int Index, int Len = MtxVecEOA);

Define a subvector of the Src vector.

#NameTypeDescription
1SrcTMtxVecBase *
2Indexint
3Len = MtxVecEOAint
Remarks:

The method will define a subarray starting at Index and ending at Index+Len-1 of Src. No copying will occur, only pointers will be shifted or indices adjusted.

A sub-vector/matrix is vector/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.

All values of the original TMtxVecBase will be preserved. An exception will be raised, if an attempt is made to change the size of calling object. No exception will be raised, if Src is resized while subranged. (possibly leading to memory overwrites)

To again obtain a view of the original vector/matrix, call TMtxInt::SetFullRange

Declared in Dew::Math::TMtxVecBase · Dew.Math/MtxVecBase.h · Cross-compiler

Overload 3: void SetSubRange();

Sets the subarray size to full size.

Remarks:

This method is the same as the TMtxInt::SetFullRange method.

Declared in Dew::Math::TMtxVecBase · Dew.Math/MtxVecBase.h · Cross-compiler

Overload 4: void SetSubRange(TMtxVecInt *Src, int Index, int aRows, int aCols);

Defines a sub vector/matrix.

#NameTypeDescription
1SrcTMtxVecInt *
2Indexint
3aRowsint
4aColsint
Remarks:

The method will define a subarray starting at Index and ending at Index + (aRows*aCols)-1. No copying will occur, only pointers will be shifted or indices adjusted. The subranged matrix will have the size aRows and aCols. Length will be equal to aRows*aCols.

All values of the original TMtxVecBase will be preserved. An exception will be raised if an attempt is made to change the size of calling object.

A sub-vector/matrix is vector/matrix, which does not have its own memory allocated. Instead it adopts the memory of the source object and all operations done on 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 vector/matrix, see TMtxInt::SetFullRange

The routine only makes sense to be used where aCols matches Src.Cols. MtxVec has only limited support for matrices where the matrix rows are not stored strictly consecutively. This overload is to be used with great caution.

The routine should not be mixed with other SetSubRange routines or subrange stack.

Declared in Dew::Math::TMtxInt · Dew.Math/MtxVecInt.h · Cross-compiler