GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include"typedef.h"1#include"matrix.h"2/**************************************************************************\3@---------------------------------------------------------------------------4@---------------------------------------------------------------------------5@ FILE: polyeder_to_vecs.c6@---------------------------------------------------------------------------7@---------------------------------------------------------------------------8@9\**************************************************************************/101112/**************************************************************************\13@---------------------------------------------------------------------------14@ matrix_TYP **polyeder_to_vecs(P)15@ polyeder_TYP *P;16@17@ polyeder_to_vecs calculates two matrices X[0] and X[1]18@ where the rows of X[0] contain the coordinates of the vertices19@ i.e. X[0]->array.SZ[i] = P->vert[i]->v20@ and the rows of X[1] contain the coordinates of the walls21@ i.e. X[1]->array.SZ[i] = P->wall[i]->gl.22@---------------------------------------------------------------------------23@24\**************************************************************************/25matrix_TYP **polyeder_to_vecs(P)26polyeder_TYP *P;27{28int i,j, dim;29matrix_TYP **M;3031if( (M = (matrix_TYP **)malloc(2 *sizeof(matrix_TYP *))) == NULL)32{33printf("malloc of 'M' in 'polyeder_to_vecs' failed\n");34exit(2);35}36dim = P->vert[0]->dim;37M[0] = init_mat(P->vert_no, dim, "");38M[1] = init_mat(P->wall_no, dim, "");39for(i=0;i<P->vert_no;i++)40for(j=0;j<dim;j++)41M[0]->array.SZ[i][j] = P->vert[i]->v[j];42for(i=0;i<P->wall_no;i++)43for(j=0;j<dim;j++)44M[1]->array.SZ[i][j] = P->wall[i]->gl[j];45return(M);46}474849