Class KdTreeNodeCollection<TNode>
Collection of k-dimensional tree nodes.
Inheritance
System.Object
KdTreeNodeCollection<TNode>
Implements
System.Collections.Generic.ICollection<NodeDistance<TNode>>
System.Collections.Generic.IEnumerable<NodeDistance<TNode>>
System.Collections.IEnumerable
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.Common.Collections
Assembly: Mars.Common.dll
Syntax
[Serializable]
public class KdTreeNodeCollection<TNode> : ICollection<NodeDistance<TNode>>, IEnumerable<NodeDistance<TNode>>, IEnumerable 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 k-dimensional trees.
Constructors
| Improve this Doc View SourceKdTreeNodeCollection(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. |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
Properties
| Improve this Doc View SourceCapacity
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 |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
Count
Gets the number of elements in this collection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
Farthest
Gets the farthest node in the collection (with greatest distance).
Declaration
public TNode Farthest { get; }
Property Value
Type | Description |
---|---|
TNode |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<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 .
|
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
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> |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
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 |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
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 |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
Nearest
Gets the nearest node in the collection (with smallest distance).
Declaration
public TNode Nearest { get; }
Property Value
Type | Description |
---|---|
TNode |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
Methods
| Improve this Doc View SourceAdd(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. |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
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. |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
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. |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
Clear()
Removes all elements from this collection.
Declaration
public void Clear()
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
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 .
|
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
CopyTo(NodeDistance<TNode>[], Int32)
Copies the entire collection to a compatible one-dimensional System.Array, 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 System.Array that is the destination of the elements copied from tree. The System.Array must have zero-based indexing. |
System.Int32 | arrayIndex | The zero-based index in array at which copying begins. |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
GetEnumerator()
Returns an enumerator that iterates through this collection.
Declaration
public IEnumerator<NodeDistance<TNode>> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<NodeDistance<TNode>> | An System.Collections.IEnumerator object that can be used to iterate through the collection. |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
Remove(NodeDistance<TNode>)
Not supported.
Declaration
public bool Remove(NodeDistance<TNode> item)
Parameters
Type | Name | Description |
---|---|---|
NodeDistance<TNode> | item |
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
RemoveFarthest()
Removes the farthest tree node from this collection.
Declaration
public void RemoveFarthest()
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
RemoveNearest()
Removes the nearest tree node from this collection.
Declaration
public void RemoveNearest()
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Returns an enumerator that iterates through this collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An System.Collections.IEnumerator object that can be used to iterate through the collection. |
Remarks
This class is used to store neighbor nodes when running one of the
search algorithms for k-dimensional trees.
See Also
KdTree<T>
NodeDistance<TNode>
Implements
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Extension Methods
See Also
KdTree<T>
NodeDistance<TNode>