Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346#include "typedef.h"1#include "tools.h"2#include "datei.h"3#include "getput.h"4#include "matrix.h"56main (int argc, char *argv[])78{9char *filename;10char string[80];11char *fn,12*family_name;13symbol_out **B;14bravais_TYP *S;15matrix_TYP *X;16int ad_no = 0; /* number of homogenously decomposable groups in this family */17FILE *outfile;18int i,j;1920extern bravais_TYP *Z_class();21extern symbol_out *read_symbol();22extern symbol_out *get_symbol();2324/* scan_argv (argc, argv, &filename); */25/* changed to conform with the rest of the carat package */26read_header(argc,argv);27if (FILEANZ > 0)28filename = FILENAMES[0];29else30filename = NULL;3132if ((is_option('h') && optionnumber('h') == 0) ||33FILEANZ > 1){34printf("Usage: %s [file]\n",argv[0]);35printf("\n");36printf("file: (OPTIONAL) contains a set of commands for Datei, which are otherwise\n");37printf(" asked from stdin.\n");38printf("\n");39printf("Accesses the catalog of bravais groups up to dimension 6.\n");40printf("\n");41printf("The first input for the catalog is the family symbol, whose grammar is\n");42printf("described in detail in the CARAT manual. It is build up from atomic symbols\n");43printf("which are seperated by `,' or `;' to indicate diagonals and direct products.\n");44printf("We just state the two important rules here:\n");45printf("\n");46printf(" LIST OF 'ATOMS':\n");47printf(" dim1: 1\n");48printf(" dim2: 2-1 2-1' 2-2 2-2'\n");49printf(" dim3: 3\n");50printf(" dim4: 4-1 4-1' 4-2 4-2' 4-3 4-3'\n");51printf(" dim5: 5-1 5-2\n");52printf(" dim6: 6-1 6-2 6-2' 6-3 6-3' 6-4 6-4'\n");53printf("\n");54printf("Meaning of `,': (X 0 0)\n");55printf(" A,A,A stands for groups of the form (0 X 0) with X in A\n");56printf(" (0 0 X)\n");57printf("Meaning of `;':\n");58printf(" A;B stands for groups of the form (X 0)\n");59printf(" (0 Y) with X in A and Y in B.\n");60printf("NOTE: The primed atoms 2-1' and 2-2' only occur in multiples, seperated by `,'.\n");61printf("Examples: 2-1,2-1;2-1 (degree 6)\n");62printf(" 1;1;1 (degree 3)\n");63printf(" 3,3 (degree 6)\n");64printf(" 4-1;1 (degree 5)\n");65printf("\n");66printf("Cf.: Symbol, Bravais_type.\n");67printf("Note: Bravais_catalog is a synonym for Datei.\n");68if (is_option('h')){69exit(0);70}71else{72exit(31);73}74}757677B = (symbol_out **) malloc(1 *sizeof(symbol_out *));78B[0] = read_symbol(filename);79ad_no++;80family_name = (char *) malloc(80 *sizeof(char));81strcpy(family_name, B[0]->fn);82/*83fprintf(stderr,"B[0]->fn: %s\n",B[0]->fn);84*/85family_name = strstr(family_name, "dim");86family_name = family_name+5;87get_zentr(B[0]);88while(B[ad_no-1]->fn != NULL)89{90B = (symbol_out **) realloc(B, (ad_no+1) *sizeof(symbol_out *));91filename = B[ad_no-1]->fn;92B[ad_no] = get_symbol(filename);93ad_no++;94}95printf("The crystal-family %s contains %d homogeneously decomposable bravais-groups with\n", family_name, ad_no);96j=0;97for(i=0; i<ad_no; i++)98{99if(j != 0)100{101if(j == ad_no -1)102printf(" resp. ");103else104printf(", ");105}106printf(" %d", (B[i]->grp->zentr_no+1));107j = 1;108}109printf("\n Z-classes of Bravais groups.\n");110111112printf("Do you want to calculate bravais-groups? (y or n): ");113fn = (char *) malloc(80 *sizeof(char));114scanf( "%[ \t\n]", fn);115scanf( "%[^\n]", fn);116while(strncmp(fn, "y", 1) != 0 && strncmp(fn, "n", 1) != 0)117{118scanf( "%[ \t\n]", fn);119scanf( "%[^\n]", fn);120}121if(strncmp(fn, "n", 1) == 0)122exit(3);123124/*-----------------------------------------------------*\125| read and open output-file |126\*-----------------------------------------------------*/127printf("Please input a filename (stdout = standard output): ");128scanf( "%[ \t\n]", fn);129scanf( "%[^\n]", fn);130if(strncmp(fn, "stdout", 6) == 0)131fn = NULL;132if(fn == NULL)133outfile = stdout;134else135outfile = fopen( fn, "w");136137printf("Which bravais-groups should be printed? (a(ll) or s(election): ");138scanf( "%[ \t\n]", string);139scanf( "%[^\n]", string);140while(strncmp(string, "a", 1) != 0 && strncmp(string, "s", 1) != 0)141{142scanf( "%[ \t\n]", string);143scanf( "%[^\n]", string);144}145146if(strncmp(string, "a", 1) == 0)147{148for(i=0; i<ad_no; i++)149{150fput_bravais(outfile, B[i]->grp, "homogenously decomposable bravais-group");151fflush(outfile);152for(j=0; j<B[i]->grp->zentr_no; j++)153{154X = B[i]->grp->zentr[j];155S = Z_class(B[i]->grp, X);156fput_bravais(outfile, S, "not homogenously decomposable bravais-group");157fflush(outfile);158free_bravais(S);159}160}161exit(3);162}163164strncpy(string, "y", 1);165while(strncmp(string, "y", 1) == 0)166{167printf("Please enter index i of homogeneously decomposable bravais-group, 1<= i<= %d: ", ad_no);168scanf("%d", &i);169i--;170if(i<0 || i>= ad_no)171printf("There is no homogenously decomposable bravais-group of this index\n");172else173{174printf("Please enter index j of bravais-group belonging to this homogenously decomposable\n");175printf("1 <= j =< %d: ", (B[i]->grp->zentr_no+1));176scanf("%d", &j);177j--;178if(j== 0)179fput_bravais(outfile, B[i]->grp, "homogeneously decomposable bravais-group");180else181{182j--;183if(j<0 || j>=B[i]->grp->zentr_no)184printf("There is no bravais-group of this index\n");185else186{187X = B[i]->grp->zentr[j];188S = Z_class(B[i]->grp, X);189fput_bravais(outfile, S, "not homogeneously decomposable bravais-group");190free_bravais(S);191}192}193}194printf("Do you want further bravais-groups? (y or n): ");195scanf( "%[ \t\n]", string);196scanf( "%[^\n]", string);197while(strncmp(string, "y", 1) != 0 && strncmp(string, "n", 1) != 0)198{199scanf( "%[ \t\n]", string);200scanf( "%[^\n]", string);201}202203/* inserted to enable multiple output files, tilman 05/06/97 */204if (strncmp(string,"y",1) == 0){205printf("If you want a different file, insert it: (no/filename)");206if (fn == NULL) fn = (char *) malloc(1024*sizeof(char));207scanf( "%[ \t\n]", fn);208scanf( "%[^\n]", fn);209if (strcmp(fn,"no") != 0){210fclose (outfile);211outfile = fopen( fn, "w");212}213}214}215216if ( outfile != stdout ) {217fclose (outfile);218}219220exit(0);221}222/*{{{}}}*/223224225