Commit 720240c8343a87559be0774b036d435f044fe291
1 parent
0d0ef1a9
everything now is working for new cylinder
Showing
2 changed files
with
13 additions
and
4 deletions
Show diff stats
stim/structures/kdtree.cuh
@@ -347,6 +347,10 @@ namespace stim { | @@ -347,6 +347,10 @@ namespace stim { | ||
347 | } | 347 | } |
348 | } | 348 | } |
349 | 349 | ||
350 | + /// create a KD-tree given a pointer to an array of reference points and the number of reference points | ||
351 | + /// @param h_reference_points is a host array containing the reference points in (x0, y0, z0, ...., ) order | ||
352 | + /// @param reference_count is the number of reference point in the array | ||
353 | + /// @param max_levels is the deepest number of tree levels allowed | ||
350 | void create(T *h_reference_points, size_t reference_count, size_t max_levels) { | 354 | void create(T *h_reference_points, size_t reference_count, size_t max_levels) { |
351 | #ifdef __CUDACC__ | 355 | #ifdef __CUDACC__ |
352 | if (max_levels > 10) { | 356 | if (max_levels > 10) { |
@@ -552,6 +556,11 @@ namespace stim { | @@ -552,6 +556,11 @@ namespace stim { | ||
552 | } | 556 | } |
553 | } | 557 | } |
554 | 558 | ||
559 | + /// search the KD tree for nearest neighbors to a set of specified query points | ||
560 | + /// @param h_query_points an array of query points in (x0, y0, z0, ...) order | ||
561 | + /// @param query_count is the number of query points | ||
562 | + /// @param indices are the indices to the nearest reference point for each query points | ||
563 | + /// @param distances is an array containing the distance between each query point and the nearest reference point | ||
555 | void search(T *h_query_points, size_t query_count, size_t *indices, T *distances) { | 564 | void search(T *h_query_points, size_t query_count, size_t *indices, T *distances) { |
556 | #ifdef __CUDACC__ | 565 | #ifdef __CUDACC__ |
557 | std::vector < typename cpu_kdtree::point<T, D> > query_points(query_count); | 566 | std::vector < typename cpu_kdtree::point<T, D> > query_points(query_count); |
stim/visualization/cylinder.h
@@ -68,7 +68,7 @@ public: | @@ -68,7 +68,7 @@ public: | ||
68 | ///Returns the ith magnitude at the given p-value (p value ranges from 0 to 1). | 68 | ///Returns the ith magnitude at the given p-value (p value ranges from 0 to 1). |
69 | ///interpolates the radius along the line. | 69 | ///interpolates the radius along the line. |
70 | ///@param pvalue: the location of the in the cylinder, from 0 (beginning to 1). | 70 | ///@param pvalue: the location of the in the cylinder, from 0 (beginning to 1). |
71 | - T r(T pvalue) { | 71 | + T rl(T pvalue) { |
72 | if (pvalue <= 0.0) return R[0]; | 72 | if (pvalue <= 0.0) return R[0]; |
73 | if (pvalue >= 1.0) return R[size() - 1]; | 73 | if (pvalue >= 1.0) return R[size() - 1]; |
74 | 74 | ||
@@ -80,9 +80,9 @@ public: | @@ -80,9 +80,9 @@ public: | ||
80 | /// Returns the magnitude at the given index | 80 | /// Returns the magnitude at the given index |
81 | /// @param i is the index of the desired point | 81 | /// @param i is the index of the desired point |
82 | /// @param r is the index of the magnitude value | 82 | /// @param r is the index of the magnitude value |
83 | - //T r(unsigned i) { | ||
84 | - // return R[i]; | ||
85 | - //} | 83 | + T r(unsigned i) { |
84 | + return R[i]; | ||
85 | + } | ||
86 | 86 | ||
87 | ///adds a magnitude to each point in the cylinder | 87 | ///adds a magnitude to each point in the cylinder |
88 | /*void add_mag(V val = 0) { | 88 | /*void add_mag(V val = 0) { |