Major rewrite

This commit is contained in:
Florian Stecker
2017-01-27 20:48:44 +01:00
parent ab546946c8
commit efd8e621ea
6 changed files with 641 additions and 893 deletions

94
weyl.h
View File

@@ -3,34 +3,92 @@
#include <inttypes.h>
typedef struct {
char series;
int rank;
} simple_type_t;
typedef struct {
int n;
simple_type_t *factors;
} semisimple_type_t;
struct _simple_type;
struct _semisimple_type;
struct _weylgroup_element;
struct _weylgroup;
struct _doublecoset;
struct _doublecoset_list;
struct _doublequotient;
typedef uint64_t weylid_t;
typedef struct _simple_type simple_type_t;
typedef struct _semisimple_type semisimple_type_t;
typedef struct _weylgroup_element weylgroup_element_t;
typedef struct _weylgroup weylgroup_t;
typedef struct _doublecoset doublecoset_t;
typedef struct _doublecoset_list doublecoset_list_t;
typedef struct _doublequotient doublequotient_t;
typedef struct {
int *left;
int *right;
int opposite;
/***************************** structures *******************************/
struct _simple_type {
char series;
int rank;
};
struct _semisimple_type {
int n;
simple_type_t *factors;
};
struct _weylgroup_element {
int *word;
int wordlength;
weylgroup_element_t **left;
weylgroup_element_t **right;
weylgroup_element_t *opposite;
int is_root_reflection; // boolean value
weylid_t id;
} weylgroup_element_t;
// only set if quotient is generated
doublecoset_t *coset;
};
struct _weylgroup {
semisimple_type_t type;
weylgroup_element_t *elements;
weylgroup_element_t **lists;
int *letters;
};
struct _doublecoset {
doublecoset_list_t *bruhat_lower;
doublecoset_list_t *bruhat_higher;
doublecoset_t *opposite;
weylgroup_element_t *max;
weylgroup_element_t *min;
};
struct _doublecoset_list {
doublecoset_t *to;
doublecoset_list_t *next;
};
struct _doublequotient {
semisimple_type_t type;
int left_invariance; // bitmask with rank bits
int right_invariance;
int count; // number of cosets
doublecoset_t *cosets;
weylgroup_element_t *group;
doublecoset_list_t *lists; // only for memory allocation / freeing
weylgroup_element_t **grouplists; // only for memory allocation / freeing
int *groupletters; // only for memory allocation / freeing
};
/***************************** functions **************************************/
int weyl_rank(semisimple_type_t type);
int weyl_order(semisimple_type_t type);
int weyl_hyperplanes(semisimple_type_t type);
int weyl_positive(semisimple_type_t type);
void weyl_cartan_matrix(semisimple_type_t type, int *m);
int weyl_opposition(semisimple_type_t type, int simple_root);
weylgroup_element_t *weyl_alloc(semisimple_type_t type);
void weyl_free(weylgroup_element_t *x);
weylgroup_t *weyl_generate(semisimple_type_t type);
void weyl_destroy(weylgroup_t *group);
void weyl_generate(semisimple_type_t type, weylgroup_element_t *group);
doublequotient_t *weyl_generate_bruhat(semisimple_type_t type, int left_invariance, int right_invariance);
void weyl_destroy_bruhat(doublequotient_t *dq);
#endif