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....



Clone


Unit:SDL_matrix
Class: TMatrix, TIntMatrix, TMat3D
Declaration: procedure Clone (MatSource: TMatrix); { class TMatrix }
procedure Clone (MatSource: TIntMatrix); { class TIntMatrix }
procedure Clone (MatSource: TMat3D); { class TMat3D }

The method Clone resizes the matrix to the dimensions of matrix MatSource and copies the entire contents of MatSource into its own data area (self ).

Please note that cloning a matrix does not work if it is a sparse matrix while the source matrix is a normal matrix, and vice versa. In this case the call to Clone is ignored. In order to change the internal matrix organization from a sparse layout to a full array and vice versa, the methods SparseToArray  and ArrayToSparse have to be used.

Hint: The Clone method is comparable to the Assign method. However cloning a data matrix copies only the data (not any auxiliary information, as for example the DataID), and triggers the OnChange event, while Assign does not.



Last Update: 2023-Feb-06