15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Methods<br />

SciPy Reference Guide, Release 0.8.dev<br />

max_distance_point(x[, p]) Compute the maximum distance between x and a point in the<br />

hyperrectangle.<br />

max_distance_rectangle(other[, Compute the maximum distance between points in the two<br />

p])<br />

hyperrectangles.<br />

min_distance_point(x[, p]) Compute the minimum distance between x and a point in the<br />

hyperrectangle.<br />

min_distance_rectangle(other[, Compute the minimum distance between points in the two<br />

p])<br />

hyperrectangles.<br />

split(d, split) Produce two hyperrectangles by splitting along axis d.<br />

volume() Total volume.<br />

max_distance_point(x, p=2.0)<br />

Compute the maximum distance between x and a point in the hyperrectangle.<br />

max_distance_rectangle(other, p=2.0)<br />

Compute the maximum distance between points in the two hyperrectangles.<br />

min_distance_point(x, p=2.0)<br />

Compute the minimum distance between x and a point in the hyperrectangle.<br />

min_distance_rectangle(other, p=2.0)<br />

Compute the minimum distance between points in the two hyperrectangles.<br />

split(d, split)<br />

Produce two hyperrectangles by splitting along axis d.<br />

In general, if you need to compute maximum and minimum distances to the children, it can be done more<br />

efficiently by updating the maximum and minimum distances to the parent.<br />

volume()<br />

Total volume.<br />

class cKDTree()<br />

kd-tree for quick nearest-neighbor lookup<br />

This class provides an index into a set of k-dimensional points which can be used to rapidly look up the nearest<br />

neighbors of any point.<br />

The algorithm used is described in Maneewongvatana and Mount 1999. The general idea is that the kd-tree is<br />

a binary trie, each of whose nodes represents an axis-aligned hyperrectangle. Each node specifies an axis and<br />

splits the set of points based on whether their coordinate along that axis is greater than or less than a particular<br />

value.<br />

During construction, the axis and splitting point are chosen by the “sliding midpoint” rule, which ensures that<br />

the cells do not all become long and thin.<br />

The tree can be queried for the r closest neighbors of any given point (optionally returning only those within<br />

some maximum distance of the point). It can also be queried, with a substantial gain in efficiency, for the r<br />

approximate closest neighbors.<br />

For large dimensions (20 is already large) do not expect this to run significantly faster than brute force. Highdimensional<br />

nearest-neighbor queries are a substantial open problem in computer science.<br />

Methods<br />

query query the kd-tree for nearest neighbors<br />

query()<br />

query the kd-tree for nearest neighbors<br />

3.16. Spatial algorithms and data structures (<strong>scipy</strong>.spatial) 421

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!