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



CalcDistMat


Unit:SDL_matrix
Class: TMatrix
Declaration: function CalcDistMat (Mode: TDistMode; DMat: TMatrix): integer;

The method CalcDistMat calculates the distance matrix of the objects contained in self. The rows of the matrix self are regarded as objects, and the columns as variables. The parameter Mode defines the type of distance to be calculated. The parameter DMat is a pointer to a quadratic matrix which is to be filled with the distance values. DMat has to be quadratic; its size has to be equal to the number of rows of self. Note, that the distance matrix can use up a considerable amount of memory if the data matrix has many rows.

CalcDistMat returns an error code which has the following meaning:

0 no error
-1 DMat is not quadratic
-2 size does not fit number of rows of data matrix

If the parameter Mode is set to dmUserDef an OnCalcDistance event is triggered every time a new distance has to be calculated. This way the user may create any kind of distance measure.


Last Update: 2023-Feb-06