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

563665 views
1
#include"typedef.h"
2
#include"bravais.h"
3
#include"matrix.h"
4
/**************************************************************************\
5
@---------------------------------------------------------------------------
6
@---------------------------------------------------------------------------
7
@ FILE: normlin.c
8
@---------------------------------------------------------------------------
9
@---------------------------------------------------------------------------
10
@
11
\**************************************************************************/
12
13
14
/**************************************************************************\
15
@---------------------------------------------------------------------------
16
@ matrix_TYP *normlin(Fo, N, fdim)
17
@ matrix_TYP **Fo, *N;
18
@ int fdim;
19
@
20
@ normlin calculates a matrix fdim x fdim - matrix X such that
21
@ X[i], the i-th row of X, has the property
22
@ X[i][0] * Fo[0] + ... + X[i][fdim-1] * Fo[fdim-1] = N^{tr} * Fo[i] * N
23
@ That means X describes the matrix of the linear action of N on
24
@ the vectorspace generated by the Fo[i] by F->N^{tr}F N with respect to
25
@ the basis Fo[0],..,Fo[fdim-1].
26
@ CAUTION: The matrix describes the action on rows !
27
@---------------------------------------------------------------------------
28
@
29
\**************************************************************************/
30
matrix_TYP *normlin(Fo, N, fdim)
31
matrix_TYP **Fo, *N;
32
int fdim;
33
{
34
int i,j,k, dim;
35
matrix_TYP *A, *waste, *erg, *Ntr;
36
37
dim = Fo[0]->cols;
38
if(N->cols != dim || N->rows != dim)
39
{
40
printf("wrong dimension of 'N' in 'normlin'\n");
41
exit(3);
42
}
43
erg = init_mat(fdim, fdim, "");
44
Ntr = tr_pose(N);
45
for(i=0;i<fdim;i++)
46
{
47
waste = mat_mul(Ntr, Fo[i]);
48
A = mat_mul(waste, N);
49
form_to_vec(erg->array.SZ[i], A, Fo, fdim, &j);
50
if(j == -1)
51
{
52
for(k=0;k<fdim;k++)
53
erg->array.SZ[i][k] = -erg->array.SZ[i][k];
54
j = 1;
55
}
56
if(j != 1){
57
printf("Error in 'normlin': no Z-basis of formspace\n");
58
exit(3);
59
}
60
free_mat(A);
61
free_mat(waste);
62
}
63
free_mat(Ntr);
64
return(erg);
65
}
66
67