Class Hamming
Hamming distance.
Inheritance
System.Object
Hamming
Implements
IMetric<System.Byte[]>
IDistance<System.Byte[]>
IMetric<System.String>
IDistance<System.String>
IDistance<System.Double[]>
IMetric<System.Collections.BitArray>
IDistance<System.Collections.BitArray>
System.ICloneable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Numerics.Distances
Assembly: Mars.Numerics.dll
Syntax
[Serializable]
public class Hamming : IMetric<byte[]>, IDistance<byte[]>, IDistance<byte[], byte[]>, IMetric<string>, IDistance<string>, IDistance<string, string>, IDistance<double[]>, IDistance<double[], double[]>, IMetric<BitArray>, IDistance<BitArray>, IDistance<BitArray, BitArray>, ICloneable
Methods
| Improve this Doc View SourceClone()
Creates a new object that is a copy of the current instance.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object | A new object that is a copy of this instance. |
Distance(Byte[], Byte[])
Computes the distance
d(x,y)
between points
x
and y
.
Declaration
public double Distance(byte[] x, byte[] y)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | x | The first point x . |
System.Byte[] | y | The second point y . |
Returns
Type | Description |
---|---|
System.Double |
A double-precision value representing the distance d(x,y)
between x and y according
to the distance function implemented by this class.
|
Distance(BitArray, BitArray)
Computes the distance
d(x,y)
between points
x
and y
.
Declaration
public double Distance(BitArray x, BitArray y)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.BitArray | x | The first point x . |
System.Collections.BitArray | y | The second point y . |
Returns
Type | Description |
---|---|
System.Double |
A double-precision value representing the distance d(x,y)
between x and y according
to the distance function implemented by this class.
|
Distance(Double[], Double[])
Computes the distance
d(x,y)
between points
x
and y
.
Declaration
public double Distance(double[] x, double[] y)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | x | The first point x . |
System.Double[] | y | The second point y . |
Returns
Type | Description |
---|---|
System.Double |
A double-precision value representing the distance d(x,y)
between x and y according
to the distance function implemented by this class.
|
Distance(String, String)
Computes the distance
d(x,y)
between points
x
and y
.
Declaration
public double Distance(string x, string y)
Parameters
Type | Name | Description |
---|---|---|
System.String | x | The first point x . |
System.String | y | The second point y . |
Returns
Type | Description |
---|---|
System.Double |
A double-precision value representing the distance d(x,y)
between x and y according
to the distance function implemented by this class.
|
Implements
System.ICloneable