The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Resize


Unit:SDL_matrix
Class:TMatrix, TIntMatrix, TMat3D
Declaration:function Resize (Nc, Nr: longint): boolean;{ class TMatrix and TIntMatrix }
function Resize (Nc, Nr, Nl: longint): boolean;{ class TMat3D }

The method Resize serves to change the dimensions of the matrix on the fly. The parameters Nc and Nr define the intended size of the matrix (number of columns and number of rows). For TMat3D the parameter Nl determines the number of layers. Resize returns a TRUE value if the new matrix has been resized successfully.

Hint 1: Any excess matrix elements which are not covered by the original matrix are set to zero values.

Hint 2: Resizing a matrix allocates additional auxiliary memory in order to keep the existing cell values valid. If you don't need the values of a matrix and the matrix size is rather large, you are better off if you free the old matrix and create the new matrix from scratch.

Hint 3: In the Light Edition the number of cells is restricted to 2000 (NrOfColumns times NrOfRows times NrOfLayers).

Example: This method is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): cluster, findcent, interpol3d, invmat, multilinreg, ntabedit, plot3dhole



Last Update: 2015-May-13