PostGIS  3.4.0dev-r@@SVN_REVISION@@
lwkmeans.c File Reference
Include dependency graph for lwkmeans.c:

Go to the source code of this file.

Macros

#define KMEANS_NULL_CLUSTER   -1
 
#define KMEANS_MAX_ITERATIONS   1000
 

Functions

static uint32_t kmeans (POINT4D *objs, uint32_t *clusters, uint32_t n, POINT4D *centers, double *radii, uint32_t min_k, double max_radius)
 
static double distance3d_sqr_pt4d_pt4d (const POINT4D *p1, const POINT4D *p2)
 
static uint32_t improve_structure (POINT4D *objs, uint32_t *clusters, uint32_t n, POINT4D *centers, double *radii, uint32_t k, double max_radius)
 
static uint8_t update_r (POINT4D *objs, uint32_t *clusters, uint32_t n, POINT4D *centers, double *radii, uint32_t k)
 
static void update_means (POINT4D *objs, uint32_t *clusters, uint32_t n, POINT4D *centers, uint32_t k)
 
static void kmeans_init (POINT4D *objs, uint32_t n, POINT4D *centers, uint32_t k)
 
int * lwgeom_cluster_kmeans (const LWGEOM **geoms, uint32_t n, uint32_t k, double max_radius)
 Take a list of LWGEOMs and a number of clusters and return an integer array indicating which cluster each geometry is in. More...