diff --git a/stim/structures/kdtree.cuh b/stim/structures/kdtree.cuh index 093c71a..c21492e 100644 --- a/stim/structures/kdtree.cuh +++ b/stim/structures/kdtree.cuh @@ -347,6 +347,10 @@ namespace stim { } } + /// create a KD-tree given a pointer to an array of reference points and the number of reference points + /// @param h_reference_points is a host array containing the reference points in (x0, y0, z0, ...., ) order + /// @param reference_count is the number of reference point in the array + /// @param max_levels is the deepest number of tree levels allowed void create(T *h_reference_points, size_t reference_count, size_t max_levels) { #ifdef __CUDACC__ if (max_levels > 10) { @@ -552,6 +556,11 @@ namespace stim { } } + /// search the KD tree for nearest neighbors to a set of specified query points + /// @param h_query_points an array of query points in (x0, y0, z0, ...) order + /// @param query_count is the number of query points + /// @param indices are the indices to the nearest reference point for each query points + /// @param distances is an array containing the distance between each query point and the nearest reference point void search(T *h_query_points, size_t query_count, size_t *indices, T *distances) { #ifdef __CUDACC__ std::vector < typename cpu_kdtree::point > query_points(query_count); diff --git a/stim/visualization/cylinder.h b/stim/visualization/cylinder.h index 06ae2ee..6e6a1ff 100644 --- a/stim/visualization/cylinder.h +++ b/stim/visualization/cylinder.h @@ -68,7 +68,7 @@ public: ///Returns the ith magnitude at the given p-value (p value ranges from 0 to 1). ///interpolates the radius along the line. ///@param pvalue: the location of the in the cylinder, from 0 (beginning to 1). - T r(T pvalue) { + T rl(T pvalue) { if (pvalue <= 0.0) return R[0]; if (pvalue >= 1.0) return R[size() - 1]; @@ -80,9 +80,9 @@ public: /// Returns the magnitude at the given index /// @param i is the index of the desired point /// @param r is the index of the magnitude value - //T r(unsigned i) { - // return R[i]; - //} + T r(unsigned i) { + return R[i]; + } ///adds a magnitude to each point in the cylinder /*void add_mag(V val = 0) { -- libgit2 0.21.4