CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
/****************************************************************************
2
**
3
*A exponent_info.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 "constants.h"
12
#include "pcp_vars.h"
13
#include "exp_vars.h"
14
#include "pq_functions.h"
15
16
/* read information for exponent checking */
17
18
void exponent_info(struct exp_vars *exp_flag, struct pcp_vars *pcp)
19
{
20
Logical reading = TRUE;
21
Logical Default;
22
23
read_value(TRUE, "Accept default exponent checking? ", &Default, INT_MIN);
24
25
if (Default) {
26
exp_flag->list = (pcp->m == 0) ? ALL_WORDS : REDUCED_LIST;
27
exp_flag->process = TRUE;
28
exp_flag->complete = FALSE;
29
exp_flag->partitions = FALSE;
30
exp_flag->filter = FALSE;
31
exp_flag->start_process = 0;
32
exp_flag->report_unit = 0;
33
exp_flag->word_list = FALSE;
34
exp_flag->all_trivial = TRUE;
35
exp_flag->check_exponent = FALSE;
36
return;
37
}
38
39
while (reading) {
40
read_value(TRUE,
41
"Complete list (1), reduced list (2), or word list (3)? ",
42
&exp_flag->list,
43
1);
44
reading =
45
!(exp_flag->list == ALL_WORDS || exp_flag->list == REDUCED_LIST ||
46
exp_flag->list == INITIAL_SEGMENT);
47
if (reading)
48
printf("Supplied value must be one of %d, %d, or %d\n",
49
ALL_WORDS,
50
REDUCED_LIST,
51
INITIAL_SEGMENT);
52
}
53
54
read_value(TRUE,
55
"Power valid words and echelonise results? ",
56
&exp_flag->process,
57
INT_MIN);
58
59
if (exp_flag->process) {
60
read_value(TRUE,
61
"Input number of the first valid word to process? ",
62
&exp_flag->start_process,
63
0);
64
read_value(TRUE,
65
"Report after collecting how many words (0 for no report)? ",
66
&exp_flag->report_unit,
67
0);
68
} else {
69
exp_flag->start_process = 0;
70
exp_flag->report_unit = 0;
71
}
72
73
read_value(TRUE,
74
"Print list prior to applying filters? ",
75
&exp_flag->complete,
76
INT_MIN);
77
78
79
read_value(TRUE,
80
"Identify filter applied to remove word? ",
81
&exp_flag->filter,
82
INT_MIN);
83
84
read_value(TRUE,
85
"Write list of test words to relation file? ",
86
&exp_flag->word_list,
87
INT_MIN);
88
89
exp_flag->partitions = FALSE;
90
}
91
92
/* default exponent flag settings */
93
94
void initialise_exponent(struct exp_vars *exp_flag, struct pcp_vars *pcp)
95
{
96
int length;
97
98
exp_flag->list = ALL_WORDS;
99
exp_flag->process = TRUE;
100
exp_flag->complete = FALSE;
101
exp_flag->partitions = FALSE;
102
exp_flag->filter = FALSE;
103
exp_flag->start_process = 0;
104
exp_flag->report_unit = 0;
105
exp_flag->word_list = FALSE;
106
exp_flag->all_trivial = TRUE;
107
exp_flag->check_exponent = FALSE;
108
109
if (pcp->m != 0) {
110
length = MAX(1, pcp->lastg - pcp->ccbeg + 1);
111
exp_flag->queue = allocate_vector(length, 1, FALSE);
112
exp_flag->queue_length = 0;
113
}
114
}
115
116