You are here: Symbol Reference > MtxVec Namespace > Classes > TMtx Class > public > TMtx.Split Method
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtx.Split Method

Splits matrix in blocks.

Pascal
procedure Split(ARows: integer; ACols: integer; const Dst: array of TMtx);

Splits he calling matrix in blocks. Example: 

 

[ A B ] [ C D ]

 

where A,B,C,D are matrices of size 2x2 and the calling matrix is of size 4x4. ARows and ACols define the number of rows and columns of the block based matrix. The matrices passed in the dst array to be filled with values from the calling matrix, must already have matching size and complex properties to cover the calling matrix or an exception will be raised.

var A,B,C,D,E: TMtx; begin CreateIt(A,B,C,D); CreateIt(E); try A.Size(2,2); B.Size(A); C.Size(A); D.Size(A); E.SetIt(4,4,False,[1,2,3,4 5,6,7,8 9,1,2,3 4,5,6,7]); E.Split(2,2,[A,B, C,D]); // A becomes: // [1,2, // 5,6] // B becomes: // [3,4, // 7,8] // C becomes: // [9,1, // 4,5] // D becomes: // [2,3, // 6,7] finally FreeIt(A,B,C,D); FreeIt(E); end; end;
Examples on GitHub
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!