PostGIS  2.5.2dev-r@@SVN_REVISION@@
lwkmeans.c File Reference
#include <float.h>
#include <math.h>
#include "liblwgeom_internal.h"
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 void update_r (POINT2D **objs, int *clusters, uint32_t n, POINT2D **centers, uint32_t k)
 
static void update_means (POINT2D **objs, int *clusters, uint32_t n, POINT2D **centers, uint32_t *weights, uint32_t k)
 
static int kmeans (POINT2D **objs, int *clusters, uint32_t n, POINT2D **centers, uint32_t k)
 
static void kmeans_init (POINT2D **objs, int *clusters, uint32_t n, POINT2D **centers, POINT2D *centers_raw, uint32_t k)
 
int * lwgeom_cluster_2d_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...