From 51d31d0a2f750b6bfa3a061686375a820f654d87 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Mon, 22 Jul 2013 06:06:01 +0400 Subject: [PATCH] + added CMakeLists.txt + added headers + added library 'add_main.c' + some optimization --- statgen/CMakeLists.txt | 23 ++++ statgen/{Makefile => Makefile_bckp} | 2 +- statgen/add_main.c | 85 +++++++++++++++ statgen/add_main.h | 12 +++ statgen/coords.c | 25 +++-- statgen/coords.h | 7 ++ statgen/graph.c | 113 +++++++++----------- statgen/graph.h | 9 ++ statgen/{int2str.c => int2char.c} | 3 - statgen/int2char.h | 6 ++ statgen/main.c | 159 ++++++++-------------------- statgen/messages.c | 1 - statgen/messages.h | 6 ++ statgen/stat_print.c | 44 ++++++-- statgen/stat_print.h | 7 ++ statgen/stat_select.c | 1 - statgen/stat_select.h | 7 ++ statgen/stat_sort.c | 1 - statgen/stat_sort.h | 6 ++ statgen/statgen | Bin 37507 -> 0 bytes statgen/summary_stat.c | 33 ++++-- statgen/summary_stat.h | 7 ++ 22 files changed, 347 insertions(+), 210 deletions(-) create mode 100644 statgen/CMakeLists.txt rename statgen/{Makefile => Makefile_bckp} (68%) create mode 100644 statgen/add_main.c create mode 100644 statgen/add_main.h create mode 100644 statgen/coords.h create mode 100644 statgen/graph.h rename statgen/{int2str.c => int2char.c} (92%) create mode 100644 statgen/int2char.h create mode 100644 statgen/messages.h create mode 100644 statgen/stat_print.h create mode 100644 statgen/stat_select.h create mode 100644 statgen/stat_sort.h delete mode 100755 statgen/statgen create mode 100644 statgen/summary_stat.h diff --git a/statgen/CMakeLists.txt b/statgen/CMakeLists.txt new file mode 100644 index 0000000..f8ff8e4 --- /dev/null +++ b/statgen/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 2.8) + +project(statgen) + +set(MY_CXX_FLAGS "-Wall") +set(CMAKE_CXX_FLAGS "-O0 ${MY_CXX_FLAGS}") +set(CMAKE_SHARED_LINKER_FLAGS "-lm") + +set(SOURCE_EXE main.c) +set(SOURCE_LIB add_main.c + coords.c + graph.c + int2char.c + messages.c + stat_print.c + stat_select.c + stat_sort.c + summary_stat.c) + +add_library(stat SHARED ${SOURCE_LIB}) +add_executable(statgen ${SOURCE_EXE}) + +target_link_libraries(statgen stat) \ No newline at end of file diff --git a/statgen/Makefile b/statgen/Makefile_bckp similarity index 68% rename from statgen/Makefile rename to statgen/Makefile_bckp index 5536912..ff59737 100644 --- a/statgen/Makefile +++ b/statgen/Makefile_bckp @@ -3,7 +3,7 @@ PROJECT=STATGEN CC=gcc CFLAGS=-c -Wall -fPIC LDFLAGS=-lm -SOURCES=main.c coords.c graph.c int2str.c messages.c stat_print.c stat_select.c stat_sort.c summary_stat.c +SOURCES=main.c add_main.c coords.c graph.c int2char.c messages.c stat_print.c stat_select.c stat_sort.c summary_stat.c OBJECTS=$(SOURCES:.c=.o) EXECUTABLE=statgen diff --git a/statgen/add_main.c b/statgen/add_main.c new file mode 100644 index 0000000..85aa1a6 --- /dev/null +++ b/statgen/add_main.c @@ -0,0 +1,85 @@ +/* Additional library for main.c (statgen) + */ + +#include + + +int error_checking (const float *cell, const int from, const char *input, + const int max_depth, const int num_of_inter, const char *output, + const int to, const int type_inter) +{ + if ((type_inter == 0) || (type_inter > 4)) + return 11; + if ((cell[0] == 0.0) || (cell[1] == 0.0) || (cell[2] == 0.0)) + return 12; + if ((to == -1) || (from == -1)) + return 13; + if (num_of_inter == 0) + return 14; + if (input[0] == '#') + return 15; + if (output[0] == '#') + return 16; + if ((max_depth < 3) && (max_depth != 0)) + return 19; + + return 0; +} + + +int printing_head (const char *output, const int log, const int quiet, + const char *input, const int from, const int to, const float *cell, + const int type_inter, const int *label_atom, + const int num_of_inter, const float *crit, const int max_depth) +{ + int i, j; + FILE *f_out; + + f_out = fopen (output, "w"); + fprintf (f_out, "statgen ::: V.1.0.0 ::: 2013-07-17\n\n"); + fprintf (f_out, "CONFIGURATION\n"); + + fprintf (f_out, "LOG=%i\nQUIET=%i\n", log, quiet); + fprintf (f_out, "MASK=%s\nFIRST=%i\nLAST=%i\n", input, from, to); + fprintf (f_out, "CELL=%.4f,%.4f,%.4f\n", cell[0], cell[1], cell[2]); + fprintf (f_out, "ATOMS=%i", label_atom[0]); + for (i=1; i #include -#include int reading_coords (const char *filename, const int type_inter, @@ -27,11 +26,12 @@ int reading_coords (const char *filename, const int type_inter, * coords - massive of coordinates */ { - char file_string[256]; - int atoms, i, j, tr_num_atoms, ref_mol, x, y; - float not_tr_coords[750000], ref[3]; + char at_symb[32], file_string[256]; + int atoms, cur_at_num, cur_at_type, cur_mol, i, j, tr_num_atoms, ref_mol, x, y; + float cur_coords[3], not_tr_coords[750000], ref[3]; FILE *inp; -/* file_string - temp string variable +/* cur_*, at_symb - temp variables + * file_string - temp string variable * atoms - total number of atoms in system * tr_num_atoms - number of translated atoms for writing coordinates (m.b. 8*num_atoms) * ref_mol - number of molecule for reference @@ -50,20 +50,23 @@ int reading_coords (const char *filename, const int type_inter, ref_mol = -1; fscanf (inp, "%i", &atoms); + fgets (file_string, 256, inp); for (i=0; i -#include #include -int check_cycle (const int N, const int *matrix) +int check_cycle (const int N, const int *pn) // function to return number of cycles { - int cycle, i, j; + int cycle, i; /* cycle - number of cycle */ cycle = 0; - for (i=0; i 2) && (cur_N <= depth)) { // copy connectivity matrix + cycle = 1; for (j=0; j N) depth = N; else depth = max_depth; - n_cycle = (int *) malloc ((max_depth-2) * sizeof (int)); +// convert to matrix of weight + pn = (int *) malloc (N * sizeof (int)); + n_cycle = (int *) malloc ((depth - 2) * sizeof (int)); + for (i=0; i 0) + iso[0] = check_tail (pn); + iso[1] = check_cycle (N, pn); + for (i=2; i 0) + { + check_cycle_size (N, matrix, depth, n_cycle); for (i=0; i -#include - char conv (const int fnumb, const int dig_pos) /* fnumb - integer diff --git a/statgen/int2char.h b/statgen/int2char.h new file mode 100644 index 0000000..a964562 --- /dev/null +++ b/statgen/int2char.h @@ -0,0 +1,6 @@ +#ifndef INT2CHAR_H +#define INT2CHAR_H + +char conv (const int, const int); + +#endif /* INT2CHAR_H */ \ No newline at end of file diff --git a/statgen/main.c b/statgen/main.c index 18f3e45..08cbabd 100644 --- a/statgen/main.c +++ b/statgen/main.c @@ -4,96 +4,14 @@ #include #include - -// prototypes -char conv (const int, const int); -int create_matrix (const int, const int, const int *, const int *, const float *, - const int, const float *, int *); -int message (const int, const int, const char *, FILE *); -int printing_agl (const char *, const char *, const int *, const int, - const int *, const int *, const int *, const int *, int *); -int proc_matrix (const int, const int *, int *, int *, int *, int *); -int reading_coords (const char *, const int, const int *, const float *, int *, - int *, int *, int *, int *, float *); -int summary_statistic (const char *, const int, const int, const int *, const int *); - - -int error_checking (const float *cell, int from, const char *input, - int num_of_inter, const char *output, int to, int type_inter) -{ - if ((type_inter == 0) || (type_inter > 4)) - return 11; - if ((cell[0] == 0.0) || (cell[1] == 0.0) || (cell[2] == 0.0)) - return 12; - if ((to == -1) || (from == -1)) - return 13; - if (num_of_inter == 0) - return 14; - if (input[0] == '#') - return 15; - if (output[0] == '#') - return 16; - - return 0; -} - - -int printing_head (const char *output, int log, int quiet, const char *input, - int from, int to, const float *cell, int type_inter, - const int *label_atom, int num_of_inter, const float *crit) -{ - int i; - FILE *f_out; - - f_out = fopen (output, "w"); - fprintf (f_out, "statgen ::: V.1.0.0 ::: 2013-07-17\n\n"); - fprintf (f_out, "CONFIGURATION\n"); - - fprintf (f_out, "LOG=%i\nQUIET=%i\n", log, quiet); - fprintf (f_out, "MASK=%s\nFIRST=%i\nLAST=%i\n", input, from, to); - fprintf (f_out, "CELL=%.4f,%.4f,%.4f\n", cell[0], cell[1], cell[2]); - fprintf (f_out, "ATOMS=%i", label_atom[0]); - for (i=1; i= 3)\n", tmp_str); sprintf (tmp_str, "%s -l - log enable\n", tmp_str); sprintf (tmp_str, "%s -q - quiet enable\n", tmp_str); sprintf (tmp_str, "%s -h - show this help and exit\n", tmp_str); @@ -255,6 +175,12 @@ int main (int argc, char *argv[]) strcpy (output, argv[i+1]); i++; } + else if ((argv[i][0] == '-') && (argv[i][1] == 'g')) +// graph isomorphism scan + { + sscanf (argv[i+1], "%i", &max_depth); + i++; + } else if ((argv[i][0] == '-') && (argv[i][1] == 'l')) // log mode { @@ -284,7 +210,8 @@ int main (int argc, char *argv[]) } // error checking - error = error_checking (cell, from, input, num_of_inter, output, to, type_inter); + error = error_checking (cell, from, input, max_depth, num_of_inter, output, to, + type_inter); if (error != 0) { sprintf (tmp_str, "Something wrong (error code: %i)!\nSee 'statgen -h' for more details\n", error); @@ -326,6 +253,7 @@ int main (int argc, char *argv[]) coords = (float *) malloc (3 * 8 * num_atoms * sizeof (float)); label_mol = (int *) malloc (8 * num_atoms * sizeof (int)); true_label_mol = (int *) malloc (8 * num_atoms * sizeof (int)); + type_agl = (int *) malloc ((max_depth + 2) * sizeof (int)); type_atoms = (int *) malloc (8 * num_atoms * sizeof (int)); // temporary declaration of variables agl = (int *) malloc (2 * 2 * sizeof (int)); @@ -337,6 +265,7 @@ int main (int argc, char *argv[]) if ((coords == NULL) || (label_mol == NULL) || (true_label_mol == NULL) || + (type_agl == NULL) || (type_atoms == NULL) || (agl == NULL) || (connect == NULL) || @@ -350,6 +279,9 @@ int main (int argc, char *argv[]) fputs (tmp_str, f_log); return 17; } +// set type_agl to zero + for (i=0; i -#include #include diff --git a/statgen/messages.h b/statgen/messages.h new file mode 100644 index 0000000..4a500fa --- /dev/null +++ b/statgen/messages.h @@ -0,0 +1,6 @@ +#ifndef MESSAGES_H +#define MESSAGES_H + +int message (const int, const int, const char *, FILE *); + +#endif /* MESSAGES_H */ \ No newline at end of file diff --git a/statgen/stat_print.c b/statgen/stat_print.c index 1081781..3922a38 100644 --- a/statgen/stat_print.c +++ b/statgen/stat_print.c @@ -3,20 +3,18 @@ * Usage: * printing_agl (input_file, output_file, number_of_molecules, * true_label_molecules, num_of_molecules_in_aglomerates, aglomerates, - * statistic, type_of_aglomerate) + * statistic, max_depth, type_of_aglomerate) */ #include #include - -// prototype -int graph_analyze (const int, const int *, const int, char *); +#include "graph.h" int printing_agl (const char *input, const char *output, const int *connect, const int num_mol, const int *true_label_mol, const int *num_mol_agl, - const int *agl, const int *stat, int *type_agl) + const int *agl, const int *stat, const int max_depth, int *type_agl) /* input - name of file with coordinates * output - name of output file * connect - connectivity graph for all molecules @@ -25,11 +23,11 @@ int printing_agl (const char *input, const char *output, const int *connect, * num_mol_agl - massive of numbers of molecule in aglomerates * agl - massive of aglomerates * stat - massive of statistics + * max_depth - max depth for check cycles in graph analyze * type_agl - massive of numbers of aglomerate types */ { - char iso[256]; - int i, j, k, *label_matrix, *matrix; + int i, *iso, j, k, *label_matrix, *matrix; FILE *f_out; /* iso - isomorphic graph in database * label_matrix - massive of indexes of molecule @@ -37,6 +35,7 @@ int printing_agl (const char *input, const char *output, const int *connect, * f_out - output file */ + iso = (int *) malloc (max_depth * sizeof (int)); f_out = fopen (output, "a"); // head @@ -71,10 +70,36 @@ int printing_agl (const char *input, const char *output, const int *connect, } // graph topology analyze - graph_analyze (num_mol_agl[i], matrix, 3, iso); + if (max_depth > 0) + graph_analyze (num_mol_agl[i], matrix, max_depth, iso); // printing class of aglomerate - fprintf (f_out, "AGL=%i=%s\n", num_mol_agl[i], iso); + fprintf (f_out, "AGL=%i=", num_mol_agl[i]); + for (j=0; j 2) +// branched + type_agl[3]++; + else +// not branched + type_agl[2]++; +// number of cycles + else if (j == 1) + if (iso[j] > 0) +// cycle + type_agl[1]++; + else +// linear + type_agl[0]++; + else if (j > 1) +// number of n_cycles + type_agl[j+2] += iso[j]; + + fprintf (f_out, "%i.", iso[j]); + } + fprintf (f_out, "\n"); for (j=0; j -#include #include diff --git a/statgen/stat_select.h b/statgen/stat_select.h new file mode 100644 index 0000000..4489256 --- /dev/null +++ b/statgen/stat_select.h @@ -0,0 +1,7 @@ +#ifndef STAT_SELECT_H +#define STAT_SELECT_H + +int create_matrix (const int, const int, const int *, const int *, const float *, + const int, const float *, int *); + +#endif /* STAT_SELECT_H */ \ No newline at end of file diff --git a/statgen/stat_sort.c b/statgen/stat_sort.c index 9e89dc0..69b1e21 100644 --- a/statgen/stat_sort.c +++ b/statgen/stat_sort.c @@ -5,7 +5,6 @@ * num_of_molecules_in_aglomerates, aglomerates, statistic, summary_statistic) */ -#include #include diff --git a/statgen/stat_sort.h b/statgen/stat_sort.h new file mode 100644 index 0000000..4d4c861 --- /dev/null +++ b/statgen/stat_sort.h @@ -0,0 +1,6 @@ +#ifndef STAT_SORT_H +#define STAT_SORT_H + +int proc_matrix (const int, const int *, int *, int *, int *, int *); + +#endif /* STAT_SORT_H */ \ No newline at end of file diff --git a/statgen/statgen b/statgen/statgen deleted file mode 100755 index b99e098a8d8420a6fe42c2865a9d70dd9f3c5a72..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37507 zcmb<-^>JfjWMqH=CI&kO5Kn;H0W1U|85ky1gSlYBfx&`-gTaA8jzOA%je&uIm4Sf) zrp^J%g3$*+hA}WOz-SJz2@DL(3=9k`AT|?-U|?Wif|>xOWuU?^8fpyKZ6N!g(kM2A z#A3=pBm)DCW?)bN3xM>4+?oKDPbg0Si^J#-PE=XSmR9^*DAB=tgGMIsZ z0Y=082l5*T%YY1EU|^7e`3p+BfNf`BfYBheAfbS#B`F~GonjD=f#FUuBwS$h5{NJZ zj0UL%2?ahaNddVN#3lyA+^L_FnPg_7pOd1SlbKgqp<7{LrfX)RSDdeB1dbm81_p4L zyZeQLjRkoJWDh7*L3WEUK;jZ4AJTpM-QV5SYH_m1ryRXqlOgy_odXm+Fbp<;NJ5U0 zfk6n1+FuOV#km<^F@~yXBLf42AgU0U2Z~N?=I_H{{s$c5S8#~0!XbVRhjNvvfKMs3u;}Gw`AwCC(cpDCJGaT;uibH)J4)K>b#JzBspMgXD zBOK|6Aty5_7nDuR7~(xceB)D6i&E1wi%U|ALVTTb^7B$d5|eUL8RFy9bMy1!i%SxV zO5)=g;=Rh^gP`i1a}tY-Q;Q+mv1%^JFJ~w&EGhxnl?<_~xTGk#ppv1up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WU^oC3H}HgrgU22j7#Plg#UXl;$-6kjKj0AO zXT~1Rprz-aa6>OYLAQ|zAzKJ#yD)>|5z0ZLf|(f@1eqilJfQ6-m{bBtoB>hqz}i3g zINZ|+7UyL+?F|VB@E9rs149o~{6acJ96W}|z`!sEEDo~`L2tkzei|&!%fP?`F$X** z&A`BLiy4%DBpD*m+sg`as0NW6KN-46a~tnClR9 z1Pk_f%)z0)4u|+;9OBDaAn5@;95&;y_bd)`?t{g785&X{{sNCJGcYiG1dC&~m%fAS zMR*gz0*x@~B{L)!l@ynhrlsj6GsMSxIS0l2cm{{W$1|j)7Nw?V7MG+J#h2v9C+Fnn zr4}<_5sHsb$&XLZ$xlkmiBBoXFDi~tEUjQj&d)8#Ni9iD(K9nPwPe7mC>}Jf1sSD^ zPt7YSs$_tSYo(Ot=2kMqLr1y5ym*jfQIzH;X6AuhpPyfpQmmKEkY1EnkfE2%keOFv zR9sS|m&}lxS`1pd1Cj(SW{3w*UFsz>fH}qBg#mD0eo+aC4VkHo2dMxDhg*=NuWP)k zpG$l^G;m;S6!)Ys#JfcLIr@4!GsGjiv=}tC%njlPR{X0dPaJt48^G>@hPckiKRIu#W2q>kNv$5YSvTLvcw;erXA+ZqO(o$kRn748#FBg@KFHPasUXuB(voxXi_tt(l$w~5nU@})430Af zh`)hJyTZRFxpj z$*4l{@!$Xl$4NXW^`J_prKh4>7atGu3N&ESz?P$XHafAd6AuoM z%)E4l_|&`<28g2=ic+x}l~h~|RR9VJ -#include int summary_statistic (const char *filename, const int step, const int num_mol, - const int *type_agl, const int *stat_all) + const int max_depth, const int *type_agl, const int *stat_all) /* filename - name of output file * step - number of steps * num_mol - number of molecules + * max_depth - max depth for check cycles in graph analyze * type_agl - massive of numbers of aglomerate types * stat_all - massive of summary statistics */ @@ -52,12 +52,29 @@ int summary_statistic (const char *filename, const int step, const int num_mol, fprintf (f_out, " %7i %7i %9.2f %9.5f %10.5f\n", i+1, stat_all[i], conc, p, pn); } + if (max_depth > 0) + { // types of aglomerates - x = type_agl[0] + type_agl[1]; - type[0] = type_agl[0]; - type[1] = type_agl[1]; - fprintf (f_out, "------------------------------------------------\n"); - fprintf (f_out, "LINEAR=%.5f\nCYCLE=%.5f\n", type[0]/x, type[1]/x); + fprintf (f_out, "------------------------------------------------\n"); +// linear and cycle + x = type_agl[0] + type_agl[1]; + type[0] = type_agl[0]; + type[1] = type_agl[1]; + fprintf (f_out, "LINEAR=%7.5f\nCYCLE=%7.5f\n--------------------\n", type[0]/x, type[1]/x); +// branched + type[0] = type_agl[2]; + type[1] = type_agl[3]; + fprintf (f_out, "NOT BRANCHED=%7.5f\nBRANCHED=%7.5f\n--------------------\n", type[0]/x, type[1]/x); +// n_cycle + x = 0; + for (i=4; i