diff --git a/kmeans.md b/kmeans.md index 38b3ad1a96ef2a4f3436397584f7914aafcd8563..f09cb6bc94473a9be0a6dc08db5ff03be608fdc3 100644 --- a/kmeans.md +++ b/kmeans.md @@ -84,14 +84,24 @@ et la vérification de notre algorithme. $$v \in \mathbb{N}^2$$ ### structure de donnée -*points* -float x - y -label - cluster - -*cluster* -tab[nbr point] - -taille du tableau : connaitre le nombre de point a l'avance ou sinon donner un nombre aléatoire et reallouer si bessoin +typedef struct _cluster { + point* centroid; +} cluster; + +typedef struct _point { + float x; + float y; + char* label; // for tests + struct _cluster* cluster; + int color; +} point; + + +typedef struct _kmeans { + int k; + cluster clusters_array[k]; + point** points_array; +} kmeans; **BONUS 1** : étendre l'implémentation pour pouvoir utiliser des vecteurs à $n$ dimensions avec $n$ passé en paramètre au début de la procédure.