• 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
      • GeoJsonHelper
      • 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 K2DTree<T>

    Inheritance
    IEnumerable<K2dTreeNode<T>>
    Mars.Common.Core.Collections.SimpleTree.BinaryTree<K2dTreeNode<T>>
    KdTreeBase<K2dTreeNode<T>>
    K2DTree<T>
    Inherited Members
    KdTreeBase<K2dTreeNode<T>>.Dimensions
    KdTreeBase<K2dTreeNode<T>>.Distance
    KdTreeBase<K2dTreeNode<T>>.Count
    KdTreeBase<K2dTreeNode<T>>.Leaves
    KdTreeBase<K2dTreeNode<T>>.Nearest(Position, Double, Int32, Func<K2dTreeNode<T>, Boolean>)
    KdTreeBase<K2dTreeNode<T>>.Nearest(Double[], Double, Int32, Func<K2dTreeNode<T>, Boolean>)
    KdTreeBase<K2dTreeNode<T>>.Nearest(Double[], Double, Func<K2dTreeNode<T>, Boolean>)
    KdTreeBase<K2dTreeNode<T>>.Nearest(Double[], Int32, Func<K2dTreeNode<T>, Boolean>)
    KdTreeBase<K2dTreeNode<T>>.Nearest(Double[])
    KdTreeBase<K2dTreeNode<T>>.Nearest(Double[], Double, Func<K2dTreeNode<T>, Boolean>)
    KdTreeBase<K2dTreeNode<T>>.Nearest<T1>(Double[], Double, Int32, Func<K2dTreeNode<T>, T1, Boolean>, T1)
    KdTreeBase<K2dTreeNode<T>>.Nearest<T1, T2>(Double[], Double, Int32, Func<K2dTreeNode<T>, T1, T2, Boolean>, T1, T2)
    KdTreeBase<K2dTreeNode<T>>.Nearest<T1, T2, T3>(Double[], Double, Int32, Func<K2dTreeNode<T>, T1, T2, T3, Boolean>, T1, T2, T3)
    KdTreeBase<K2dTreeNode<T>>.ApproximateNearest(Double[], Int32, Double)
    KdTreeBase<K2dTreeNode<T>>.ApproximateNearest(Double[], Double, Double)
    KdTreeBase<K2dTreeNode<T>>.ApproximateNearest(Double[], Double)
    KdTreeBase<K2dTreeNode<T>>.ApproximateNearest(Double[], Int32, Int32)
    KdTreeBase<K2dTreeNode<T>>.ApproximateNearest(Double[], Int32)
    KdTreeBase<K2dTreeNode<T>>.InsideRegion(Hyperrectangle)
    KdTreeBase<K2dTreeNode<T>>.Clear()
    KdTreeBase<K2dTreeNode<T>>.CopyTo(K2dTreeNode<T>[], Int32)
    KdTreeBase<K2dTreeNode<T>>.CreateRoot(Double[][], Boolean, Int32)
    KdTreeBase<K2dTreeNode<T>>.AddNode(Double[])
    Mars.Common.Core.Collections.SimpleTree.BinaryTree<Mars.Common.Collections.K2dTreeNode<T>>.Root
    Mars.Common.Core.Collections.SimpleTree.BinaryTree<Mars.Common.Collections.K2dTreeNode<T>>.GetEnumerator()
    Mars.Common.Core.Collections.SimpleTree.BinaryTree<Mars.Common.Collections.K2dTreeNode<T>>.SerializeJson()
    Mars.Common.Core.Collections.SimpleTree.BinaryTree<Mars.Common.Collections.K2dTreeNode<T>>.Traverse(Mars.Common.Core.Collections.SimpleTree.BinaryTraversalMethod<Mars.Common.Collections.K2dTreeNode<T>>)
    Namespace: Mars.Common.Collections
    Assembly: Mars.Common.dll
    Syntax
    public class K2DTree<T> : KdTreeBase<K2dTreeNode<T>>
    Type Parameters
    Name Description
    T

    Constructors

    K2DTree()

    Creates a new KdTree<T>.
    Declaration
    public K2DTree()

    K2DTree(K2dTreeNode<T>)

    Creates a new KdTree<T>.
    Declaration
    public K2DTree(K2dTreeNode<T> root)
    Parameters
    Type Name Description
    K2dTreeNode<T> root The Root node, if already existent.

    K2DTree(K2dTreeNode<T>, Int32, Int32)

    Creates a new KdTree<T>.
    Declaration
    public K2DTree(K2dTreeNode<T> root, int count, int leaves)
    Parameters
    Type Name Description
    K2dTreeNode<T> root The Root node, if already existent.
    System.Int32 count The number of elements in the Root node.
    System.Int32 leaves The number of leaves linked through the Root node.

    Methods

    Add(T, Double[])

    Inserts a value in the tree at the desired position.
    Declaration
    public void Add(T value, params double[] position)
    Parameters
    Type Name Description
    T value The value to be inserted.
    System.Double[] position A double-vector with the same number of elements as dimensions in the tree.

    Add(Position, T)

    Adds a new Position to this tree
    Declaration
    public void Add(Position position, T value)
    Parameters
    Type Name Description
    Position position A Position with respective coordinate, geospatial or not
    T value The value to be inserted

    Add(Double[], T)

    Inserts a value in the tree at the desired position.
    Declaration
    public void Add(double[] position, T value)
    Parameters
    Type Name Description
    System.Double[] position A double-vector with the same number of elements as dimensions in the tree.
    T value The value to be inserted.

    CreateTreeFrom(Double[][], T[], IMetric<Double[]>)

    Creates a new K2DTree<T> for geospatial points with the distance function used to distinct the coordinates with spherical background more precisely.
    Declaration
    public static K2DTree<T> CreateTreeFrom(double[][] points, T[] data, IMetric<double[]> metric = null)
    Parameters
    Type Name Description
    System.Double[][] points The multi-dimensional points from which to create the space.
    T[] data The data set for each respective point entry.
    IMetric<System.Double[]> metric The distance function used to separate the coordinates.
    Returns
    Type Description
    K2DTree<T> Returns a new K2DTree<T> containing all points associated to the data elements.

    Deserialize(TreeDataContainer<T>)

    Declaration
    public static K2DTree<T> Deserialize(TreeDataContainer<T> container)
    Parameters
    Type Name Description
    TreeDataContainer<T> container
    Returns
    Type Description
    K2DTree<T>

    Deserialize(String)

    Declaration
    public static K2DTree<T> Deserialize(string binaryFile)
    Parameters
    Type Name Description
    System.String binaryFile
    Returns
    Type Description
    K2DTree<T>

    Serialize()

    Converts the K2DTree<T> into managed message type as TreeDataContainer<T>.
    Declaration
    public TreeDataContainer<T> Serialize()
    Returns
    Type Description
    TreeDataContainer<T> Returns a new TreeDataContainer<T> which is prepared to serialize it into binary format using .

    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[])
    Back to top Copyright © MARS GROUP.
    HAW Hamburg