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 collect_gen_word.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
13
/* collect the defining generator word whose base address
14
is ptr and whose length is length to the storage location
15
referenced by cp */
16
17
void collect_gen_word(int ptr, int length, int cp, struct pcp_vars *pcp)
18
{
19
register int *y = y_address;
20
21
register int gen;
22
register int exp = y[ptr + 1];
23
register int entry;
24
register int gen_val;
25
26
for (entry = 2; entry <= length; ++entry) {
27
28
gen = y[ptr + entry];
29
30
/* check for illegal defining generators */
31
if (abs(gen) > pcp->ndgen || gen == 0)
32
report_error(0, gen, 0);
33
34
gen_val = y[pcp->dgen + gen];
35
if (gen < 0 && gen_val == 1)
36
report_error(0, gen, 0);
37
38
collect(gen_val, cp, pcp);
39
}
40
41
calculate_power(exp, cp + 2 * pcp->lastg + 1, cp, pcp);
42
}
43
44