Definition at line 62 of file lwkmeans.c.
67 memset(weights, 0,
sizeof(uint32_t) * k);
68 for (i = 0; i < k; i++)
73 for (i = 0; i < n; i++)
75 cluster = clusters[i];
78 centers[cluster]->
x += objs[i]->
x;
79 centers[cluster]->
y += objs[i]->
y;
80 weights[cluster] += 1;
83 for (i = 0; i < k; i++)
87 centers[i]->
x /= weights[i];
88 centers[i]->
y /= weights[i];
#define KMEANS_NULL_CLUSTER
References KMEANS_NULL_CLUSTER, POINT2D::x, and POINT2D::y.
Referenced by kmeans().