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

563641 views
1
#include <typedef.h>
2
#include <getput.h>
3
#include <matrix.h>
4
#include <base.h>
5
#include <longtools.h>
6
#include <presentation.h>
7
8
9
matrix_TYP *mapped_word(int *w,
10
matrix_TYP **A,
11
matrix_TYP **AINV)
12
{
13
14
int i;
15
16
matrix_TYP *M;
17
18
if (w[0] == 0)
19
return init_mat(A[0]->cols,A[0]->cols,"i1");
20
21
if (w[1] < 0) {
22
if (AINV[-w[1]-1] == NULL)
23
AINV[-w[1]-1] = long_mat_inv(A[-w[1]-1]);
24
M = copy_mat(AINV[-w[1]-1]);
25
}
26
else{
27
M = copy_mat(A[w[1]-1]);
28
}
29
30
for (i=2;i<=w[0];i++){
31
if (w[i] < 0){
32
if (AINV[-w[i]-1] == NULL)
33
AINV[-w[i]-1] = long_mat_inv(A[-w[i]-1]);
34
mat_muleq(M,AINV[-w[i]-1]);
35
}
36
else{
37
mat_muleq(M,A[w[i]-1]);
38
}
39
}
40
41
return M;
42
43
} /* mapped_word(...) */
44
45
46
47