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, 0.01, -10,
+ map_palette_optimal_coloring(pm->color_scheme_str, country_graph, -10,
&rgb_r, &rgb_g, &rgb_b);
}
#include <edgepaint/lab.h>
#include <edgepaint/node_distinct_coloring.h>
-void map_palette_optimal_coloring(char *color_scheme, SparseMatrix A0, double accuracy, int seed,
+void map_palette_optimal_coloring(char *color_scheme, SparseMatrix A0, int seed,
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
color distance on a node is defined as the minimum of color differences between a node and its neighbors.
- accuracy is the threshold given so that when finding the coloring for each node, the optimal is
- with in "accuracy" of the true global optimal.
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
- accuracy: how accurate to find the optimal
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
// color. Ignored if scheme is not COLOR_LAB.
char *lightness = "0,100";
+ // accuracy is the threshold given so that when finding the coloring for each
+ // node, the optimal is with in "accuracy" of the true global optimal.
+ const double accuracy = 0.01;
+
node_distinct_coloring(color_scheme, lightness, weightedQ, A, accuracy, seed,
&cdim, &colors);
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, double accuracy, int seed, 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);
enum {POLY_LINE_REAL_EDGE, POLY_LINE_NOT_REAL_EDGE};
#define neighbor(t, i, edim, elist) elist[(edim)*(t)+i]