clueless-kmean now takes as parameter in which mode to work, and test.sh generate...
[clueless-kmeans.git] / clueless-kmean.cc
index e3d4f93..557f0d8 100644 (file)
@@ -76,8 +76,23 @@ int main(int argc, char **argv) {
 
   glp_term_out(0);
 
-  clusterer.train(Clusterer::UNINFORMATIVE_LP_ASSOCIATION,
-                  // Clusterer::STANDARD_LP_ASSOCIATION,
+  int mode;
+
+  if(argc == 2) {
+    if(strcmp(argv[1], "standard") == 0) {
+      mode = Clusterer::STANDARD_LP_ASSOCIATION;
+    } else if(strcmp(argv[1], "clueless") == 0) {
+      mode = Clusterer::UNINFORMATIVE_LP_ASSOCIATION;
+    } else {
+      cerr << "Unknown association mode " << argv[1] << endl;
+      exit(EXIT_FAILURE);
+    }
+  } else {
+    cerr << "Usage: " << argv[0] << " standard|clueless" << endl;
+    exit(EXIT_FAILURE);
+  }
+
+  clusterer.train(mode,
                   nb_clusters,
                   sample_set.dim,
                   sample_set.nb_points, sample_set.points,