Lines Matching refs:leaf

147     KDLeaf     *leaf;  in PetscKDTreeBuildStemAndLeaves()  local
151 PetscCall(PetscSegBufferGet(kd_build->leaves, 1, &leaf)); in PetscKDTreeBuildStemAndLeaves()
152 PetscCall(PetscMemzero(leaf, sizeof(KDLeaf))); in PetscKDTreeBuildStemAndLeaves()
155 PetscCall(PetscIntCast(end - start, &leaf->count)); in PetscKDTreeBuildStemAndLeaves()
156 PetscCall(PetscSegBufferGetSize(kd_build->bucket_indices, &leaf->indices_handle)); in PetscKDTreeBuildStemAndLeaves()
157 PetscCall(PetscSegBufferGet(kd_build->bucket_indices, leaf->count, &bucket_indices)); in PetscKDTreeBuildStemAndLeaves()
158 PetscCall(PetscArraycpy(bucket_indices, &sorted_indices[start], leaf->count)); in PetscKDTreeBuildStemAndLeaves()
161 PetscCall(PetscSegBufferGetSize(kd_build->bucket_coords, &leaf->coords_handle)); in PetscKDTreeBuildStemAndLeaves()
162 PetscCall(PetscSegBufferGet(kd_build->bucket_coords, leaf->count * dim, &bucket_coords)); in PetscKDTreeBuildStemAndLeaves()
164 for (PetscCount i = 0; i < leaf->count; i++) { in PetscKDTreeBuildStemAndLeaves()
165 …for (PetscInt d = 0; d < dim; d++) bucket_coords[d * leaf->count + i] = tree->coords[bucket_indice… in PetscKDTreeBuildStemAndLeaves()
167 } else leaf->coords_handle = -1; in PetscKDTreeBuildStemAndLeaves()
324 static inline PetscErrorCode PetscKDTreeQueryLeaf(PetscKDTree tree, KDLeaf leaf, const PetscReal po… in PetscKDTreeQueryLeaf() argument
331 for (PetscInt i = 0; i < leaf.count; i++) { in PetscKDTreeQueryLeaf()
332 PetscCount point_index = tree->bucket_indices[leaf.indices_handle + i]; in PetscKDTreeQueryLeaf()
342 static inline PetscErrorCode PetscKDTreeQueryLeaf_CopyCoords(PetscKDTree tree, KDLeaf leaf, const P… in PetscKDTreeQueryLeaf_CopyCoords() argument
349 for (PetscInt i = 0; i < leaf.count; i++) { in PetscKDTreeQueryLeaf_CopyCoords()
352 …d = 0; d < dim; d++) dist += PetscSqr(point[d] - tree->coords[leaf.coords_handle + d * leaf.count … in PetscKDTreeQueryLeaf_CopyCoords()
355 *index = tree->bucket_indices[leaf.indices_handle + i]; in PetscKDTreeQueryLeaf_CopyCoords()
368 KDLeaf leaf = tree->leaves[node_handle]; in PetscKDTreeQuery_Recurse() local
372 …if (leaf.coords_handle > -1) PetscCall(PetscKDTreeQueryLeaf_CopyCoords(tree, leaf, point, &point_i… in PetscKDTreeQuery_Recurse()
373 else PetscCall(PetscKDTreeQueryLeaf(tree, leaf, point, &point_index, &dist)); in PetscKDTreeQuery_Recurse()
488 KDLeaf leaf = tree->leaves[i]; in PetscKDTreeView() local
489 …l(PetscViewerASCIIPrintf(viewer, "Leaf %" PetscCount_FMT ": Count=%" PetscInt_FMT, i, leaf.count)); in PetscKDTreeView()
491 for (PetscInt j = 0; j < leaf.count; j++) { in PetscKDTreeView()
493 PetscCount bucket_index = tree->bucket_indices[leaf.indices_handle + j]; in PetscKDTreeView()
499 if (leaf.coords_handle > -1) { in PetscKDTreeView()
500 …Call(PetscViewerASCIIPrintf(viewer, "%g ", (double)tree->coords[leaf.coords_handle + leaf.count * … in PetscKDTreeView()