/*
 * process_generations: Process all the generations
 */
void process_generations() {
    int i, color;
    for (i = 0; i < num_gen; ++i) {
        for(color = 0; color < N_COLORS; color++) {
            swap_matrix();
            copy_matrix(worlds[0], worlds[1]);
            iterate_subgeneration(color);
        }
        update_periods(worlds[0], worlds[1]);
    }
}
matrix *gauss_matrix(matrix *b){
  int i,j,k,l,i_max; double max;
  inside
  for (k=0,l=0; k<n && l<m; k++){
    for (i=l,max=0; i<m;i++)
      if (fabs(A[i*n+k])>max ){
	max = fabs(A[i*n+k]); 
	i_max = i;
      }
    if (max<EVK_MIN)  continue;
    if (i_max!=l) swap_matrix(b,l,i_max);
    elem2_matrix(b,l,1/A[l*n+k]);
    for (i=l+1;i<m;i++){
      elem1_matrix(b,i,l,-A[i*n+k]);
    }
    l++;
  }
  return b;
}