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

563680 views
1
#include"typedef.h"
2
#include"matrix.h"
3
/**************************************************************************\
4
@---------------------------------------------------------------------------
5
@---------------------------------------------------------------------------
6
@ FILE: polyeder_to_vecs.c
7
@---------------------------------------------------------------------------
8
@---------------------------------------------------------------------------
9
@
10
\**************************************************************************/
11
12
13
/**************************************************************************\
14
@---------------------------------------------------------------------------
15
@ matrix_TYP **polyeder_to_vecs(P)
16
@ polyeder_TYP *P;
17
@
18
@ polyeder_to_vecs calculates two matrices X[0] and X[1]
19
@ where the rows of X[0] contain the coordinates of the vertices
20
@ i.e. X[0]->array.SZ[i] = P->vert[i]->v
21
@ and the rows of X[1] contain the coordinates of the walls
22
@ i.e. X[1]->array.SZ[i] = P->wall[i]->gl.
23
@---------------------------------------------------------------------------
24
@
25
\**************************************************************************/
26
matrix_TYP **polyeder_to_vecs(P)
27
polyeder_TYP *P;
28
{
29
int i,j, dim;
30
matrix_TYP **M;
31
32
if( (M = (matrix_TYP **)malloc(2 *sizeof(matrix_TYP *))) == NULL)
33
{
34
printf("malloc of 'M' in 'polyeder_to_vecs' failed\n");
35
exit(2);
36
}
37
dim = P->vert[0]->dim;
38
M[0] = init_mat(P->vert_no, dim, "");
39
M[1] = init_mat(P->wall_no, dim, "");
40
for(i=0;i<P->vert_no;i++)
41
for(j=0;j<dim;j++)
42
M[0]->array.SZ[i][j] = P->vert[i]->v[j];
43
for(i=0;i<P->wall_no;i++)
44
for(j=0;j<dim;j++)
45
M[1]->array.SZ[i][j] = P->wall[i]->gl[j];
46
return(M);
47
}
48
49