From 6e014ca5ce263e96549236b5bf4f2379467b9e2b Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 27 Sep 2021 13:13:17 +0300 Subject: setting up git on old project --- main.c | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 main.c (limited to 'main.c') diff --git a/main.c b/main.c new file mode 100644 index 0000000..92068e4 --- /dev/null +++ b/main.c @@ -0,0 +1,127 @@ +#include +#include +#include +#include"row_dispenser.c" +#include"threadet.c" +#include"input.c" + + +int main(int argc,char **argv) +{ + + mpq_t **det=NULL; + size_t n=1; + size_t i,j,y; + size_t number_of_threads=1; + char verbose=1; + FILE *out=stdout; + FILE *dm=NULL; +/* + * menuing + * + */ + for(i=0;i '9') + { + printf("Number of threads format not supported\n"); + return -1; + } + sscanf(argv[i],"%zu",&number_of_threads); + + }else if(strcmp("-q",argv[i]) == 0) + { + verbose = 0; + }else if(strcmp("-n",argv[i]) == 0) + { + if(det!=NULL)free(det); + ++i; + if(i == argc) + { + printf("No matrix size\n"); + return -1; + } + for(j=0;argv[i][j]!='\0';++j) + if(argv[i][j] < '0' || argv[i][j] > '9') + { + printf("Matrix size format not supported\n"); + return -1; + } + sscanf(argv[i],"%zu",&n); + random_table(&det,n); + }else if(strcmp("-o",argv[i]) == 0) + { + ++i; + if(i == argc) + { + printf("No name\n"); + return -1; + } + //fclose(out); + out = fopen(argv[i],"w"); + if(out == NULL) + { + printf("No such file\n"); + return -1; + } + }else if(strcmp("-dm",argv[i]) == 0) + { + ++i; + if(i == argc) + { + printf("No name\n"); + return -1; + } + dm = fopen(argv[i],"w"); + } + + } + if(det==NULL) + { + printf("Not matrix specified\n"); + return -1; + } + if(dm!=NULL) + { + fprintf(dm,"%zu\n",n); + for(i=0;i