Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

563595 views
1
/***** Main program for the isometry program ISOM *****/
2
/**************************************************************************\
3
@---------------------------------------------------------------------------
4
@---------------------------------------------------------------------------
5
@ FILE: pr_isom.c
6
@---------------------------------------------------------------------------
7
@---------------------------------------------------------------------------
8
@
9
\**************************************************************************/
10
11
#include"typedef.h"
12
#include "types.h"
13
14
static int normal_option;
15
static int perp_no;
16
static int ***perp;
17
static int perpdim;
18
static int ***perpbase;
19
static int ***perpprod;
20
static int *perpvec;
21
/*
22
@-------------------------------------------------------------------------
23
@ matrix_TYP *pr_isom(F1, F2, Fanz, Erz, Erzanz, options)
24
@ matrix_TYP **F1, **F2, **Erz;
25
@ int Fanz, Erzanz, *options;
26
@
27
@ The function 'isometry' calculates a matrix X such that
28
@ X * F1[i] *X^{tr} = F2[i] for 1<= i<= Foanz
29
@ returned via a pointer to 'matrix_TYP'.
30
@ If no such matrix exists the functions returns NULL
31
@ 'pr_aut' applies a pair_reduction to F1[0] and then
32
@ uses then the function isometry to calculate an isometry
33
@ for the reduced form
34
@
35
@ The arguments of isometry are:
36
@ matrix_TYP **F1: a set of n times n matrices,
37
@ the first must be positiv definite
38
@ matrix_TYP **F2: a set of n times n matrices,
39
@ the first must be positiv definite
40
@ int Fanz: the number of the matrices given in 'F1'.
41
@ int *options: see below.
42
@ matrix_TYP **Erz: if already elements with g^{tr}F1[i]g = F2[i]
43
@ are known, the can be used for calculating
44
@ the isometry.
45
@ The matrices of known elements can be given
46
@ to the function by the pointer 'Erz'.
47
@ int Erzanz: The number of matrices given in 'Erz"
48
@ int *options: see below.
49
@
50
@ options is a pointer to integer (of length 6)
51
@ The possible options are encoded in the following way:
52
@ options[0]: The depth, up to wich scalar product combinations
53
@ shall be calculated. The value should be small.
54
@ options[0] > 0 should be used only, if the automorphismn
55
@ group is expected to be small (with respect to the number
56
@ of shortest vectors).
57
@ options[1]: The n-point stabiliser with respect to different basis
58
@ will be calculated.
59
@ options[2]: If options[2] = 1, additional output is written to the
60
@ file AUTO.tmp
61
@ options[3]: If options[3] = 1, Bacher polynomials are used.
62
@ If options[3] = 2, Bacher polynomial are used up to a deepth
63
@ specified in options[4].
64
@ If options[3] = 3, Bacher polynomials are used, using
65
@ combinations of vectors having the scalar
66
@ product specified in options[5]
67
@ options[3] = 4 is the combination of options[3] = 2 and
68
@ options[3] = 3.
69
@ options[4]: A natural number number or zero (if options[3] = 2 or 4)
70
@ options[5]: An integral number (if options[3] = 3 or 4)
71
@
72
@ It is possible to use NULL for options,
73
@ in this case option is assumed to be [0,0,0,0,0,0]
74
@-------------------------------------------------------------------------
75
*/
76
77
matrix_TYP *pr_isom(F1, F2, Fanz, Erz, Erzanz, options)
78
matrix_TYP **F1, **F2, **Erz;
79
int Fanz, Erzanz, *options;
80
{
81
matrix_TYP *T, *X, *X1, **F, *SV1, *SV2;
82
int i,j,k;
83
int n, anz, max;
84
85
extern matrix_TYP *isometry();
86
extern matrix_TYP *short_vectors();
87
extern matrix_TYP *mat_mul();
88
extern matrix_TYP *scal_pr();
89
extern matrix_TYP *pair_red();
90
extern matrix_TYP *init_mat();
91
92
if((F = (matrix_TYP **) malloc(Fanz *sizeof(matrix_TYP *))) == NULL)
93
{
94
printf("malloc of 'F' in 'pr_isom' failed\n");
95
exit(2);
96
}
97
n = F1[0]->cols;
98
T = init_mat(n,n,"");
99
for(i=0;i<n;i++)
100
T->array.SZ[i][i] = 1;
101
F[0] = pair_red(F1[0], T);
102
max = F[0]->array.SZ[n-1][n-1];
103
for(i=1;i<Fanz;i++)
104
F[i] = scal_pr(T, F1[i], 1);
105
SV1 = short_vectors(F[0], max, 0, 0, 0, &anz);
106
SV2 = short_vectors(F2[0], max, 0, 0, 0, &anz);
107
X1 = isometry(F, F2, Fanz, SV1, SV2, Erz, Erzanz, options);
108
for(i=0;i<Fanz;i++)
109
free_mat(F[i]);
110
free(F);
111
free_mat(SV1); free_mat(SV2);
112
if(X1 == NULL)
113
{
114
free_mat(T);
115
return(NULL);
116
}
117
X = mat_mul(X1, T);
118
free_mat(X1); free_mat(T);
119
return(X);
120
}
121
122
123
/*********************************************************
124
matrix_TYP *perfect_normal_isometry(F1, F2, SV1, SV2, Erz, Erzanz, options, P, Panz, Pbase, Pdim)
125
matrix_TYP *F1, *F2, *SV1, *SV2, **Erz, **P, **Pbase;
126
int Erzanz, *options, Panz, Pdim;
127
********************************************************/
128
129