Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
G
graphviz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
graphviz
graphviz
Commits
e4db68ec
Commit
e4db68ec
authored
10 years ago
by
Emden R. Gansner
Browse files
Options
Downloads
Patches
Plain Diff
Clean up text messages; add more verbose information
parent
d01ad299
No related branches found
No related tags found
Loading
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmd/gvmap/country_graph_coloring.c
+2
-2
2 additions, 2 deletions
cmd/gvmap/country_graph_coloring.c
cmd/gvmap/gvmap.c
+4
-3
4 additions, 3 deletions
cmd/gvmap/gvmap.c
cmd/gvmap/make_map.c
+24
-10
24 additions, 10 deletions
cmd/gvmap/make_map.c
with
30 additions
and
15 deletions
cmd/gvmap/country_graph_coloring.c
+
2
−
2
View file @
e4db68ec
...
...
@@ -226,7 +226,7 @@ void improve_antibandwidth_by_swapping_cheap(SparseMatrix A, int *p){
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
();
...
...
@@ -268,7 +268,7 @@ void improve_antibandwidth_by_swapping(SparseMatrix A, int *p){
}
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
]);
}
}
...
...
This diff is collapsed.
Click to expand it.
cmd/gvmap/gvmap.c
+
4
−
3
View file @
e4db68ec
...
...
@@ -196,13 +196,13 @@ static char* usestr =
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 Fie
l
der vector for optimal coloring
\n
\
-d s - seed used to calculate Fied
l
er 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 randome
s
ss of boundary
\n
\
-k - increase random
n
ess 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
\
...
...
@@ -213,7 +213,7 @@ static char* usestr =
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
"
;
...
...
@@ -566,6 +566,7 @@ makeMap (SparseMatrix graph, int n, real* x, real* width, int* grouping,
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
);
...
...
This diff is collapsed.
Click to expand it.
cmd/gvmap/make_map.c
+
24
−
10
View file @
e4db68ec
...
...
@@ -60,7 +60,7 @@ void map_palette_optimal_coloring(char *color_scheme, char *lightness, SparseMat
int
flag
;
int
n
=
A0
->
m
,
i
,
cdim
;
SparseMatrix
A
,
B
;
SparseMatrix
A
;
int
weightedQ
=
TRUE
;
int
iter_max
=
100
;
...
...
@@ -170,7 +170,7 @@ void improve_contiguity(int n, int dim, int *grouping, SparseMatrix poly_point_m
}
}
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 discontig
u
ous regions vs total edges)=%f
\n
"
,((
real
)
nbad
)
/
ia
[
n
]);
stress_model
(
dim
,
D
,
D
,
&
x
,
FALSE
,
maxit
,
tol
,
&
flag
);
assert
(
!
flag
);
...
...
@@ -1712,7 +1712,7 @@ static void get_polygons(int exclude_random, int n, int nrandom, int dim, Sparse
(
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
;
...
...
@@ -1802,11 +1802,9 @@ int make_map_internal(int exclude_random, int include_OK_points,
}
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
...
...
@@ -1867,6 +1865,22 @@ int make_map_internal(int exclude_random, int include_OK_points,
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
]);
...
...
@@ -2128,9 +2142,9 @@ int make_map_from_rectangle_groups(int exclude_random, int include_OK_points,
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
ge
o
metrically 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. Th
e
is achieved approximately by adding artificial points along the perimeter of the rectangles,
"lakes" inside these rectangles. Th
is
is achieved approximately by adding artificial points along the perimeter of the rectangles,
as well as near the center.
input:
...
...
@@ -2149,13 +2163,13 @@ int make_map_from_rectangle_groups(int exclude_random, int include_OK_points,
. 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 artificl
a
points to be added along
r
ach side of a rectangle enclosing the labels. if < 0, auto-selected.
nart: on entry, number of artific
ia
l points to be added along
e
ach 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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment