calculate inverses

This commit is contained in:
Florian Stecker 2018-01-19 12:25:01 +01:00
parent b144b77206
commit 386387569b
5 changed files with 21 additions and 10 deletions

View File

@ -1,8 +1,8 @@
HEADERS=triangle.h linalg.h queue.h
#SPECIAL_OPTIONS=-O0 -g -D_DEBUG
SPECIAL_OPTIONS=-O0 -g -D_DEBUG
#SPECIAL_OPTIONS=-O3 -pg -funroll-loops -fno-inline
SPECIAL_OPTIONS=-O3 -flto -funroll-loops -Winline
#SPECIAL_OPTIONS=-O3 -flto -funroll-loops -Winline
#SPECIAL_OPTIONS=
OPTIONS=-m64 -march=native -mtune=native -std=gnu99 -D_GNU_SOURCE $(SPECIAL_OPTIONS)

2
main.c
View File

@ -64,7 +64,7 @@ int main(int argc, char *argv[])
// the real action
generate_triangle_group(group, MAX_ELEMENTS, 5, 9, 7);
// initialize_triangle_generators(gen, 1.0/5, 1.0/5, 1.0/5, 1.0); // Fuchsian
initialize_triangle_generators(gen, 3.0/5.0, 5.0/9.0, 3.0/7.0, atof(argv[1]));
initialize_triangle_generators(gen, 3.0/5.0, 3.0/5.0, 3.0/5.0, atof(argv[1]));
gsl_matrix_set_identity(matrices[0]);
for(int i = 1; i < MAX_ELEMENTS; i++)

View File

@ -23,7 +23,7 @@ int generate_triangle_group(groupelement_t *group, int size, int k1, int k2, int
{
queue_t q;
int id, n;
groupelement_t *cur;
groupelement_t *cur, *inv;
int k[3] = {k1, k2, k3};
@ -57,5 +57,15 @@ int generate_triangle_group(groupelement_t *group, int size, int k1, int k2, int
}
}
for(int i = 0; i < size; i++) {
cur = &group[i];
inv = &group[0];
while(cur->parent && inv) {
inv = inv->adj[cur->letter];
cur = cur->parent;
}
group[i].inverse = inv;
}
return n;
}

View File

@ -12,6 +12,7 @@ typedef struct _groupelement {
int length;
struct _groupelement *adj[3];
struct _groupelement *parent;
struct _groupelement *inverse;
int letter;
} groupelement_t;

View File

@ -11,7 +11,7 @@ set yrange [0:20]
set grid
set parametric
plot file using 1:2 w p pt 7 ps 1 lc 1 t ""
plot file using 2:3 w p pt 7 ps 1 lc 1 t ""
pause mouse keypress
if(MOUSE_KEY == 60) param=param-0.02