• Documentation
  • Core API
  • SmartOpenHamburg API
  • Model Components API
  • Common API

    Show / Hide Table of Contents
    • Mars.Common
      • GeoHash
      • GeoHashDecoder
      • GeohashDecodeResult
      • GeoHashEncoder
      • GeoHashPrecision
      • Hyperrectangle
      • InputHashHelper
      • PositionHelper
    • Mars.Common.Collections
      • BinaryArrayHeap<T>
      • DoubleBits
      • FibonacciHeap<T, TKey>
      • FibonacciHeapDoubleKey<T>
      • FibonacciHeapNode<T, TKey>
      • FibonacciHeapNodeDoubleKey<T>
      • HeapNode
      • IntervalSize
      • K2DTree<T>
      • K2dTreeNode<T>
      • KdTree
      • KdTree<T>
      • KdTreeBase<TNode>
      • KdTreeNode
      • KdTreeNode<T>
      • KdTreeNodeBase<TNode>
      • KdTreeNodeCollection<TNode>
      • KdTreeNodeList<T>
      • Key
      • Node<T>
      • NodeBase<T>
      • NodeDataContainer<T>
      • NodeDistance<TNode>
      • QuadTree<T>
      • Root<T>
      • TreeDataContainer<T>
    • Mars.Common.Collections.CritBit
      • ICritBitTree<TValue>
    • Mars.Common.Collections.Graph
      • EdgeData
      • GraphData
      • GraphSerializer
      • ISpatialGraph
      • KeyContainer
      • NodeData
      • SpatialGraph
      • SpatialGraphHelper
    • Mars.Common.Collections.Graph.Algorithms
      • AStar
      • CompressedPathDatabase
      • ContractionSearch
      • DepthLimitedTraversal
    • Mars.Common.Collections.Graph.Helper
      • INodeFinder
      • KdTreeNodeFinder
      • RunLengthEncoder
    • Mars.Common.Collections.KNNGraph
      • DefaultRandomGenerator
      • DistanceUtils
      • EventSources
      • EventSources.GraphBuildEventSource
      • EventSources.GraphSearchEventSource
      • IProgressReporter
      • IProvideRandomValues
      • KnnGraph<TItem, TDistance>
      • KnnGraph<TItem, TDistance>.KnnSearchResult
      • KnnGraph<TItem, TDistance>.Parameters
      • Node
      • ReverseComparer<T>
      • ReverseComparerExtensions
      • SelectionKind
      • TravelingCosts<TItem, TDistance>
    • Mars.Common.Compat
      • FormatDecoderAttribute
      • FormatEncoderAttribute
      • FormatHandlerAttribute
      • IntegerAttribute
      • NegativeIntegerAttribute
      • NonnegativeIntegerAttribute
      • NonpositiveIntegerAttribute
      • PositiveIntegerAttribute
    • Mars.Common.Data
      • DomainDataImporter
    • Mars.Common.Data.Providers
      • AscDataProvider
      • GeoJsonFeatureCollectionConverter
      • GeoJsonFeatureConverter
      • GeometryDataProvider
      • GraphMlProvider
      • HttpDataProvider
      • IDataProvider<TInput>
      • JsonFileDataProvider
      • JsonTextDataProvider
      • XmlFileDataProvider
      • XmlTextDataProvider
    • Mars.Common.Exceptions
      • DimensionMismatchException
      • ParseException
    • Mars.Common.IO
      • ExtensionMethods
      • FileClientUtils
      • FileKeys
      • HttpClientUtils
      • ObjectSerialize
      • Serializer
      • SerializerCompression
      • SparseFormat
      • SparseReader
      • SparseWriter
    • Mars.Common.IO.Attributes
      • SerializationBinderAttribute
      • SurrogateSelectorAttribute
    • Mars.Common.IO.Console
      • ChildProgressBar
      • IProgressBar
      • ProgressBar
      • ProgressBarBase
      • ProgressBarHeight
      • ProgressBarOptions
      • ProgressBarSimple
    • Mars.Common.IO.Csv
      • CsvAnalyzer
      • CsvReader
      • CsvReader.RecordEnumerator
      • CsvWriter
      • MissingFieldAction
      • ParseErrorAction
      • ValueTrimmingOptions
    • Mars.Common.IO.Events
      • ParseErrorEventArgs
    • Mars.Common.IO.Exceptions
      • MalformedCsvException
      • MissingFieldCsvException
    • Mars.Common.IO.Mapped
      • Context
      • DefaultArrayFactory
      • Extensions
      • IArrayFactory
      • ISerializableToStream
      • MappedAccessor<T>
      • MemoryMap
      • MemoryMap.CreateAccessorFunc<T>
      • MemoryMap.ReadFromDelegate<T>
      • MemoryMap.WriteToDelegate<T>
      • MemoryMapDelegates
      • MemoryMapDelegates.CreateAccessorFunc<T>
      • MemoryMapStream
    • Mars.Common.IO.Mapped.Accessors
      • MappedAccessorByte
      • MappedAccessorDouble
      • MappedAccessorInt16
      • MappedAccessorInt32
      • MappedAccessorInt64
      • MappedAccessorSingle
      • MappedAccessorUInt16
      • MappedAccessorUInt32
      • MappedAccessorUInt64
      • MappedAccessorVariable<T>
    • Mars.Common.IO.Mapped.Arrays
      • Array<T>
      • ArrayBase<T>
      • ArrayProfile
      • MappedArray<TMapped, T>
      • MappedArray<TMapped, T>.MapFrom
      • MappedArray<TMapped, T>.MapTo
      • MemoryArray<T>
      • VariableArray<T>
    • Mars.Common.IO.Mapped.Collections
      • MemoryBackedDictionary<TKey, TValue>
      • MemoryBackedList<T>
    • Mars.Common.IO.Mapped.Indexes
      • Index<T>
    • Mars.Common.IO.Mapped.Streams
      • CappedStream
    • Mars.Common.Socket
      • ByteOrder
      • CloseEventArgs
      • CloseStatusCode
      • CompressionMethod
      • ErrorEventArgs
      • Ext
      • MessageEventArgs
      • WebSocket
      • WebSocketException
      • WebSocketState
    • Mars.Common.Socket.Server
      • IWebSocketSession
      • WebHeaderCollection
      • WebSocketBehavior
      • WebSocketContext
      • WebSocketServer
      • WebSocketServiceHost
      • WebSocketServiceManager
      • WebSocketSessionManager
    • Mars.Numerics
      • Classes
      • Combinatorics
      • Constants
      • Distance
      • Elementwise
      • Jagged
      • MathematicsException
      • MathHelper
      • Matrix
      • MatrixOrder
      • MatrixType
      • Norm
      • Sort
      • Sorting
      • Sparse
      • Sparse<T>
      • Tools
      • Vector
      • VectorHelper
      • VectorType
    • Mars.Numerics.Comparers
      • ArrayComparer<T>
      • ComparerDirection
      • CustomComparer<T>
      • ElementComparer
      • ElementComparer<T>
      • GeneralComparer
      • StableComparer<T>
    • Mars.Numerics.Distances
      • Angular
      • Chebyshev
      • Cosine
      • Dirac<T>
      • Euclidean
      • Hamming
      • Hamming<T>
      • Haversine
      • Jaccard
      • Jaccard<T>
      • Kulczynski
      • Levenshtein
      • Levenshtein<T>
      • Manhattan
      • Matching
      • Minkowski
      • SquareEuclidean
      • Vincenty
      • Vincenty.Ellipsoid
    • Mars.Numerics.Distances.Base
      • IDistance<T>
      • IDistance<TFirst, TSecond>
      • IMetric<T>
      • ISimilarity<T, TU>
      • ISimilarity<T>
    • Mars.Numerics.Exceptions
      • DimensionMismatchException
      • NonPositiveDefiniteMatrixException
      • SingularMatrixException
    • Mars.Numerics.Formats
      • DefaultMatrixFormatProvider
      • IMatrixFormatProvider
      • MatrixFormatProviderBase
      • MatrixFormatter
      • OctaveMatrixFormatProvider
    • Mars.Numerics.Ranges
      • ByteRange
      • DoubleRange
      • FloatRange
      • IntRange
      • IRange<T>
    • Mars.Numerics.Statistics
      • ConstValueDistribution<T>
      • Distribution<T>
      • FastGaussianDistributionD
      • FastGaussianDistributionF
      • IDistribution
      • UniformDiscreteDistribution
      • UniformDistributionD
      • UniformDistributionF
    • Mars.Numerics.Statistics.Base
      • BinarySearch
      • DistributionBase
      • ISampleableDistribution<TObservations>
      • IUnivariateDistribution
      • IUnivariateDistribution<TObservation>
      • UnivariateDiscreteDistribution

    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[]>
    IDistance<System.Double[], System.Double[]>
    ISimilarity<System.Double[]>
    ISimilarity<System.Double[], System.Double[]>
    IDistance<System.Double>
    IDistance<System.Double, System.Double>
    ISimilarity<System.Double>
    ISimilarity<System.Double, System.Double>
    IDistance<Sparse<System.Double>>
    IDistance<Sparse<System.Double>, Sparse<System.Double>>
    ISimilarity<Sparse<System.Double>>
    ISimilarity<Sparse<System.Double>, Sparse<System.Double>>
    ICloneable
    Namespace: Mars.Numerics.Distances
    Assembly: Mars.Numerics.dll
    Syntax
    public class SquareEuclidean : object, 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

    Clone()

    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(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.

    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(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.

    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.

    Similarity(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.

    Similarity(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.

    Similarity(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.

    Sparse(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.

    Implements

    IDistance<T>
    IDistance<TFirst, TSecond>
    ISimilarity<T>
    ISimilarity<T, TU>
    IDistance<T>
    IDistance<TFirst, TSecond>
    ISimilarity<T>
    ISimilarity<T, TU>
    IDistance<T>
    IDistance<TFirst, TSecond>
    ISimilarity<T>
    ISimilarity<T, TU>
    ICloneable

    Extension Methods

    DomainDataImporter.Import(Object, InputConfiguration)
    ObjectSerialize.Serialize(Object)
    Serializer.Save<T>(T, Stream, SerializerCompression)
    Serializer.Save<T>(T, BinaryFormatter, Stream, SerializerCompression)
    Serializer.Save<T>(T, String)
    Serializer.Save<T>(T, String, SerializerCompression)
    Serializer.Save<T>(T, out Byte[], SerializerCompression)
    Matrix.Replace<T>(T, Object, Object)
    Matrix.IsEqual(Object, Object, Decimal, Decimal)
    Matrix.Concatenate<T>(T, T[])

    See Also

    Euclidean
    Back to top Copyright © MARS GROUP.
    HAW Hamburg