Exemple #1
0
void orbit_option(int option,
                  int **perms,
                  int **a,
                  int **b,
                  char **c,
                  int **orbit_length,
                  struct pga_vars *pga)
{
   int t;
   Logical soluble_group;
   /*    FILE * file; */


   if (option != COMBINATION && option != STANDARDISE) {
      query_solubility(pga);
      if (pga->soluble)
         query_space_efficiency(pga);
      else
         pga->space_efficient = FALSE;
      query_orbit_information(pga);
   } else if (option == COMBINATION) {
      pga->print_orbit_summary = FALSE;
      pga->print_orbits = FALSE;
   } else if (option == STANDARDISE) {
      pga->print_orbit_summary = FALSE;
      pga->print_orbits = FALSE;
   }

   soluble_group = (pga->soluble || pga->Degree == 1 || pga->nmr_of_perms == 0);

   if (!pga->space_efficient) {
      t = runTime();
      if (soluble_group)
         compute_orbits(a, b, c, perms, pga);
      else
         insoluble_compute_orbits(a, b, c, perms, pga);
      if (option != COMBINATION && option != STANDARDISE) {
         t = runTime() - t;
         printf("Time to compute orbits is %.2f seconds\n", t * CLK_SCALE);
      }
   }

   /* if in soluble portion of combination, we do not need to
      set up representives */
   if (option == COMBINATION && pga->soluble)
      return;

   *orbit_length = find_orbit_reps(*a, *b, pga);

   if (pga->print_orbit_summary)
      orbit_summary(*orbit_length, pga);
   /*   file = OpenFile ("COUNT", "a+");
        fprintf (file, "%d,\n", pga->nmr_orbits);
   */
}
int reduced_covers (FILE *descendant_file, FILE *covers_file, int k, int ***auts, struct pga_vars *pga, struct pcp_vars *pcp)
{
   int lower_step, upper_step;
   int nmr_of_covers = 0;
   int *a, *b;                  /* arrays needed for orbit calculation */
   char *c;                     /* array needed for stabiliser calculation */
   int **perms;                 /* store all permutations */
   int *orbit_length;           /* length of orbits */
   FILE * LINK_input;        /* input file for GAP */
#if defined (GAP_LINK) 
   Logical process_fork = FALSE; /* has GAP process forked? */        
#endif
   Logical soluble_group;       /* indicates that orbits and stabilisers may 
				   be computed using soluble machinery */

   /* calculate the extended automorphisms */
   extend_automorphisms (auts, pga->m, pcp);
   if (pcp->overflow) return 0;

   if (pga->print_extensions && pga->m != 0) {  
      printf ("\nThe extension%s:\n", pga->m == 1 ? " is" : "s are");
      print_auts (pga->m, pcp->lastg, auts, pcp);
   }

   /* find range of permitted step sizes */
   step_range (k, &lower_step, &upper_step, auts, pga, pcp);

   /* set up space for definition sets */
   store_definition_sets (pga->r, lower_step, upper_step, pga);

   /* loop over each permitted step size */ 
   for (pga->s = lower_step; pga->s <= upper_step; ++pga->s) {

      if (pga->trace)
	 trace_details (pga);

      get_definition_sets (pga);
      compute_degree (pga);

      /* establish which automorphisms induce the identity 
	 on the relevant subgroup of the p-multiplicator */
      strip_identities (auts, pga, pcp);

      /* if possible, use the more efficient soluble code --
	 in particular, certain extreme cases can be handled */
      soluble_group = (pga->soluble || pga->Degree == 1 || 
		       pga->nmr_of_perms == 0);

      if (!soluble_group) {
#if defined (GAP_LINK) 
	 if (!process_fork) {
	    start_GAP_file (auts, pga);
	    process_fork = TRUE;
	 }
	 StartGapFile (pga);
#else
#if defined (GAP_LINK_VIA_FILE) 
	 start_GAP_file (&LINK_input, auts, pga, pcp);
#endif
#endif
      }

      perms = permute_subgroups (LINK_input, &a, &b, &c, auts, pga, pcp);

      if (!pga->space_efficient) {
	 if (soluble_group)
	    compute_orbits (&a, &b, &c, perms, pga);
	 else
	    insoluble_compute_orbits (&a, &b, &c, perms, pga);
      }
      orbit_length = find_orbit_reps (a, b, pga);

      if (pga->print_orbit_summary)
	 orbit_summary (orbit_length, pga);

      if (soluble_group && pga->print_orbit_arrays)
	 print_orbit_information (a, b, c, pga);

      pga->final_stage = (pga->q == pga->multiplicator_rank);

      if (!soluble_group) {
#if defined (GAP_LINK_VIA_FILE) 
	 CloseFile (LINK_input);
#endif 
      }

      setup_reps (pga->rep, pga->nmr_orbits, orbit_length, perms, a, b, c, 
		  auts, descendant_file, covers_file, pga, pcp);

      if (!pga->final_stage)
	 nmr_of_covers += pga->nmr_orbits;

      free_space (soluble_group, perms, orbit_length, 
		  a, b, c, pga); 
   }     

#if defined (GAP_LINK)
   if (process_fork) 
      QuitGap ();
#endif 

   free_vector (pga->list, 0);
   free_vector (pga->available, 0);
   free_vector (pga->offset, 0);

   return nmr_of_covers;
}