#include #include #include #include #include #include "add_main.h" #include "coords.h" #include "int2char.h" #include "messages.h" #include "stat_print.h" #include "stat_select.h" #include "stat_sort.h" #include "summary_stat.h" int main (int argc, char *argv[]) { char filename[256], tmp_str[2048]; int error, i, index, j, k, label[2]; float label_fl; FILE *f_inp, *f_log; char input[256], logfile[256], output[256]; float cell[3], *coords, *crit; int *agl, *connect, from, *label_atom, *label_mol, log, max_depth, num_atoms, num_mol, *num_mol_agl, num_of_inter, *stat, *stat_all, step, to, *true_label_mol, *type_agl, *type_atoms, type_inter, quiet; /* input - mask of input files * logfile - log file name * output - output file name * * cell - cell dimension * coords - massive of coordinates * crit - massive of criteria * * agl - massive of aglomerates * connect - connectivity graph for all molecules * from - start point * label_atom - types of atom for interaction * label_mol - massive of numbers of molecule for atoms * log - status of log-mode * max_depth - max depth for check cycles in graph analyze * num_atoms - number of atoms for writing coordinates * num_mol - number of molecules for writing coordinates * num_mol_agl - massive of numbers of molecule in aglomerates * num_of_inter - number of different interactions * stat - massive of statistics * stat_all - massive of summary statistics * step - $(to - from + 1) * to - finish point * true_label_mol - massive of true numbers of molecule for atoms * type_agl - massive of numbers of aglomerate types * type_atoms - massive of atom types for atoms * type_inter - type interaction (number of molecules for interaction) * quiet - status of quiet-mode */ set_defaults (cell, &from, input, &log, &max_depth, &num_of_inter, output, &to, &type_inter, &quiet); // reading number of interactions for (i=1; i 0) { crit = (float *) malloc ( 16 * num_of_inter * sizeof (float)); for (i=0; i<16*num_of_inter; i++) crit[i] = 0.0; num_of_inter = 0; } // reading arguments 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); fputs (tmp_str, stdout); return 0; } else if ((argv[i][0] == '-') && (argv[i][1] == 'i')) // mask of input files { strcpy (input, argv[i+1]); i++; } else if ((argv[i][0] == '-') && (argv[i][1] == 's')) // steps { sscanf (argv[i+1], "%i,%i", &from, &to); if (from > to) { to += from; from = to - from; to -= from; } step = to - from + 1; i++; } else if ((argv[i][0] == '-') && (argv[i][1] == 'c')) // cell size { sscanf (argv[i+1], "%f,%f,%f", &cell[0], &cell[1], &cell[2]); i++; } else if ((argv[i][0] == '-') && (argv[i][1] == 'a')) // atom types { type_inter = 1; for (j=0; j