void improve_antibandwidth_by_swapping(SparseMatrix A, int *p){
int improved = TRUE;
- int n = A->m, i, j, *ia = A->ia, *ja = A->ja;
+ int cnt = 1, n = A->m, i, j, *ia = A->ia, *ja = A->ja;
real norm = n, norm1[3], norm2[3], norm11[3], norm22[3];
real pi, pj;
real start = clock();
}
if (Verbose) {
get_12_norm(n, ia, ja, p, norm1);
- fprintf(stderr, "aband = %f, aband_avg = %f\n", norm1[0], norm1[2]);
+ fprintf(stderr, "[%d] aband = %f, aband_avg = %f\n", cnt++, norm1[0], norm1[2]);
fprintf(fp,"%f %f %f\n", (real) (clock() - start)/(CLOCKS_PER_SEC), norm1[0], norm1[2]);
}
}
10 : light grey\n\
-c_opacity=xx - 2-character hex string for opacity of polygons\n\
-C k - generate at most k clusters. (0)\n\
- -d s - seed used to calculate Fielder vector for optimal coloring\n\
+ -d s - seed used to calculate Fiedler vector for optimal coloring\n\
-D - use top-level cluster subgraphs to specify clustering\n\
-e - show edges\n\
-g c - bounding box color. If not specified, a bounding box is not drawn.\n\
-h k - number of artificial points added to maintain bridge between endpoints (0)\n\
-highlight=k - only draw cluster k\n\
- -k - increase randomesss of boundary\n\
+ -k - increase randomness of boundary\n\
-l s - specify label\n\
-m v - bounding box margin. If 0, auto-assigned (0)\n\
-o <file> - put output in <file> (stdout)\n\
2 : label points\n\
3 : random/artificial points\n\
-r k - number of random points k used to define sea and lake boundaries. If 0, auto assigned. (0)\n\
- -s v - depth of the sea and lake shores in points. If 0, auto assigned. (0)\n\
+ -s v - depth of the sea and lake shores in points. If < 0, auto assigned. (0)\n\
-t n - improve contiguity up to n times. (0)\n\
-v - verbose\n\
-z c - polygon line color (black)\n";
pm->shore_depth_tol, edge_bridge_tol, &xcombined, &nverts, &x_poly, &npolys, &poly_lines,
&polys, &polys_groups, &poly_point_map, &country_graph, pm->highlight_cluster, &flag);
+ if (Verbose) fprintf(stderr,"nart = %d\n",nart);
/* compute a good color permutation */
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);
int flag;
int n = A0->m, i, cdim;
- SparseMatrix A, B;
+ SparseMatrix A;
int weightedQ = TRUE;
int iter_max = 100;
}
}
- if (Verbose || 1) fprintf(stderr,"ratio (edges among discontigous regions vs total edges)=%f\n",((real) nbad)/ia[n]);
+ if (Verbose) fprintf(stderr,"ratio (edges among discontiguous regions vs total edges)=%f\n",((real) nbad)/ia[n]);
stress_model(dim, D, D, &x, FALSE, maxit, tol, &flag);
assert(!flag);
(groups[comps[comps_ptr[i]]] != GRP_BBOX)) break;
}
ncomps = i + 1;
- if (Verbose) fprintf(stderr," ncomps = %d\n",ncomps);
+ if (Verbose) fprintf(stderr,"ncomps = %d\n",ncomps);
} else {/* alwasy exclud bounding box */
for (i = ncomps - 1; i >= 0; i--) {
if (groups[comps[comps_ptr[i]]] != GRP_BBOX) break;
} else {
*nrandom -= 4;
}
- if (Verbose) fprintf(stderr,"nrandom=%d\n",*nrandom);
-
- if (Verbose) fprintf(stderr,"nrandom=%d\n",*nrandom);
if (shore_depth_tol < 0) shore_depth_tol = sqrt(area/(real) n); /* set to average distance for random distribution */
+ if (Verbose) fprintf(stderr,"nrandom=%d shore_depth_tol=%.08f\n",*nrandom, shore_depth_tol);
/* add artificial points along each edge to avoid as much as possible
xmax[i] += boxsize[i]*(-bounding_box_margin[i]);
}
}
+ if (Verbose) {
+ real bbm0 = bounding_box_margin[0];
+ real bbm1 = bounding_box_margin[1];
+ if (bbm0 > 0)
+ fprintf (stderr, "bounding box margin: %.06f", bbm0);
+ else if (bbm0 == 0)
+ fprintf (stderr, "bounding box margin: %.06f", MAX(boxsize[0]*0.2, 2*shore_depth_tol));
+ else
+ fprintf (stderr, "bounding box margin: (%.06f * %.06f)", boxsize[0], -bbm0);
+ if (bbm1 > 0)
+ fprintf (stderr, " %.06f\n", bbm1);
+ else if (bbm1 == 0)
+ fprintf (stderr, " %.06f\n", MAX(boxsize[1]*0.2, 2*shore_depth_tol));
+ else
+ fprintf (stderr, " (%.06f * %.06f)\n", boxsize[1], -bbm1);
+ }
if (*nrandom < 0) {
real n1, n2, area2;
area2 = (xmax[1] - xmin[1])*(xmax[0] - xmin[0]);
SparseMatrix *country_graph, int highlight_cluster, int *flag){
/* create a list of polygons from a list of rectangles in 2D. rectangles belong to groups. rectangles in the same group that are also close
- gemetrically will be in the same polygon describing the outline of the group. The main difference for this function and
+ geometrically will be in the same polygon describing the outline of the group. The main difference for this function and
make_map_from_point_groups is that in this function, the input are points with width/heights, and we try not to place
- "lakes" inside these rectangles. The is achieved approximately by adding artificial points along the perimeter of the rectangles,
+ "lakes" inside these rectangles. This is achieved approximately by adding artificial points along the perimeter of the rectangles,
as well as near the center.
input:
. If nrandom = 0, no points are inserted, if nrandom < 0, the number is decided automatically.
. On exit, it is the actual number of random points used. The last 4 "random" points is always the
.
- nart: on entry, number of artificla points to be added along rach side of a rectangle enclosing the labels. if < 0, auto-selected.
+ nart: on entry, number of artificial points to be added along each side of a rectangle enclosing the labels. if < 0, auto-selected.
. On exit, actual number of artificial points added.
nedgep: number of artificial points are adding along edges to establish as much as possible a bright between nodes
. connected by the edge, and avoid islands that are connected. k = 0 mean no points.
shore_depth_tol: nrandom random points are inserted in the bounding box of the points,
. such random points are then weeded out if it is within distance of shore_depth_tol from
- . real points. If < 0, auto assigned
+ . real points. If 0, auto assigned
edge_bridge_tol: insert points on edges to give an bridge effect.These points will be evenly spaced
. along each edge, and be less than a distance of edge_bridge_tol from each other and from the two ends of the edge.
. If < 0, -edge_bridge_tol is the average number of points inserted per half edge