chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.web-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
routesearch: rework some things, bugfixes
[ypp-sc-tools.web-test.git]
/
yarrg
/
rsmain.c
diff --git
a/yarrg/rsmain.c
b/yarrg/rsmain.c
index eaa16c54834032a521e887e8c712a88488485745..a784ae383ef3fa521bc86f7c1d1ce929914f2eaf 100644
(file)
--- a/
yarrg/rsmain.c
+++ b/
yarrg/rsmain.c
@@
-21,7
+21,7
@@
FILE *output;
#undef CTR
#undef CTRA
#undef CTR
#undef CTRA
-static
PotentialResul
t ****results[GRANUS];
+static
Bucke
t ****results[GRANUS];
/* results[GRANUS][start_isle_ix][finalisle][midisle]-> */
static pid_t debugoutpid;
/* results[GRANUS][start_isle_ix][finalisle][midisle]-> */
static pid_t debugoutpid;
@@
-41,6
+41,8
@@
int main(int argc, const char **argv) {
#ifndef debug_flags
if (!strcmp(arg,"-DN")) {
debug_flags= 0;
#ifndef debug_flags
if (!strcmp(arg,"-DN")) {
debug_flags= 0;
+ } else if (!strcmp(arg,"-D1")) {
+ debug_flags= ~(dbg_sql2|dbg_lp|dbg_value2);
} else
#endif
{
} else
#endif
{
@@
-126,7
+128,7
@@
int main(int argc, const char **argv) {
else final_isle= atoi(final_isle_spec);
assert(final_isle);
else final_isle= atoi(final_isle_spec);
assert(final_isle);
-
PotentialResul
t ****buckets_base_io[GRANUS];
+
Bucke
t ****buckets_base_io[GRANUS];
for (granui=0; granui<GRANUS; granui++)
buckets_base_io[granui]= &results[granui][resultsix];
for (granui=0; granui<GRANUS; granui++)
buckets_base_io[granui]= &results[granui][resultsix];
@@
-138,9
+140,9
@@
int main(int argc, const char **argv) {
for (granui=0; granui<granus; granui++) {
fprintf(output,"\n");
for (i=0; i<resultsix; i++) {
for (granui=0; granui<granus; granui++) {
fprintf(output,"\n");
for (i=0; i<resultsix; i++) {
- tabdebugf("========== start #%d granui%d %s
[PARTIAL]
==========\n",
+ tabdebugf("========== start #%d granui%d %s ==========\n",
i, granui, argv[i]);
i, granui, argv[i]);
-
PotentialResul
t ***buckets_resultsix= results[granui][i];
+
Bucke
t ***buckets_resultsix= results[granui][i];
if (!buckets_resultsix) continue;
tabdebugf(" ");
for (mid=0; mid<granusz_mid[granui]; mid++) {
if (!buckets_resultsix) continue;
tabdebugf(" ");
for (mid=0; mid<granusz_mid[granui]; mid++) {
@@
-148,17
+150,17
@@
int main(int argc, const char **argv) {
}
tabdebugf("\n");
for (fin=0; fin<granusz_fin[granui]; fin++) {
}
tabdebugf("\n");
for (fin=0; fin<granusz_fin[granui]; fin++) {
-
PotentialResul
t **buckets_fin= buckets_resultsix[fin];
+
Bucke
t **buckets_fin= buckets_resultsix[fin];
if (!buckets_fin) continue;
tabdebugf("f%-3d",fin);
for (mid=0; mid<granusz_mid[granui]; mid++) {
if (!buckets_fin) continue;
tabdebugf("f%-3d",fin);
for (mid=0; mid<granusz_mid[granui]; mid++) {
-
PotentialResul
t *result= buckets_fin[mid];
+
Bucke
t *result= buckets_fin[mid];
if (!result) {
tabdebugf("| ");
} else {
if (!result) {
tabdebugf("| ");
} else {
- tabdebugf("|%5d",(int)(result->value[A]));
+ tabdebugf("|%5d",(int)(result->
prs[A].
value[A]));
tabdebugf(" ");
tabdebugf(" ");
- tabdebugf("%4d",(int)(result->value[P]));
+ tabdebugf("%4d",(int)(result->
prs[P].
value[P]));
}
}
tabdebugf("\n");
}
}
tabdebugf("\n");
@@
-171,9
+173,10
@@
int main(int argc, const char **argv) {
granui, ap);
for (pos=nhighscores[granui][ap]-1; pos>=0; pos--) {
HighScoreEntry *hs= &highscores[granui][ap][pos];
granui, ap);
for (pos=nhighscores[granui][ap]-1; pos>=0; pos--) {
HighScoreEntry *hs= &highscores[granui][ap][pos];
- PotentialResult *pr= hs->pr;
- if (!pr) continue;
- const int *const ports= pr->ports[ap];
+ Bucket *bucket= hs->bucket;
+ if (!bucket) continue;
+ OnePotentialResult *pr= &bucket->prs[ap];
+ const int *const ports= pr->ports;
int nports;
for (nports=0; nports<MAX_ROUTELEN && ports[nports]>=0; nports++);
int finisle= ports[nports-1];
int nports;
for (nports=0; nports<MAX_ROUTELEN && ports[nports]>=0; nports++);
int finisle= ports[nports-1];