Valid Weyl group check cleanup
This commit is contained in:
parent
32d0dc8da1
commit
ab546946c8
@ -165,7 +165,7 @@ int main(int argc, const char *argv[])
|
||||
|
||||
type.n = 0;
|
||||
for(int i = 0; i < argc - 1; i++) {
|
||||
if(argv[i+1][0] < 'A' || argv[i+1][0] > 'I')
|
||||
if(argv[i+1][0] < 'A' || argv[i+1][0] > 'G')
|
||||
break;
|
||||
type.n++;
|
||||
}
|
||||
@ -174,7 +174,7 @@ int main(int argc, const char *argv[])
|
||||
for(int i = 0; i < type.n; i++) {
|
||||
type.factors[i].series = argv[i+1][0];
|
||||
type.factors[i].rank = argv[i+1][1] - '0';
|
||||
ERROR(argv[i+1][0] < 'A' || argv[i+1][0] > 'I' || argv[i+1][1] < '1' || argv[i+1][1] > '9', "Arguments must be Xn with X out of A-I and n out of 0-9\n");
|
||||
ERROR(argv[i+1][0] < 'A' || argv[i+1][0] > 'I' || argv[i+1][1] < '1' || argv[i+1][1] > '9', "Arguments must be Xn with X out of A-G and n out of 1-9\n");
|
||||
}
|
||||
|
||||
left_invariance = right_invariance = 0;
|
||||
|
56
weyl.c
56
weyl.c
@ -110,6 +110,20 @@ static void reflect_root_vector(const int *cartan, int rank, int i, int *old, in
|
||||
|
||||
/************* Weyl group infos ************************/
|
||||
|
||||
static int weyl_exists(simple_type_t type)
|
||||
{
|
||||
if(type.series < 'A' || type.series > 'G' || type.rank < 1 ||
|
||||
type.series == 'B' && type.rank < 2 ||
|
||||
type.series == 'C' && type.rank < 2 ||
|
||||
type.series == 'D' && type.rank < 3 ||
|
||||
type.series == 'E' && type.rank != 6 && type.rank != 7 && type.rank != 8 ||
|
||||
type.series == 'F' && type.rank != 4 ||
|
||||
type.series == 'G' && type.rank != 2)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
int weyl_rank(semisimple_type_t type)
|
||||
{
|
||||
int rank = 0;
|
||||
@ -122,8 +136,9 @@ int weyl_order(semisimple_type_t type)
|
||||
{
|
||||
int order = 1;
|
||||
for(int i = 0; i < type.n; i++) {
|
||||
switch(type.factors[i].series) {
|
||||
ERROR(!weyl_exists(type.factors[i]), "A Weyl group of type %c%d does not exist!\n", type.factors[i].series, type.factors[i].rank);
|
||||
|
||||
switch(type.factors[i].series) {
|
||||
case 'A':
|
||||
for(int j = 1; j <= type.factors[i].rank + 1; j++)
|
||||
order *= j;
|
||||
@ -146,22 +161,15 @@ int weyl_order(semisimple_type_t type)
|
||||
order *= 2903040;
|
||||
else if(type.factors[i].rank == 8)
|
||||
order *= 696729600;
|
||||
else
|
||||
ERROR(1, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[i].series, type.factors[i].rank);
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
ERROR(type.factors[i].rank != 4, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[i].series, type.factors[i].rank);
|
||||
order *= 1152;
|
||||
break;
|
||||
|
||||
case 'G':
|
||||
ERROR(type.factors[i].rank != 2, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[i].series, type.factors[i].rank);
|
||||
order *= 12;
|
||||
break;
|
||||
|
||||
default:
|
||||
ERROR(1, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[i].series, type.factors[i].rank);
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,6 +181,8 @@ int weyl_hyperplanes(semisimple_type_t type)
|
||||
int hyperplanes = 0;
|
||||
|
||||
for(int i = 0; i < type.n; i++) {
|
||||
ERROR(!weyl_exists(type.factors[i]), "A Weyl group of type %c%d does not exist!\n", type.factors[i].series, type.factors[i].rank);
|
||||
|
||||
switch(type.factors[i].series) {
|
||||
case 'A':
|
||||
hyperplanes += (type.factors[i].rank * (type.factors[i].rank + 1)) / 2;
|
||||
@ -193,22 +203,15 @@ int weyl_hyperplanes(semisimple_type_t type)
|
||||
hyperplanes += 63;
|
||||
else if(type.factors[i].rank == 8)
|
||||
hyperplanes += 120;
|
||||
else
|
||||
ERROR(1, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[i].series, type.factors[i].rank);
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
ERROR(type.factors[i].rank != 4, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[i].series, type.factors[i].rank);
|
||||
hyperplanes += 24;
|
||||
break;
|
||||
|
||||
case 'G':
|
||||
ERROR(type.factors[i].rank != 2, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[i].series, type.factors[i].rank);
|
||||
hyperplanes += 6;
|
||||
break;
|
||||
|
||||
default:
|
||||
ERROR(1, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[i].series, type.factors[i].rank);
|
||||
}
|
||||
}
|
||||
|
||||
@ -228,6 +231,8 @@ int weyl_opposition(semisimple_type_t type, int simple_root)
|
||||
offset += type.factors[factor].rank;
|
||||
r = simple_root - offset;
|
||||
|
||||
ERROR(!weyl_exists(type.factors[factor]), "A Weyl group of type %c%d does not exist!\n", type.factors[factor].series, type.factors[factor].rank);
|
||||
|
||||
switch(type.factors[factor].series) {
|
||||
case 'B': case 'C': case 'F': case 'G':
|
||||
iota_r = r;
|
||||
@ -250,9 +255,6 @@ int weyl_opposition(semisimple_type_t type, int simple_root)
|
||||
else
|
||||
iota_r = r == 3 || r == 4 ? r : 5 - r;
|
||||
break;
|
||||
|
||||
default:
|
||||
ERROR(1, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[factor].series, type.factors[factor].rank);
|
||||
}
|
||||
|
||||
return iota_r + offset;
|
||||
@ -270,6 +272,8 @@ void weyl_cartan_matrix(semisimple_type_t type, int *m)
|
||||
m[i*rank+i] = 2;
|
||||
|
||||
for(int k = 0; k < type.n; k++) {
|
||||
ERROR(!weyl_exists(type.factors[k]), "A Weyl group of type %c%d does not exist!\n", type.factors[k].series, type.factors[k].rank);
|
||||
|
||||
for(int i = 0; i < type.factors[k].rank; i++) // A is the submatrix corresponding to the current simple factor
|
||||
A[i] = &m[(i+offset)*rank + offset];
|
||||
|
||||
@ -278,45 +282,29 @@ void weyl_cartan_matrix(semisimple_type_t type, int *m)
|
||||
A[i-1][i] = -1;
|
||||
}
|
||||
|
||||
|
||||
switch(type.factors[k].series) {
|
||||
case 'A':
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
ERROR(type.factors[k].rank < 2, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[k].series, type.factors[k].rank);
|
||||
A[0][1] = -2;
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
ERROR(type.factors[k].rank < 2, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[k].series, type.factors[k].rank);
|
||||
A[1][0] = -2;
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
ERROR(type.factors[k].rank < 3, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[k].series, type.factors[k].rank);
|
||||
A[0][1] = A[1][0] = 0;
|
||||
A[0][2] = A[2][0] = -1;
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
ERROR(type.factors[k].rank < 6 || type.factors[k].rank > 8, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[k].series, type.factors[k].rank);
|
||||
A[1][2] = A[2][1] = 0;
|
||||
A[1][3] = A[3][1] = -1;
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
ERROR(type.factors[k].rank != 4, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[k].series, type.factors[k].rank);
|
||||
A[3][2] = -2;
|
||||
break;
|
||||
|
||||
case 'G':
|
||||
ERROR(type.factors[k].rank != 2, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[k].series, type.factors[k].rank);
|
||||
A[1][0] = -3;
|
||||
break;
|
||||
|
||||
default:
|
||||
ERROR(1, "A Weyl group of type %c%d does not exist or is not implemented!\n", type.factors[k].series, type.factors[k].rank);
|
||||
}
|
||||
|
||||
offset += type.factors[k].rank;
|
||||
|
Loading…
Reference in New Issue
Block a user