]> granicus.if.org Git - graphviz/commitdiff
gvmap: remove 'seed' parameter from 'map_palette_optimal_coloring'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 28 May 2022 05:47:51 +0000 (22:47 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 24 Aug 2022 15:07:56 +0000 (08:07 -0700)
This is always passed as -10.

cmd/gvmap/gvmap.c
cmd/gvmap/make_map.c
cmd/gvmap/make_map.h

index 0f2ed36b1e88ced0ccc28eb00906931d8246b0f8..6872fc2516b735083cc3f08ce1793f4f1190cca3 100644 (file)
@@ -370,7 +370,7 @@ makeMap (SparseMatrix graph, int n, double* x, double* width, int* grouping,
   if (pm->color_optimize && country_graph && rgb_r && rgb_g && rgb_b) 
     map_optimal_coloring(pm->seed, country_graph, rgb_r,  rgb_g, rgb_b);
   else if (pm->color_scheme_str){
-    map_palette_optimal_coloring(pm->color_scheme_str, country_graph, -10,
+    map_palette_optimal_coloring(pm->color_scheme_str, country_graph,
                &rgb_r, &rgb_g, &rgb_b);
   }
 
index 262b2368ca9a2b6c5b1c708d9d4e7a81ce80ac82..4e8316556f675b5c425b34f7dc3a40cc9bcb4de8 100644 (file)
@@ -28,7 +28,7 @@
 #include <edgepaint/lab.h>
 #include <edgepaint/node_distinct_coloring.h>
 
-void map_palette_optimal_coloring(char *color_scheme, SparseMatrix A0, int seed, 
+void map_palette_optimal_coloring(char *color_scheme, SparseMatrix A0,
                                  float **rgb_r, float **rgb_g, float **rgb_b){
   /*
     for a graph A, get a distinctive color of its nodes so that the color distanmce among all nodes are maximized. Here
@@ -36,7 +36,6 @@ void map_palette_optimal_coloring(char *color_scheme, SparseMatrix A0, int seed,
     color_scheme: rgb, gray, lab, or one of the color palettes in color_palettes.h, or a list of hex rgb colors separaterd by comma like "#ff0000,#00ff00"
     A: the graph of n nodes
     cdim: dimension of the color space
-    seed: random_seed. If negative, consider -seed as the number of random start iterations
     rgb_r, rgb_g, rgb_b: float array of length A->m + 1, which contains color for each country. 1-based
   */
  
@@ -66,6 +65,10 @@ void map_palette_optimal_coloring(char *color_scheme, SparseMatrix A0, int seed,
   // node, the optimal is with in "accuracy" of the true global optimal.
   const double accuracy = 0.01;
 
+  // seed: random_seed. If negative, consider -seed as the number of random
+  // start iterations
+  const int seed = -10;
+
   node_distinct_coloring(color_scheme, lightness, weightedQ, A, accuracy, seed,
                          &cdim, &colors);
 
index 01ccfdc8dd3fcb24f273e1f7d390819d23679ea9..478f016bb661caa311caeee6f690b82bb3be4239 100644 (file)
@@ -28,7 +28,8 @@ void plot_dot_map(Agraph_t* gr, int n, int dim, double *x, SparseMatrix polys,
                   const char* opacity, SparseMatrix A, FILE*);
 
 void map_optimal_coloring(int seed, SparseMatrix A, float *rgb_r,  float *rgb_g, float *rgb_b);
-void map_palette_optimal_coloring(char *color_scheme, SparseMatrix A, int seed, float **rgb_r, float **rgb_g, float **rgb_b);
+void map_palette_optimal_coloring(char *color_scheme, SparseMatrix A,
+                                  float **rgb_r, float **rgb_g, float **rgb_b);
 
 enum {POLY_LINE_REAL_EDGE, POLY_LINE_NOT_REAL_EDGE};
 #define neighbor(t, i, edim, elist) elist[(edim)*(t)+i]