Class SquareEuclidean
Square-Euclidean distance and similarity. Please note that this
distance is not a metric as it doesn't obey the triangle inequality.
Inheritance
System.Object
SquareEuclidean
Implements
IDistance<System.Double[]>
ISimilarity<System.Double[]>
IDistance<System.Double>
ISimilarity<System.Double>
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 SquareEuclidean : IDistance<double[]>, IDistance<double[], double[]>, ISimilarity<double[]>, ISimilarity<double[], double[]>, IDistance<double>, IDistance<double, double>, ISimilarity<double>, ISimilarity<double, double>, IDistance<Sparse<double>>, IDistance<Sparse<double>, Sparse<double>>, ISimilarity<Sparse<double>>, ISimilarity<Sparse<double>, Sparse<double>>, 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. |
See Also
| Improve this Doc View SourceDistance(Sparse<Double>, Sparse<Double>)
Computes the distance
d(x,y)
between points
x
and y
.
Declaration
public double Distance(Sparse<double> x, Sparse<double> y)
Parameters
Type | Name | Description |
---|---|---|
Sparse<System.Double> | x | The first point x . |
Sparse<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.
|
See Also
| Improve this Doc View SourceDistance(Double, Double, Double, Double)
Gets the Square Euclidean distance between two points.
Declaration
public double Distance(double x1, double y1, double x2, double y2)
Parameters
Type | Name | Description |
---|---|---|
System.Double | x1 | The first coordinate of first point in space. |
System.Double | y1 | The second coordinate of first point in space. |
System.Double | x2 | The first coordinate of second point in space. |
System.Double | y2 | The second coordinate of second point in space. |
Returns
Type | Description |
---|---|
System.Double | The Square Euclidean distance between x and y. |
See Also
| Improve this Doc View SourceDistance(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.
|
See Also
| Improve this Doc View SourceDistance(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.
|
See Also
| Improve this Doc View SourceSimilarity(Sparse<Double>, Sparse<Double>)
Gets a similarity measure between two points.
Declaration
public double Similarity(Sparse<double> x, Sparse<double> y)
Parameters
Type | Name | Description |
---|---|---|
Sparse<System.Double> | x | The first point to be compared. |
Sparse<System.Double> | y | The second point to be compared. |
Returns
Type | Description |
---|---|
System.Double | A similarity measure between x and y. |
See Also
| Improve this Doc View SourceSimilarity(Double, Double)
Gets a similarity measure between two points.
Declaration
public double Similarity(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
System.Double | x | The first point to be compared. |
System.Double | y | The second point to be compared. |
Returns
Type | Description |
---|---|
System.Double | A similarity measure between x and y. |
See Also
| Improve this Doc View SourceSimilarity(Double[], Double[])
Gets a similarity measure between two points.
Declaration
public double Similarity(double[] x, double[] y)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | x | The first point to be compared. |
System.Double[] | y | The second point to be compared. |
Returns
Type | Description |
---|---|
System.Double | A similarity measure between x and y. |
See Also
| Improve this Doc View SourceSparse(Sparse<Double>, Sparse<Double>)
Computes the distance
d(x,y)
between points
x
and y
.
Declaration
public static double Sparse(Sparse<double> x, Sparse<double> y)
Parameters
Type | Name | Description |
---|---|---|
Sparse<System.Double> | x | The first point x . |
Sparse<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.
|
See Also
Implements
System.ICloneable