• 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 KdTreeNodeCollection<TNode>

    Collection of k-dimensional tree nodes.
    Inheritance
    ICollection<NodeDistance<TNode>>
    KdTreeNodeCollection<TNode>
    Namespace: Mars.Common.Collections
    Assembly: Mars.Common.dll
    Syntax
    public class KdTreeNodeCollection<TNode> : ICollection<NodeDistance<TNode>> where TNode : KdTreeNodeBase<TNode>, IComparable<TNode>, IEquatable<TNode>
    Type Parameters
    Name Description
    TNode The class type for the nodes of the tree.
    Remarks
    This class is used to store neighbor nodes when running one of the search algorithms for KdTree<T>.

    Constructors

    KdTreeNodeCollection(Int32)

    Creates a new KdTreeNodeCollection<TNode> with a maximum size.
    Declaration
    public KdTreeNodeCollection(int size)
    Parameters
    Type Name Description
    System.Int32 size The maximum number of elements allowed in this collection.

    Properties

    Capacity

    Gets or sets the maximum number of elements on this collection, if specified. A value of zero indicates this instance has no upper limit of elements.
    Declaration
    public int Capacity { get; }
    Property Value
    Type Description
    System.Int32

    Count

    Gets the number of elements in this collection.
    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32

    Farthest

    Gets the farthest node in the collection (with greatest distance).
    Declaration
    public TNode Farthest { get; }
    Property Value
    Type Description
    TNode

    IsReadOnly

    Gets a value indicating whether this instance is read only. For this collection, always returns false.
    Declaration
    public bool IsReadOnly { get; }
    Property Value
    Type Description
    System.Boolean true if this instance is read only; otherwise, false.

    Item[Int32]

    Gets the NodeDistance<TNode> at the specified index. Note: this method will iterate over the entire collection until the given position is found.
    Declaration
    public NodeDistance<TNode> this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    NodeDistance<TNode>

    Maximum

    Gets the maximum distance between a node in this collection and the query point.
    Declaration
    public double Maximum { get; }
    Property Value
    Type Description
    System.Double

    Minimum

    Gets the minimum distance between a node in this collection and the query point.
    Declaration
    public double Minimum { get; }
    Property Value
    Type Description
    System.Double

    Nearest

    Gets the nearest node in the collection (with smallest distance).
    Declaration
    public TNode Nearest { get; }
    Property Value
    Type Description
    TNode

    Methods

    Add(TNode, Double)

    Attempts to add a value to the collection. If the list is full and the value is more distant than the farthest node in the collection, the value will not be added.
    Declaration
    public bool Add(TNode value, double distance)
    Parameters
    Type Name Description
    TNode value The node to be added.
    System.Double distance The node distance.
    Returns
    Type Description
    System.Boolean Returns true if the node has been added; false otherwise.

    Add(NodeDistance<TNode>)

    Adds the specified item to this collection.
    Declaration
    public void Add(NodeDistance<TNode> item)
    Parameters
    Type Name Description
    NodeDistance<TNode> item The item.

    AddFarthest(TNode, Double)

    Attempts to add a value to the collection. If the list is full and the value is more distant than the farthest node in the collection, the value will not be added.
    Declaration
    public bool AddFarthest(TNode value, double distance)
    Parameters
    Type Name Description
    TNode value The node to be added.
    System.Double distance The node distance.
    Returns
    Type Description
    System.Boolean Returns true if the node has been added; false otherwise.

    Clear()

    Removes all elements from this collection.
    Declaration
    public void Clear()

    Contains(NodeDistance<TNode>)

    Determines whether this instance contains the specified item.
    Declaration
    public bool Contains(NodeDistance<TNode> item)
    Parameters
    Type Name Description
    NodeDistance<TNode> item The object to locate in the collection. The value can be null for reference types.
    Returns
    Type Description
    System.Boolean true if the item is found in the collection; otherwise, false.

    CopyTo(NodeDistance<TNode>[], Int32)

    Copies the entire collection to a compatible one-dimensional , starting at the specified arrayIndex of the array .
    Declaration
    public void CopyTo(NodeDistance<TNode>[] array, int arrayIndex)
    Parameters
    Type Name Description
    NodeDistance<TNode>[] array The one-dimensional that is the destination of the elements copied from tree. The must have zero-based indexing.
    System.Int32 arrayIndex The zero-based index in array at which copying begins.

    GetEnumerator()

    Returns an enumerator that iterates through this collection.
    Declaration
    public IEnumerator<NodeDistance<TNode>> GetEnumerator()
    Returns
    Type Description
    IEnumerator<NodeDistance<TNode>> An System.Collections.IEnumerator object that can be used to iterate through the collection.

    Remove(NodeDistance<TNode>)

    Not supported.
    Declaration
    public bool Remove(NodeDistance<TNode> item)
    Parameters
    Type Name Description
    NodeDistance<TNode> item
    Returns
    Type Description
    System.Boolean

    RemoveFarthest()

    Removes the farthest tree node from this collection.
    Declaration
    public void RemoveFarthest()

    RemoveNearest()

    Removes the nearest tree node from this collection.
    Declaration
    public void RemoveNearest()

    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

    KdTree<T>
    NodeDistance<TNode>
    Back to top Copyright © MARS GROUP.
    HAW Hamburg