chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.web-test.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
95738a6
)
Ignore size of connected component when assigning labels (some arches have no purchas...
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 1 Sep 2009 15:20:29 +0000
(16:20 +0100)
committer
Ian Jackson
<Ian.Jackson@eu.citrix.com>
Tue, 1 Sep 2009 15:20:29 +0000
(16:20 +0100)
yarrg/yppedia-chart-parser
patch
|
blob
|
history
diff --git
a/yarrg/yppedia-chart-parser
b/yarrg/yppedia-chart-parser
index dacf5c354725fd017a8f930c4991693463329f6c..a093a0cec965dba77827a3641af83f9563295ec5 100755
(executable)
--- a/
yarrg/yppedia-chart-parser
+++ b/
yarrg/yppedia-chart-parser
@@
-242,8
+242,7
@@
sub yppedia_archs_chart_labels () {
#
foreach my $label (@wiarchlabels) {
my ($ax,$ay,$arch) = @$label;
#
foreach my $label (@wiarchlabels) {
my ($ax,$ay,$arch) = @$label;
- my $best_ccmulti= -1;
- my $best_d2= 0;
+ my $best_d2= 9999999;
my $best_n;
# print DEBUG "$ax,$ay arch-island-search $arch\n";
$ay += 1; $ax += 2; # coords are rather to the top left of label
my $best_n;
# print DEBUG "$ax,$ay arch-island-search $arch\n";
$ay += 1; $ax += 2; # coords are rather to the top left of label
@@
-251,19
+250,16
@@
sub yppedia_archs_chart_labels () {
next unless exists $winode2island{$vertex};
my $ccix= $wiarchs->connected_component_by_vertex($vertex);
my @cc= $wiarchs->connected_component_by_index($ccix);
next unless exists $winode2island{$vertex};
my $ccix= $wiarchs->connected_component_by_vertex($vertex);
my @cc= $wiarchs->connected_component_by_index($ccix);
- my $ccmulti= @cc > 1;
my ($vx,$vy) = split /,/, $vertex;
my $d2= ($vx-$ax)*($vx-$ax) + ($vy-$ay)*($vy-$ay);
my ($vx,$vy) = split /,/, $vertex;
my $d2= ($vx-$ax)*($vx-$ax) + ($vy-$ay)*($vy-$ay);
- my $cmp= $ccmulti <=> $best_ccmulti
- || $best_d2 <=> $d2;
+ my $cmp= $best_d2 <=> $d2;
printf DEBUG "%2d,%-2d arch-island-search %5s d2=%4d cc%-2d".
printf DEBUG "%2d,%-2d arch-island-search %5s d2=%4d cc%-2d".
- " #cc=%2d c
cmulti=%d c
mp=%2d %s\n",
- $ax,$ay, $vertex, $d2, $ccix, scalar(@cc), $c
cmulti, $c
mp,
+ " #cc=%2d cmp=%2d %s\n",
+ $ax,$ay, $vertex, $d2, $ccix, scalar(@cc), $cmp,
$winode2island{$vertex};
next unless $cmp > 0;
$best_n= $vertex;
$best_d2= $d2;
$winode2island{$vertex};
next unless $cmp > 0;
$best_n= $vertex;
$best_d2= $d2;
- $best_ccmulti= $ccmulti;
}
die 'no island vertices?!' unless defined $best_n;
my $ccix= $wiarchs->connected_component_by_vertex($best_n);
}
die 'no island vertices?!' unless defined $best_n;
my $ccix= $wiarchs->connected_component_by_vertex($best_n);