/* Library for processing connectivity matrix * * Usage: * proc_matrix (number_of_molecules, connect_matrix, * num_of_molecules_in_aglomerates, aglomerates, statistic, summary_statistic) */ #include #include int proc_matrix (int num_mol, const int *connect, int *num_mol_agl, int *agl, int *stat, int *stat_all) /* num_mol - number of molecules * connect - connectivity graph for all molecules * num_mol_agl - massive of numbers of molecule in aglomerates * agl - massive of aglomerates * stat - massive of statistics * stat_all - massive of summary statistics */ { int i, j, k, p, *bin; /* p - weight / graph index * bin - binary massive of labels */ // definition and zeroing bin = (int *) malloc (num_mol * sizeof (int)); if (bin == NULL) return 1; for (i=0; i 0) { stat[num_mol_agl[i]-1]++; stat_all[num_mol_agl[i]-1]++; i++; } free (bin); return 0; }