/****************************************************************************** ** AUTHOR: C. Rhodes ** DATE: 21/1/93 ** REVISION: 1.0 (Release) ** STATUS: This code is designed to be an extension to the pq program ** by E.A. O'Brien. It encodes the pc-presentation into a ** sequence of integers and then appends that sequence to a ** file called gps<order>, where <order> is the order of the ** group. Note that existing files of this name are updated.
****************************************************************************/
#ifdef HAVE_GMP
MP_INT Encode(int p, int length, int *list)
{
MP_INT powers, code; int i;
mpz_init_set_ui(&code, 0);
for (i = 1; i <= length; ++i) {
mpz_init_set_si(&powers, 0); if (list[i] != 0)
mpz_ui_pow_ui(&powers, p, i - 1);
mpz_add(&code, &code, &powers);
} /* if (list[i] != 0) { MP_INT factor; mpz_init_set_si (&factor, list[i]); mpz_ui_pow_ui (&powers, p, i); mpz_mul (&powers, &powers, &factor); mpz_add (&code, &code, &powers); } }
*/ return code;
} #endif
/* construct a compact description of the group as a sequence; if write_to_file TRUE, then write the compact description,
sequence, to file and also return it */
registerint p1; registerint p2; int *sequence; int nmr_of_exponents; int weight_g, weight_h; int g, h; int generator; int offset; int index; /* used to count current position in sequence of exponents */ int n; #include"access.h"
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.