Accord.NET Framework

## Manhattan Structure |

Manhattan (also known as Taxicab or L1) distance.

Syntax

[SerializableAttribute] public struct Manhattan : IMetric<double[]>, IDistance<double[]>, IDistance<double[], double[]>, IMetric<int[]>, IDistance<int[]>, IDistance<int[], int[]>

The Manhattan type exposes the following members.

Methods

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

Distance(Double, Double) |
Computes the distance d(x,y) between points
x and y.
| |

Distance(Int32, Int32) |
Computes the distance d(x,y) between points
x and y.
| |

Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.) | |

GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.) | |

GetType | Gets the Type of the current instance. (Inherited from Object.) | |

ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.) |

Extension Methods

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

HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |

IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |

To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |

ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |

Remarks

Taxicab geometry, considered by Hermann Minkowski in 19th century Germany, is a form of geometry in which the usual distance function of metric or Euclidean geometry is replaced by a new metric in which the distance between two points is the sum of the absolute differences of their Cartesian coordinates. The taxicab metric is also known as rectilinear distance, L1 distance or L1 norm (see Lp space), city block distance, Manhattan distance, or Manhattan length, with corresponding variations in the name of the geometry. The latter names allude to the grid layout of most streets on the island of Manhattan, which causes the shortest path a car could take between two intersections in the borough to have length equal to the intersections' distance in taxicab geometry.

References:

See Also