Method

NumCosmoMathSphereNNknn_search_distances

Declaration [src]

void
ncm_sphere_nn_knn_search_distances (
  NcmSphereNN* snn,
  const gdouble r,
  const gdouble theta,
  const gdouble phi,
  const gint64 k,
  GArray** distances,
  GArray** indices
)

Description [src]

Computes the k nearest neighbors of the target point (theta, phi) and stores the distances and indices in distances and indices, respectively. The distances are Euclidean distances in the 3D space squared. The output distances are sorted in ascending order and are squared. The output indices are sorted in the same order as the distances.

Parameters

r

Type: const gdouble

The target radius.

theta

Type: const gdouble

The target theta.

phi

Type: const gdouble

The target phi.

k

Type: const gint64

The number of nearest neighbors.

distances

Type: An array of double

The distances to the k nearest neighbors.

The argument will be set by the function.
The caller of the method takes ownership of the returned data, and is responsible for freeing it.
indices

Type: An array of long

The indices of the k nearest neighbors.

The argument will be set by the function.
The caller of the method takes ownership of the returned data, and is responsible for freeing it.