Commit 7a615d7ebc0f04a74e9008c3534cdb766775fbcc

Authored by David Mayerich
2 parents 0d0ef1a9 720240c8

Merge branch 'JACK' into 'master'

everything now is working for new cylinder

See merge request !20
Showing 2 changed files with 13 additions and 4 deletions   Show diff stats
stim/structures/kdtree.cuh
... ... @@ -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 354 void create(T *h_reference_points, size_t reference_count, size_t max_levels) {
351 355 #ifdef __CUDACC__
352 356 if (max_levels > 10) {
... ... @@ -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 564 void search(T *h_query_points, size_t query_count, size_t *indices, T *distances) {
556 565 #ifdef __CUDACC__
557 566 std::vector < typename cpu_kdtree::point<T, D> > query_points(query_count);
... ...
stim/visualization/cylinder.h
... ... @@ -68,7 +68,7 @@ public:
68 68 ///Returns the ith magnitude at the given p-value (p value ranges from 0 to 1).
69 69 ///interpolates the radius along the line.
70 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 72 if (pvalue <= 0.0) return R[0];
73 73 if (pvalue >= 1.0) return R[size() - 1];
74 74  
... ... @@ -80,9 +80,9 @@ public:
80 80 /// Returns the magnitude at the given index
81 81 /// @param i is the index of the desired point
82 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 87 ///adds a magnitude to each point in the cylinder
88 88 /*void add_mag(V val = 0) {
... ...