Class KdTree
Convenience class for k-dimensional tree static methods. To
create a new KdTree, specify the generic parameter as in
KdTree<T>.
Inherited Members
Mars.Common.Core.Collections.SimpleTree.BinaryTree<Mars.Common.Collections.KdTreeNode>.Root
Mars.Common.Core.Collections.SimpleTree.BinaryTree<Mars.Common.Collections.KdTreeNode>.GetEnumerator()
Mars.Common.Core.Collections.SimpleTree.BinaryTree<Mars.Common.Collections.KdTreeNode>.System.Collections.IEnumerable.GetEnumerator()
Mars.Common.Core.Collections.SimpleTree.BinaryTree<Mars.Common.Collections.KdTreeNode>.SerializeJson()
Mars.Common.Core.Collections.SimpleTree.BinaryTree<Mars.Common.Collections.KdTreeNode>.Deserialize(System.String)
Mars.Common.Core.Collections.SimpleTree.BinaryTree<Mars.Common.Collections.KdTreeNode>.Traverse(Mars.Common.Core.Collections.SimpleTree.BinaryTraversalMethod<Mars.Common.Collections.KdTreeNode>)
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 KdTree : KdTreeBase<KdTreeNode>, IEnumerable<KdTreeNode>, IEnumerable
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
Constructors
| Improve this Doc View SourceKdTree(Int32, KdTreeNode, Int32, Int32)
Creates a new KdTree.
Declaration
public KdTree(int dimension, KdTreeNode root, int count, int leaves)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | dimension | The number of dimensions in the tree. |
KdTreeNode | 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. |
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
See Also
KdTree<T>
KdTree(Int32, KdTreeNode)
Creates a new KdTree.
Declaration
public KdTree(int dimension, KdTreeNode root)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | dimension | The number of dimensions in the tree. |
KdTreeNode | root | The root node, if already existent. |
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
See Also
KdTree<T>
KdTree(Int32)
Creates a new KdTree.
Declaration
public KdTree(int dimensions)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | dimensions | The number of dimensions in the tree. |
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
See Also
KdTree<T>
Methods
| Improve this Doc View SourceAdd(Position)
Adds a new Position to this tree
Declaration
public void Add(Position position)
Parameters
Type | Name | Description |
---|---|---|
Position | position | A Position with respective coordinate, geospatial or not |
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
See Also
KdTree<T>
Add(Double[])
Adds a new point to this tree.
Declaration
public void Add(double[] position)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | position | A double-vector with the same number of elements as dimensions in the tree. |
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
See Also
KdTree<T>
FromData(Double[][], IMetric<Double[]>, Boolean)
Creates a new k-dimensional tree from the given points.
Declaration
public static KdTree FromData(double[][] points, IMetric<double[]> distance, bool inPlace = false)
Parameters
Type | Name | Description |
---|---|---|
System.Double[][] | points | The points to be added to the tree. |
IMetric<System.Double[]> | distance | The distance function to use. |
System.Boolean | inPlace |
Whether the given points vector
can be ordered in place. Passing true will change the original order of
the vector. If set to false, all operations will be performed on an extra
copy of the vector.
|
Returns
Type | Description |
---|---|
KdTree | A KdTree<T> populated with the given data points. |
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
See Also
KdTree<T>
FromData(Double[][], Boolean)
Creates a new k-dimensional tree from the given points.
Declaration
public static KdTree FromData(double[][] points, bool inPlace = false)
Parameters
Type | Name | Description |
---|---|---|
System.Double[][] | points | The points to be added to the tree. |
System.Boolean | inPlace |
Whether the given points vector
can be ordered in place. Passing true will change the original order of
the vector. If set to false, all operations will be performed on an extra
copy of the vector.
|
Returns
Type | Description |
---|---|
KdTree | A KdTree<T> populated with the given data points. |
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
See Also
KdTree<T>
FromData<T>(Double[][], T[], IMetric<Double[]>, Boolean)
Creates a new k-dimensional tree from the given points.
Declaration
public static KdTree<T> FromData<T>(double[][] points, T[] values, IMetric<double[]> distance, bool inPlace = false)
Parameters
Type | Name | Description |
---|---|---|
System.Double[][] | points | The points to be added to the tree. |
T[] | values | The corresponding values at each data point. |
IMetric<System.Double[]> | distance | The distance function to use. |
System.Boolean | inPlace |
Whether the given points vector
can be ordered in place. Passing true will change the original order of
the vector. If set to false, all operations will be performed on an extra
copy of the vector.
|
Returns
Type | Description |
---|---|
KdTree<T> | A KdTree<T> populated with the given data points. |
Type Parameters
Name | Description |
---|---|
T | The type of the value to be stored. |
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
See Also
KdTree<T>
FromData<T>(Double[][], T[], Boolean)
Creates a new k-dimensional tree from the given points.
Declaration
public static KdTree<T> FromData<T>(double[][] points, T[] values, bool inPlace = false)
Parameters
Type | Name | Description |
---|---|---|
System.Double[][] | points | The points to be added to the tree. |
T[] | values | The corresponding values at each data point. |
System.Boolean | inPlace |
Whether the given points vector
can be ordered in place. Passing true will change the original order of
the vector. If set to false, all operations will be performed on an extra
copy of the vector.
|
Returns
Type | Description |
---|---|
KdTree<T> | A KdTree<T> populated with the given data points. |
Type Parameters
Name | Description |
---|---|
T | The type of the value to be stored. |
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
See Also
KdTree<T>
FromData<T>(Double[][], IMetric<Double[]>, Boolean)
Creates a new k-dimensional tree from the given points.
Declaration
public static KdTree<T> FromData<T>(double[][] points, IMetric<double[]> distance, bool inPlace = false)
Parameters
Type | Name | Description |
---|---|---|
System.Double[][] | points | The points to be added to the tree. |
IMetric<System.Double[]> | distance | The distance function to use. |
System.Boolean | inPlace |
Whether the given points vector
can be ordered in place. Passing true will change the original order of
the vector. If set to false, all operations will be performed on an extra
copy of the vector.
|
Returns
Type | Description |
---|---|
KdTree<T> | A KdTree<T> populated with the given data points. |
Type Parameters
Name | Description |
---|---|
T | The type of the value to be stored. |
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
See Also
KdTree<T>
FromData<T>(Double[][], Boolean)
Creates a new k-dimensional tree from the given points.
Declaration
public static KdTree<T> FromData<T>(double[][] points, bool inPlace = false)
Parameters
Type | Name | Description |
---|---|---|
System.Double[][] | points | The points to be added to the tree. |
System.Boolean | inPlace |
Whether the given points vector
can be ordered in place. Passing true will change the original order of
the vector. If set to false, all operations will be performed on an extra
copy of the vector.
|
Returns
Type | Description |
---|---|
KdTree<T> | A KdTree<T> populated with the given data points. |
Type Parameters
Name | Description |
---|---|
T | The type of the value to be stored. |
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
See Also
KdTree<T>
FromData2D<T>(Double[][], T[], Boolean)
Creates a new 2-dimensional tree from the given points.
Declaration
public static K2DTree<T> FromData2D<T>(double[][] points, T[] values, bool inPlace = false)
Parameters
Type | Name | Description |
---|---|---|
System.Double[][] | points | The 2-dimensional points to be added to the tree. |
T[] | values | The corresponding values at each data point. |
System.Boolean | inPlace |
Whether the given points vector
can be ordered in place. Passing true will change the original order of
the vector. If set to false, all operations will be performed on an extra
copy of the vector.
|
Returns
Type | Description |
---|---|
K2DTree<T> | A K2DTree<T> populated with the given data points. |
Type Parameters
Name | Description |
---|---|
T | The type of the value to be stored. |
Remarks
Please check the documentation page for KdTree<T>
for examples, usage and actual remarks about kd-trees.
See Also
KdTree<T>
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Extension Methods
See Also
KdTree<T>