Declaration: function DistanceOfObjects (Mat: TDouble2DArray; Mode: TDistMode; obj1, obj2: integer; feat1, feat2: integer; var dist: double): integer;
Assuming that the matrix Mat contains multivariate coordinates of a number of observations (objects), the function DistanceOfObjects calculates the multivariate distance between two observations. The rows of the matrix Mat are regarded as objects, the columns as variables.

The parameter Mode defines the type of the distance to be calculated, the parameters obj1 and obj2 specify the observations to be used for the distance calculation. DistanceOfObjects allows to restrict the variables to be used for the calculation by defining the range of variables from feat1 to feat2.

The function returns the distance between the two objects in the variable parameter dist. It returns the following error codes:

 0 ... everything is OK, dist is valid
-1 ... user defined distance not supported
-2 ... obj1 or obj2 is out of range
-3 ... feat1 or feat2 is out of range
-4 ... feat2 must not be less than feat1