Lines Matching refs:num_coords

28   PetscCount       num_coords, num_leaves, num_stems, num_bucket_indices;  member
114 PetscCount num_coords = tree->num_coords, range_size = end - start, location; in PetscKDTreeVerifySortedIndices() local
118 PetscCall(PetscArraycpy(temp, &sorted_indices[0 * num_coords + start], range_size)); in PetscKDTreeVerifySortedIndices()
124 PetscCall(PetscFindCount(sorted_indices[d * num_coords + i], range_size, temp, &location)); in PetscKDTreeVerifySortedIndices()
125 …from %" PetscInt_FMT " dimensional index in 0th dimension", sorted_indices[d * num_coords + i], d); in PetscKDTreeVerifySortedIndices()
170 PetscCount num_coords = tree->num_coords; in PetscKDTreeBuildStemAndLeaves() local
184 PetscCall(PetscArraycpy(temp, &sorted_indices[0 * num_coords + start], end - start)); in PetscKDTreeBuildStemAndLeaves()
191 …if (lower < median && PetscKDTreeSortFunc(sorted_indices[d * num_coords + i], median_idx, tree, ax… in PetscKDTreeBuildStemAndLeaves()
192 sorted_indices[(d - 1) * num_coords + (++lower)] = sorted_indices[d * num_coords + i]; in PetscKDTreeBuildStemAndLeaves()
194 sorted_indices[(d - 1) * num_coords + (++upper)] = sorted_indices[d * num_coords + i]; in PetscKDTreeBuildStemAndLeaves()
200 …PetscCall(PetscArraycpy(&sorted_indices[(tree->dim - 1) * num_coords + start], temp, end - start)); in PetscKDTreeBuildStemAndLeaves()
236 PetscErrorCode PetscKDTreeCreate(PetscCount num_coords, PetscInt dim, const PetscReal coords[], Pet… in PetscKDTreeCreate() argument
245 …cCheck(num_coords > -1, PETSC_COMM_SELF, PETSC_ERR_USER_INPUT, "Number of coordinates may not be n… in PetscKDTreeCreate()
246 if (num_coords == 0) { in PetscKDTreeCreate()
255 tree->num_coords = num_coords; in PetscKDTreeCreate()
264 PetscCall(PetscMalloc1(num_coords * dim, &tree->coords_owned)); in PetscKDTreeCreate()
265 PetscCall(PetscArraycpy((PetscReal *)tree->coords_owned, coords, num_coords * dim)); in PetscKDTreeCreate()
271 PetscCall(PetscMalloc2(num_coords * dim, &sorted_indices, num_coords, &temp)); in PetscKDTreeCreate()
275 for (PetscCount i = 0; i < num_coords; i++) sorted_indices[num_coords * j + i] = i; in PetscKDTreeCreate()
277 …PetscCall(PetscTimSort((PetscInt)num_coords, &sorted_indices[num_coords * j], sizeof(*sorted_indic… in PetscKDTreeCreate()
281 PetscInt num_leaves = (PetscInt)PetscCeilInt64(num_coords, tree->max_bucket_size); in PetscKDTreeCreate()
290 PetscCall(PetscSegBufferCreate(sizeof(PetscCount), num_coords, &kd_build->bucket_indices)); in PetscKDTreeCreate()
291 …if (kd_build->copy_coords) PetscCall(PetscSegBufferCreate(sizeof(PetscReal), num_coords * dim, &kd… in PetscKDTreeCreate()
293 …PetscCall(PetscKDTreeBuildStemAndLeaves(kd_build, sorted_indices, temp, 0, num_coords, 0, &tree->i… in PetscKDTreeCreate()