dominant weights
This commit is contained in:
parent
d3336bab00
commit
69d975bac9
10
Makefile
10
Makefile
@ -7,7 +7,7 @@ SPECIAL_OPTIONS=-O3 -flto -funroll-loops -Winline
|
||||
OPTIONS=-m64 -march=native -mtune=native -std=gnu99 -D_GNU_SOURCE $(SPECIAL_OPTIONS)
|
||||
NAME=enumerate-balanced-ideals
|
||||
|
||||
all: enumerate graph D2n
|
||||
all: enumerate graph D2n dominant_weights
|
||||
|
||||
$(NAME).tar.bz2: $(NAME) $(HEADERS) enumerate.c weyl.c thickenings.c
|
||||
tar cjhf $(NAME).tar.bz2 $(NAME)/enumerate.c $(NAME)/weyl.c $(NAME)/thickenings.c $(NAME)/weyl.h $(NAME)/thickenings.h $(NAME)/queue.h $(NAME)/bitvec.h $(NAME)/Makefile $(NAME)/graph.c
|
||||
@ -24,6 +24,9 @@ graph: graph.o weyl.o
|
||||
D2n: D2n.o weyl.o thickenings.o
|
||||
gcc $(OPTIONS) -o D2n D2n.o weyl.o thickenings.o
|
||||
|
||||
dominant_weights: dominant_weights.o weyl.o
|
||||
gcc $(OPTIONS) -o dominant_weights dominant_weights.o weyl.o
|
||||
|
||||
enumerate.o: enumerate.c $(HEADERS)
|
||||
gcc $(OPTIONS) -c enumerate.c
|
||||
|
||||
@ -39,5 +42,8 @@ weyl.o: weyl.c $(HEADERS)
|
||||
graph.o: graph.c $(HEADERS)
|
||||
gcc $(OPTIONS) -c graph.c
|
||||
|
||||
dominant_weights.o: dominant_weights.c $(HEADERS)
|
||||
gcc $(OPTIONS) -c dominant_weights.c
|
||||
|
||||
clean:
|
||||
rm -f enumerate graph D2n thickenings.o weyl.o enumerate.o graph.o D2n.o $(NAME) $(NAME).tar.bz2
|
||||
rm -f enumerate graph D2n dominant_weights thickenings.o weyl.o enumerate.o graph.o D2n.o dominant_weights.o $(NAME) $(NAME).tar.bz2
|
||||
|
69
dominant_weights.c
Normal file
69
dominant_weights.c
Normal file
@ -0,0 +1,69 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include "weyl.h"
|
||||
|
||||
static char* alphabetize(weylgroup_element_t *e, char *str)
|
||||
{
|
||||
if(e->wordlength == 0)
|
||||
sprintf(str, "1");
|
||||
else {
|
||||
for(int j = 0; j < e->wordlength; j++)
|
||||
str[j] = e->word[j] + 'a';
|
||||
str[e->wordlength] = 0;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
static int apply_reflection(double *in, double *out, int rank, int reflection)
|
||||
{
|
||||
memcpy(out, in, rank*sizeof(double));
|
||||
out[reflection] *= -1;
|
||||
if(reflection != 0)
|
||||
out[reflection-1] += in[reflection];
|
||||
if(reflection != rank-1)
|
||||
out[reflection+1] += in[reflection];
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
semisimple_type_t type;
|
||||
simple_type_t simple;
|
||||
doublequotient_t *dq;
|
||||
double *vector;
|
||||
char buf[1000];
|
||||
|
||||
type.n = 1;
|
||||
type.factors = &simple;
|
||||
simple.series = 'A';
|
||||
simple.rank = 3;
|
||||
|
||||
dq = weyl_generate_bruhat(type, 0, 0);
|
||||
|
||||
int order = weyl_order(type);
|
||||
int rank = weyl_rank(type);
|
||||
weylgroup_element_t *group = dq->group;
|
||||
vector = malloc(weyl_order(type)*weyl_rank(type)*sizeof(double));
|
||||
|
||||
for(int i = 0; i < rank; i++) {
|
||||
vector[i] = 1.0;
|
||||
}
|
||||
|
||||
for(int i = 0; i < order; i++) {
|
||||
printf("%s %.2f %.2f %.2f\n", alphabetize(&group[i], buf),
|
||||
1.0/4.0*(3*vector[3*i] + 2*vector[3*i+1] + 1*vector[3*i+2]),
|
||||
1.0/4.0*(2*vector[3*i] + 4*vector[3*i+1] + 2*vector[3*i+2]),
|
||||
1.0/4.0*(1*vector[3*i] + 2*vector[3*i+1] + 3*vector[3*i+2]));
|
||||
|
||||
for(int j = 0; j < rank; j++)
|
||||
if(group[i].left[j]->wordlength > group[i].wordlength)
|
||||
apply_reflection(&vector[3*i], &vector[3*group[i].left[j]->index], rank, j);
|
||||
}
|
||||
|
||||
weyl_destroy_bruhat(dq);
|
||||
free(vector);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user