some output changes
This commit is contained in:
		
							
								
								
									
										31
									
								
								generate.c
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								generate.c
									
									
									
									
									
								
							@@ -19,6 +19,7 @@ typedef struct {
 | 
			
		||||
  unsigned long right_invariance;
 | 
			
		||||
  const char *alphabet;
 | 
			
		||||
  int *buffer;
 | 
			
		||||
  int level;
 | 
			
		||||
} info_t;
 | 
			
		||||
 | 
			
		||||
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++)
 | 
			
		||||
      printf("%c", left_invariance & (1 << j) ? info->alphabet[j] : ' ');
 | 
			
		||||
    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");
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  /*
 | 
			
		||||
  if((++totcount) % 100000000 == 0) {
 | 
			
		||||
    fprintf(stderr, "Found balanced ideal: ");
 | 
			
		||||
void balanced_thickening_simple_callback(const bitvec_t *pos, int size, void *data)
 | 
			
		||||
{
 | 
			
		||||
  long *count = (long*)data;
 | 
			
		||||
 | 
			
		||||
  if((++(*count)) % 100000000 == 0) {
 | 
			
		||||
    bv_print(stderr, pos, size/2);
 | 
			
		||||
    fprintf(stderr, "\n");
 | 
			
		||||
    } */
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
  if(output_level >= 1) {
 | 
			
		||||
    printf("Poset: ");
 | 
			
		||||
    if(left_invariance) {
 | 
			
		||||
      printf("<");
 | 
			
		||||
      for(int j = 0; j < rank; j++)
 | 
			
		||||
@@ -287,15 +300,17 @@ int main(int argc, const char *argv[])
 | 
			
		||||
    info.right_invariance = right_invariance;
 | 
			
		||||
    info.alphabet = alphabet;
 | 
			
		||||
    info.buffer = buffer;
 | 
			
		||||
    info.level = output_level;
 | 
			
		||||
 | 
			
		||||
    long count;
 | 
			
		||||
    if(output_level >= 2) {
 | 
			
		||||
      fprintf(stdout, "Balanced ideals:\n", count);
 | 
			
		||||
      count = enumerate_balanced_thickenings(graph, cosets, balanced_thickening_callback, &info);
 | 
			
		||||
      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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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));
 | 
			
		||||
      simplified_graph[simplified[i]].wordlength = full_graph[i].wordlength;
 | 
			
		||||
      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_higher = (edgelist_t*)0;
 | 
			
		||||
      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))
 | 
			
		||||
	  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);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user