1 /****************************************************************************
2 **
3 *A  start_iteration.c           ANUPQ source                   Eamonn O'Brien
4 **
5 *Y  Copyright 1995-2001,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
6 *Y  Copyright 1995-2001,  School of Mathematical Sciences, ANU,     Australia
7 **
8 */
9 
10 #include "pq_defs.h"
11 #include "pcp_vars.h"
12 #include "pga_vars.h"
13 #include "constants.h"
14 #include "pq_functions.h"
15 #define ITERATION 6
16 
17 /* read class and order bounds and step size information
18    required in iteration of the algorithm */
19 
iteration_information(int * subgroup_rank,struct pga_vars * flag,int * class_bound,int * order_bound,int ** step_sequence,struct pga_vars * pga,struct pcp_vars * pcp)20 void iteration_information(int *subgroup_rank,
21                            struct pga_vars *flag,
22                            int *class_bound,
23                            int *order_bound,
24                            int **step_sequence,
25                            struct pga_vars *pga,
26                            struct pcp_vars *pcp)
27 {
28    Logical All, Constant;
29    int nmr_iterations;
30    register int i;
31 
32    read_class_bound(class_bound, pcp);
33 
34    read_value(TRUE, "Construct all descendants? ", &All, INT_MIN);
35    if (All) {
36       pga->step_size = ALL;
37       read_value(TRUE,
38                  "Set an order bound on the descendants? ",
39                  order_bound,
40                  INT_MIN);
41       if (*order_bound)
42          read_order_bound(order_bound, pcp);
43       else
44          *order_bound = ALL;
45    } else
46       *order_bound = ALL;
47 
48    nmr_iterations = *class_bound - pcp->cc + 1;
49 
50    if (!All) {
51       if (nmr_iterations != 1) {
52          read_value(TRUE, "Constant step size? ", &Constant, INT_MIN);
53       }
54       if (Constant || nmr_iterations == 1) {
55          read_step_size(pga, pcp);
56          Constant = TRUE;
57       }
58    }
59 
60    if (!All && !Constant) {
61       *step_sequence = allocate_vector(nmr_iterations, 1, 0);
62       printf("Input %d step sizes: ", nmr_iterations);
63       for (i = 1; i < nmr_iterations; ++i)
64          read_value(FALSE, "", &(*step_sequence)[i], 1);
65       read_value(TRUE, "", &(*step_sequence)[i], 1);
66    } else
67       *step_sequence = NULL;
68 
69    defaults_pga(ITERATION, subgroup_rank, flag, pga, pcp);
70 }
71