some output changes

This commit is contained in:
Florian Stecker 2016-12-02 10:31:31 +01:00
parent 1e0959b7ce
commit 1c65abd735
2 changed files with 35 additions and 8 deletions

View File

@ -19,6 +19,7 @@ typedef struct {
unsigned long right_invariance; unsigned long right_invariance;
const char *alphabet; const char *alphabet;
int *buffer; int *buffer;
int level;
} info_t; } info_t;
int shorten(int i, unsigned long left, unsigned long right, node_t *graph, int rank) int shorten(int i, unsigned long left, unsigned long right, node_t *graph, int rank)
@ -67,7 +68,7 @@ void balanced_thickening_callback(const bitvec_t *pos, int size, void *data)
} }
} }
printf("left: "); printf("%4d left: ", totcount++);
for(int j = 0; j < info->rank; j++) for(int j = 0; j < info->rank; j++)
printf("%c", left_invariance & (1 << j) ? info->alphabet[j] : ' '); printf("%c", left_invariance & (1 << j) ? info->alphabet[j] : ' ');
printf(" right: "); printf(" right: ");
@ -120,17 +121,30 @@ void balanced_thickening_callback(const bitvec_t *pos, int size, void *data)
} }
} }
} }
if(info->level >= 5) {
printf(" ids: [0");
for(int i = 1; i < size/2; i++)
if(bv_get_bit(pos, i))
printf(", %d", info->graph[i].id);
for(int i = 0; i < size/2; i++)
if(!bv_get_bit(pos, i))
printf(", %d", info->graph[size-1-i].id);
printf("]");
}
} }
printf("\n"); printf("\n");
} }
}
/* void balanced_thickening_simple_callback(const bitvec_t *pos, int size, void *data)
if((++totcount) % 100000000 == 0) { {
fprintf(stderr, "Found balanced ideal: "); long *count = (long*)data;
if((++(*count)) % 100000000 == 0) {
bv_print(stderr, pos, size/2); bv_print(stderr, pos, size/2);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} */ }
} }
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
@ -192,7 +206,6 @@ int main(int argc, const char *argv[])
hyperplanes = weyl_hyperplanes(type); // number of positive roots hyperplanes = weyl_hyperplanes(type); // number of positive roots
if(output_level >= 1) { if(output_level >= 1) {
printf("Poset: ");
if(left_invariance) { if(left_invariance) {
printf("<"); printf("<");
for(int j = 0; j < rank; j++) for(int j = 0; j < rank; j++)
@ -287,15 +300,17 @@ int main(int argc, const char *argv[])
info.right_invariance = right_invariance; info.right_invariance = right_invariance;
info.alphabet = alphabet; info.alphabet = alphabet;
info.buffer = buffer; info.buffer = buffer;
info.level = output_level;
long count; long count;
if(output_level >= 2) { if(output_level >= 2) {
fprintf(stdout, "Balanced ideals:\n", count); fprintf(stdout, "Balanced ideals:\n", count);
count = enumerate_balanced_thickenings(graph, cosets, balanced_thickening_callback, &info); count = enumerate_balanced_thickenings(graph, cosets, balanced_thickening_callback, &info);
fprintf(stdout, "\n", count); fprintf(stdout, "\n", count);
} else {
long outputcount = 0;
count = enumerate_balanced_thickenings(graph, cosets, balanced_thickening_simple_callback, &outputcount);
} }
else
count = enumerate_balanced_thickenings(graph, cosets, 0, 0);
if(output_level >= 1) if(output_level >= 1)

View File

@ -424,6 +424,7 @@ int prepare_simplified_graph(semisimple_type_t type, unsigned long left, unsigne
memcpy(simplified_graph[simplified[i]].word, full_graph[i].word, full_graph[i].wordlength*sizeof(int)); memcpy(simplified_graph[simplified[i]].word, full_graph[i].word, full_graph[i].wordlength*sizeof(int));
simplified_graph[simplified[i]].wordlength = full_graph[i].wordlength; simplified_graph[simplified[i]].wordlength = full_graph[i].wordlength;
simplified_graph[simplified[i]].opposite = simplified[full_graph[i].opposite]; simplified_graph[simplified[i]].opposite = simplified[full_graph[i].opposite];
simplified_graph[simplified[i]].id = full_graph[i].id;
simplified_graph[simplified[i]].bruhat_lower = (edgelist_t*)0; simplified_graph[simplified[i]].bruhat_lower = (edgelist_t*)0;
simplified_graph[simplified[i]].bruhat_higher = (edgelist_t*)0; simplified_graph[simplified[i]].bruhat_higher = (edgelist_t*)0;
for(int j = 0; j < rank; j++) { for(int j = 0; j < rank; j++) {
@ -746,6 +747,17 @@ long enumerate_balanced_thickenings(node_t *graph, int size, void (*callback) (c
if(bv_get_bit(&info.principal_pos[i], j)) if(bv_get_bit(&info.principal_pos[i], j))
info.principal_is_slim[i] = 0; info.principal_is_slim[i] = 0;
} }
#ifdef _DEBUG
if(info.principal_is_slim[i]) {
fprintf(stderr, " ids: [0");
for(int j = 1; j < info.size; j++)
if(principal[j])
fprintf(stderr, ", %d", graph[j].id);
fprintf(stderr, "]\n");
}
#endif
} }
free(principal); free(principal);