PostGIS  3.1.6dev-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 double distance3d_sqr_pt4d_pt4d (const POINT4D *p1, const POINT4D *p2)
 
static uint8_t update_r (POINT4D *objs, int *clusters, uint32_t n, POINT4D *centers, uint32_t k)
 
static void update_means (POINT4D *objs, int *clusters, uint32_t n, POINT4D *centers, uint32_t k)
 
static uint8_t kmeans (POINT4D *objs, int *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)
 Take a list of LWGEOMs and a number of clusters and return an integer array indicating which cluster each geometry is in. More...