SparseMatrix_export(stdout, A);
}
- // A = SparseMatrix_multiply(A0, A0);
node_distinct_coloring(color_scheme, lightness, weightedQ, A, accuracy, iter_max, seed, &cdim, &colors, &color_diff, &color_diff_sum, &flag);
if (A != A0){
. If j < n, it is the original point, otherwise it is artificial point (forming the rectangle around a label) or random points.
*/
int i, j, *ia, *ja, u, v;
- //int *ib, *jb;
real *a;
SparseMatrix point_poly_map, D;
real dist;
/* point_poly_map: each row i has only 1 entry at column j, which says that point i is in polygon j */
point_poly_map = SparseMatrix_transpose(poly_point_map);
- // ib = point_poly_map->ia;
- // jb = point_poly_map->ja;
-
-
for (i = 0; i < n; i++){
u = i;
for (j = ia[i]; j < ia[i+1]; j++){
v = ja[j];
dist = distance_cropped(x, dim, u, v);
- /*
- if ((grouping[u] != grouping[v]) || (get_poly_id(u, point_poly_map) == get_poly_id(v, point_poly_map))){
- a[j] = 1.1*dist;
- } else {
- nbad++;
- a[j] = 0.9*dist;
- }
- */
if (grouping[u] != grouping[v]){
a[j] = 1.1*dist;
} else if (get_poly_id(u, point_poly_map) == get_poly_id(v, point_poly_map)){
agattr(gr, AGRAPH, "outputorder", "edgesfirst");
agattr(gr, AGRAPH, "bgcolor", "#dae2ff");
if (!A) agattr(gr, AGEDGE, "style","invis");/* do not plot edges */
- // agedgeattr(gr, "color", "#55555515");
}
/*polygons */
ipoly = 1;
for (i = 0; i < ncomps; i++){
- /*fprintf(stderr, "comp %d has %d members\n",i, comps_ptr[i+1]-comps_ptr[i]);*/
nnt = 0;
for (j = comps_ptr[i]; j < comps_ptr[i+1]; j++){
ii = comps[j];
/* always skip bounding box */
if (groups[ii] == GRP_BBOX) continue;
- /*fprintf(stderr, "member %d is in group %d, it is\n",ii, groups[ii]);*/
for (jj = ie[ii]; jj < ie[ii+1]; jj++){
- /*
- fprintf(stderr, "connected with %d in group %d\n",je[jj], groups[je[jj]]);
- fprintf(stderr, "jj=%d nz = %d je[jj]=%d je[jj+1]=%d\n",jj,nz, je[jj],je[jj+1]);
- */
if (groups[je[jj]] != groups[ii] && jj < nz - 1 && je[jj] == je[jj+1]){/* an triangle edge neighboring 2 triangles and two ends not in the same groups */
t1 = e[jj];
t2 = e[jj+1];
} else if (shore_depth_tol == 0){
real area;
get_boundingbox(n, dim, x, sizes, bbox);
- //shore_depth_tol = MIN(bbox[1] - bbox[0], bbox[3] - bbox[2])*0.05;
area = (bbox[1] - bbox[0])*(bbox[3] - bbox[2]);
shore_depth_tol = sqrt(area/(real) n);
if (Verbose) fprintf(stderr,"setting shore length ======%f\n",shore_depth_tol);
} else {
- /*
- get_boundingbox(n, dim, x, sizes, bbox);
- shore_depth_tol = MIN(bbox[1] - bbox[0], bbox[3] - bbox[2])*shore_depth_tol;
- */
-
}
/* add artificial points in an anti-clockwise fashion */