Definition at line 65 of file lwkmeans.c.
70 memset(weights, 0,
sizeof(
uint32_t) * k);
71 for (i = 0; i < k; i++)
76 for (i = 0; i < n; i++)
78 cluster = clusters[i];
81 centers[cluster]->
x += objs[i]->
x;
82 centers[cluster]->
y += objs[i]->
y;
83 weights[cluster] += 1;
86 for (i = 0; i < k; i++)
90 centers[i]->
x /= weights[i];
91 centers[i]->
y /= weights[i];
#define KMEANS_NULL_CLUSTER
References KMEANS_NULL_CLUSTER, POINT2D::x, and POINT2D::y.
Referenced by kmeans().