NMath Reference Guide

## Distance Class |

Class Distance provides functions for computing the distance between objects.

Inheritance Hierarchy

Syntax

The Distance type exposes the following members.

Constructors

Methods

Name | Description | |
---|---|---|

CityBlockDistance | Compute the city-block (Manhattan) distance between two data sets (1 norm). | |

EuclideanDistance | Computes the Euclidean distance between two data sets (2 norm). | |

MaximumDistance | Computes the maximum (Chebychev) distance between two data sets. | |

PowerFunction | Power distance function. Encapsulates GetDistance() on a newly constructed Distance.PowerDistance object as a Distance.Function delegate. | |

SquaredEuclideanDistance | Computes the squared Euclidean distance between two data sets. |

Fields

Name | Description | |
---|---|---|

CityBlockFunction | City-block (Manhattan) distance function. Encapsulates Distance.CityBlockDistance as a Distance.Function delegate. | |

EuclideanFunction | Euclidean distance function. Encapsulates Distance.EuclideanDistance as a Distance.Function delegate. | |

MaximumFunction | Maximum (Chebychev) distance function. Encapsulates Distance.MaximumDistance as a Distance.Function delegate. | |

SquaredEuclideanFunction | Squared Euclidean distance function. Encapsulates Distance.SquaredEuclideanDistance as a Distance.Function delegate. |

Remarks

Instances of delegate type Distance.Function are used by class ClusterAnalysis
to compute the distances between singleton objects. Delegates are provided as
static variables for euclidean, squared euclidean, city-block (Manhattan),
maximum (Chebychev), and power distance functions.

See Also