Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Impressum finfield.c   Sprache: C

 

/****************************************************************************
**
**  This file is part of GAP, a system for computational discrete algebra.
**
**  Copyright of GAP belongs to its developers, whose names are too numerous
**  to list here. Please refer to the COPYRIGHT file for details.
**
**  SPDX-License-Identifier: GPL-2.0-or-later
**
**  This file contains the  functions  to compute  with elements  from  small
**  finite fields.
**
**  The concepts of this kernel module are documented in finfield.h
*/


#include "finfield.h"

#include "ariths.h"
#include "bool.h"
#include "calls.h"
#include "error.h"
#include "finfield_conway.h"
#include "gvars.h"
#include "io.h"
#include "lists.h"
#include "modules.h"
#include "opers.h"
#include "plist.h"

#ifdef HPCGAP
#include "hpc/aobjects.h"
#include "hpc/thread.h"
#endif

/****************************************************************************
**
*V  SuccFF  . . . . .  Tables for finite fields which are computed on demand
*V  TypeFF
*V  TypeFF0
**
**  SuccFF holds a plain list of successor lists.
**  TypeFF holds the types of typical elements of the finite fields.
**  TypeFF0 holds the types of the zero elements of the finite fields.
*/


Obj SuccFF;
static Obj TypeFF;
static Obj TypeFF0;


/****************************************************************************
**
*V  TYPE_FFE  . . . . . kernel copy of GAP function TYPE_FFE
*V  TYPE_FFE0 . . . . . kernel copy of GAP function TYPE_FFE0
**
**  These GAP functions are called to compute types of finite field elemnents
*/

static Obj TYPE_FFE;
static Obj TYPE_FFE0;

/****************************************************************************
**
*V  PrimitiveRootMod
**
**  Local copy of GAP function PrimitiveRootMod, used when initializing new
**  fields.
*/

static Obj PrimitiveRootMod;


/****************************************************************************
**
*F  LookupPrimePower(<q>) . . . . . . . .  search for a prime power in tables
**
**  Searches the tables of prime powers from ffdata.c for q, returns the
**  index of q in SizeFF if it is present and 0 if not (the 0 position of
**  SizeFF is unused).
*/

static FF LookupPrimePower(UInt q)
{
    UInt l, n;
    FF   ff;
    UInt e;

    // search through the finite field table
    l = 1;
    n = NUM_SHORT_FINITE_FIELDS;
    ff = 0;
    while (l <= n && SizeFF[l] <= q && q <= SizeFF[n]) {
        // interpolation search
        /* cuts iterations roughly in half compared to binary search at
         * the expense of additional divisions. */

        e = (q - SizeFF[l] + 1) * (n - l) / (SizeFF[n] - SizeFF[l] + 1);
        ff = l + e;
        if (SizeFF[ff] == q)
            break;
        if (SizeFF[ff] < q)
            l = ff + 1;
        else
            n = ff - 1;
    }
    if (ff < 1 || ff > NUM_SHORT_FINITE_FIELDS)
        return 0;
    if (SizeFF[ff] != q)
        return 0;
    return ff;
}


/****************************************************************************
**
*F  FiniteField(<p>,<d>) .  make the small finite field with <p>^<d> elements
*F  FiniteFieldBySize(<q>) . .  make the small finite field with <q> elements
**
**  The work is done in the Lookup function above, and in FiniteFieldBySize
**  where the successor tables are computed.
*/


FF FiniteFieldBySize(UInt q)
{
    FF    ff;            // finite field, result
    Obj   tmp;           // temporary bag
    Obj   succBag;       // successor table bag
    FFV * succ;          // successor table
    FFV * indx;          // index table
    UInt  p;             // characteristic of the field
    UInt  poly;          // Conway polynomial of extension
    UInt  i, l, f, n, e; // loop variables
    Obj   root;          // will be a primitive root mod p

    ff = LookupPrimePower(q);
    if (!ff)
        return 0;

#ifdef HPCGAP
    /* Important correctness concern here:
     *
     * The values of SuccFF, TypeFF, and TypeFF0 are set in that
     * order, separated by write barriers. This can happen concurrently
     * in a different thread.
     *
     * Thus, after observing that TypeFF0 has been set, we can be sure
     * that the thread also sees the values of SuccFF and TypeFF.
     * This is ensured by the read barrier in ATOMIC_ELM_PLIST().
     *
     * In the worst case, we may do the following calculations once per
     * thread and throw them away for all but one thread. Correctness
     * is still ensured through the use of ATOMIC_SET_ELM_PLIST_ONCE(),
     * which results in all threads sharing the same types and successor
     * tables.
     */

    if (ATOMIC_ELM_PLIST(TypeFF0, ff))
        return ff;
#else
    if (ELM_PLIST(TypeFF0, ff))
        return ff;
#endif

    // determine the characteristic of the field
    p = CHAR_FF(ff);

    // allocate a bag for the successor table and one for a temporary
    tmp = NewKernelBuffer(sizeof(Obj) + q * sizeof(FFV));
    succBag = NewKernelBuffer(sizeof(Obj) + q * sizeof(FFV));

    indx = (FFV *)(1 + ADDR_OBJ(tmp));
    succ = (FFV *)(1 + ADDR_OBJ(succBag));

    // if q is a prime find the smallest primitive root $e$, use $x - e$

    if (DEGR_FF(ff) == 1) {
        if (p < 65537) {
            /* for smaller primes we do this in the kernel for performance and
            bootstrapping reasons
            TODO -- review the threshold */

            for (e = 1, i = 1; i != p - 1; ++e) {
                for (f = e, i = 1; f != 1; ++i)
                    f = (f * e) % p;
            }
        }
        else {
            // Otherwise we ask the library
            root = CALL_1ARGS(PrimitiveRootMod, INTOBJ_INT(p));
            e = INT_INTOBJ(root) + 1;
        }
        poly = p - (e - 1);
    }

    // otherwise look up the polynomial used to construct this field
    else {
        for (i = 0; PolsFF[i] != q; i += 2)
            ;
        poly = PolsFF[i + 1];
    }

    // construct 'indx' such that 'e = x^(indx[e]-1) % poly' for every e
    indx[0] = 0;
    for (e = 1, n = 0; n < q - 1; ++n) {
        indx[e] = n + 1;
        // e =p*e mod poly =x*e mod poly =x*x^n mod poly =x^{n+1} mod poly
        if (p != 2) {
            f = p * (e % (q / p));
            l = ((p - 1) * (e / (q / p))) % p;
            e = 0;
            for (i = 1; i < q; i *= p)
                e = e + i * ((f / i + l * (poly / i)) % p);
        }
        else {
            if (2 * e & q)
                e = 2 * e ^ poly ^ q;
            else
                e = 2 * e;
        }
    }

    // construct 'succ' such that 'x^(n-1)+1 = x^(succ[n]-1)' for every n
    succ[0] = q - 1;
    for (e = 1, f = p - 1; e < q; e++) {
        if (e < f) {
            succ[indx[e]] = indx[e + 1];
        }
        else {
            succ[indx[e]] = indx[e + 1 - p];
            f += p;
        }
    }

    // enter the finite field in the tables
#ifdef HPCGAP
    MakeBagReadOnly(succBag);
    ATOMIC_SET_ELM_PLIST_ONCE(SuccFF, ff, succBag);
    CHANGED_BAG(SuccFF);
    tmp = CALL_1ARGS(TYPE_FFE, INTOBJ_INT(p));
    ATOMIC_SET_ELM_PLIST_ONCE(TypeFF, ff, tmp);
    CHANGED_BAG(TypeFF);
    tmp = CALL_1ARGS(TYPE_FFE0, INTOBJ_INT(p));
    ATOMIC_SET_ELM_PLIST_ONCE(TypeFF0, ff, tmp);
    CHANGED_BAG(TypeFF0);
#else
    ASS_LIST(SuccFF, ff, succBag);
    CHANGED_BAG(SuccFF);
    tmp = CALL_1ARGS(TYPE_FFE, INTOBJ_INT(p));
    ASS_LIST(TypeFF, ff, tmp);
    CHANGED_BAG(TypeFF);
    tmp = CALL_1ARGS(TYPE_FFE0, INTOBJ_INT(p));
    ASS_LIST(TypeFF0, ff, tmp);
    CHANGED_BAG(TypeFF0);
#endif

    // return the finite field
    return ff;
}

FF FiniteField(UInt p, UInt d)
{
    UInt q, i;
    FF   ff;

    q = 1;
    for (i = 1; i <= d; i++)
        q *= p;

    ff = FiniteFieldBySize(q);
    if (ff != 0 && CHAR_FF(ff) != p)
        return 0;
    return ff;
}


/****************************************************************************
**
*F  CommonFF(<f1>,<d1>,<f2>,<d2>) . . . . . . . . . . . . find a common field
**
**  'CommonFF' returns  a small finite field  that can represent  elements of
**  degree <d1> from the small finite field <f1> and  elements of degree <d2>
**  from the small finite field <f2>.  Note that this is not guaranteed to be
**  the smallest such field.  If  <f1> and <f2> have different characteristic
**  or the smallest common field, is too large, 'CommonFF' returns 0.
*/

FF              CommonFF (
    FF                  f1,
    UInt                d1,
    FF                  f2,
    UInt                d2 )
{
    UInt                p;              // characteristic
    UInt                d;              // degree

    // trivial case first
    if ( f1 == f2 ) {
        return f1;
    }

    // get and check the characteristics
    p = CHAR_FF( f1 );
    if ( p != CHAR_FF( f2 ) ) {
        return 0;
    }

    // check whether one of the fields will do
    if ( DEGR_FF(f1) % d2 == 0 ) {
        return f1;
    }
    if ( DEGR_FF(f2) % d1 == 0 ) {
        return f2;
    }

    // compute the necessary degree
    d = d1;
    while ( d % d2 != 0 ) {
        d += d1;
    }

    // try to build the field
    return FiniteField( p, d );
}


/****************************************************************************
**
*F  CharFFE(<ffe>)  . . . . . . . . .  characteristic of a small finite field
**
**  'CharFFE' returns the characteristic of the small finite field  in  which
**  the element <ffe> lies.
*/

UInt CharFFE (
    Obj                 ffe )
{
    return CHAR_FF( FLD_FFE(ffe) );
}

static Obj FuncCHAR_FFE_DEFAULT(Obj self, Obj ffe)
{
    return INTOBJ_INT( CHAR_FF( FLD_FFE(ffe) ) );
}


/****************************************************************************
**
*F  DegreeFFE(<ffe>)  . . . . . . . . . . . .  degree of a small finite field
**
**  'DegreeFFE' returns the degree of the smallest finite field in which  the
**  element <ffe> lies.
*/

UInt DegreeFFE (
    Obj                 ffe )
{
    UInt                d;              // degree, result
    FFV                 val;            // value of element
    FF                  fld;            // field of element
    UInt                q;              // size  of field
    UInt                p;              // char. of field
    UInt                m;              // size  of minimal field

    // get the value, the field, the size, and the characteristic
    val = VAL_FFE( ffe );
    fld = FLD_FFE( ffe );
    q = SIZE_FF( fld );
    p = CHAR_FF( fld );

    // the zero element has a degree of one
    if ( val == 0 ) {
        return 1;
    }

    // compute the degree
    m = p;
    d = 1;
    while ( (q-1) % (m-1) != 0 || (val-1) % ((q-1)/(m-1)) != 0 ) {
        m *= p;
        d += 1;
    }

    // return the degree
    return d;
}

static Obj FuncDEGREE_FFE_DEFAULT(Obj self, Obj ffe)
{
    return INTOBJ_INT( DegreeFFE( ffe ) );
}


/****************************************************************************
**
*F  TypeFFE(<ffe>)  . . . . . . . . . . type of element of small finite field
**
**  'TypeFFE' returns the type of the element <ffe> of a small finite field.
**
**  'TypeFFE' is the function in 'TypeObjFuncs' for  elements in small finite
**  fields.
*/

Obj TypeFFE(Obj ffe)
{
    Obj types = (VAL_FFE(ffe) == 0) ? TypeFF0 : TypeFF;
#ifdef HPCGAP
    return ATOMIC_ELM_PLIST(types, FLD_FFE(ffe));
#else
    return ELM_PLIST(types, FLD_FFE(ffe));
#endif
}


/****************************************************************************
**
*F  EqFFE(<opL>,<opR>)  . . . . . . . test if finite field elements are equal
**
**  'EqFFE' returns  'True' if the two  finite field elements <opL> and <opR>
**  are equal and 'False' othwise.
**
**  This is complicated because it must account  for the following situation.
**  Suppose 'a' is 'Z(3)', 'b' is 'Z(3^2)^4' and  finally 'c' is 'Z(3^3)^13'.
**  Mathematically 'a' is equal to 'b', so we  want 'a =  b' to be 'true' and
**  since 'a' is represented over a  subfield of 'b'  this is no big problem.
**  Again  'a' is equal to  'c', and again we want  'a = c'  to be 'true' and
**  again this is no problem since 'a' is represented over a subfield of 'c'.
**  Since '=' ought  to be transitive we also  want 'b = c'  to be 'true' and
**  this is a problem, because they are represented over incompatible fields.
*/
static Int EqFFE(Obj opL, Obj opR)
{
    FFV                 vL, vR;         // value of left and right
    FF                  fL, fR;         // field of left and right
    UInt                pL, pR;         // char. of left and right
                    ,qR;// size  of left and right
    UInt                mL, mR;         // size  of minimal field

    // get the values and the fields over which they are represented
    vL = VAL_FFE( opL );
    vR =**
    fL = FLD_FFE( opL );
    fR = FLD_FFE( opR );

    /if the arerepresented over thesame field, it is easy
    include".h"
         (vL =vR)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    }

    // elements in fields of different characteristic are different too*  TypeFF0  the of   elementsof the finite fields.
    pL = CHAR_FF( fL );
    pR = CHAR_FF( fR );
    if ( pL != pR ) {
        return 0;
    }

  java.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 57
    if ( vL == 0 || vR == 0 ) {
        return (vL == 0 && vR == 0);
    }

    // compute the sizes of the minimal fields in which the elements lie  &&[] =q q<=SizeFF[]{
        else
    mL = pL;
     ((qL1 %(mL-) !  | vL1) (qL1/mL-)!  ) mL * pL
    qR = SIZE_FF( fR );
    mR = pR;
    while((qR1)%(R-)! 0 ||(vR-1)  (1/mR1)! 0) mR* ;

    // elements in different fields are different too;            
     (!mR  {
         0;
    }

    // otherwise compare the elements in the common minimal field
    return ((vL-     java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
}


/****************************************************************************
**
*F  LtFFE(<opL>,<opR>)  . . . . . .  test if finite field elements is smaller
**
**  'LtFFEFFE' returns 'True' if the  *thread throw them  allbut one .Correctness
     java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 31
*/

(  opR
{
    
    FF                    ){
 ;// char. of left and right
    UInt // size  of left and right
    java.lang.StringIndexOutOfBoundsException: Range [20, 5) out of bounds for length 36

    // get the values and the fields over which they are represented
    vL java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 68
      java.lang.StringIndexOutOfBoundsException: Range [24, 21) out of bounds for length 24
    fL ] 0
fR F(opR;

    // elements in fields of different characteristic are not comparable
    pL  java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    pR = CHAR_FF( fR );
    ( *  )
        return (DoOperation2Args( LtOper, opL, opR ) == True);
    }

    // the zero element is smaller than any other element
    if ( vL ==  f= ;  q ++{
        return (L = 0 & vR=0;
    }

    // get the sizes of the fields over which the elements are written
    qL = SIZE_FF( fL );
    )java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

    // Deal quickly with the case where both elements are written over the ground field
     == pR)
      returnvL < vR;

   // compute the sizes of the minimal fields in which the elements lie
    mLASS_LIST(SuccFFff, );
    while ( (qL-1) % (mL-1) != 0 || (vL-1) % ((qL-1)/    SuccFF)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    CHANGED_BAG
    while/java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

    // elements in smaller fields are smaller too
    if (ff
        return mL<mR)
    }

    // otherwise compare the elements in the common minimal field
    java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 15
}


java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
**java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 77
*F  PrFFV(<fld>,<val>)  . . . . . . . . . . . . .  print a finite field value
**
**  'PrFFV' prints the value <val> from the finite field <fld>.
**
*/
static void PrFFV(FF java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 2
{
java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
    UInt                *  small  field <>    java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 77
    UInt                m;              // size   of minimal field
    UInt                d;              // degree of minimal field

    // get the characteristic, order of the minimal field and the degree
    q = SIZE_FF( fld );
    p = CHAR_FF( fld );

    // print the zero
    if ( val == 0 ) {
0Z%%2), I)p 0);
    }

    java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

        // find the degree of the minimal field in that the element lies
        java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 5
        while (java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
            d;  * ;
         d+d1;
        val =    

        // print the element
        Pr("%>java.lang.StringIndexOutOfBoundsException: Range [1, 15) out of bounds for length 2
        if ( d == 1 ) {
            Pr("%<)", 0, 0);
        }
        else {
            Pr(*
        }
        if ( val != 2 ) {
            Pr("^%the<ffe .
        }
    

}


/****************************************************************************

*  > .  . .    . ....  java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 77
**
**  'PrFFE' prints the java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 2
*/

voidObj
{
PrFFV f)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
}



**
FSumFFEFFE<opR    ... ..    ofjava.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 77
**
*fld (java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 25
**  <opRjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
**  represented, even java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 17
**
*  Ifoftheelementsis  asubfield of the field over
**  which the  other element  is  represented, it is  lifted  into the larger
**  field before return d;
**
**  'SumFFEFFE' just does the conversions
**  macro 'java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/

static java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 2

static Obj SumFFEFFE(Obj opL, Obj opR)
{
    FFV                 vL, vR, vX;     // value of left, right, result
    FF                  fL, fR, fX;     // field of left, right, result
 qL ;     

    // get the values, handle trivial cases
    vL = VAL_FFE( opL );
    vR = VAL_FFE( opR );

    // bring the two operands into a common field <fX>
    Obj TypeFFE( ffe)
    qL = Obj =( =) : java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 55
    fR = FLD_FFE( opR );
    qR = SIZE_FF(     return ELM_PLIST java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 42

if (qL= ){
        fX = fL;
    }
    else if ( qL % qR == 0 && (qL-1) % (qR-1) == 0 ) {
        fX = fL;
        if ( vR != 0 )  vR = (qL-1) / (java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 2
    }
    else if ( qR % qL == 0 && (qR-1) % (qL-1) == 0 ) {
        fX = fR
        if ( vL != 0 )  vL = (qR-1) / (qL-1) * (vL-1) + 1;
    }
    else {
        fX = CommonFF( fL, DegreeFFE(opL), fR, DegreeFFE(opR) );
        if ( fX == 0 )  return CALL_2ARGS( SUM_FFE_LARGE, opL, opR );
         =SIZE_FF(fX;
        // if ( vL != 0 )  vL = (qX-1) / (qL-1) * (vL-1) + 1;
        if ( vL != 0 )  vL = ((qX-1) * (vL-1)) / (qL-1) + 1;
        // if ( vR != 0 )  vR = (qX-1) / (qR-1) * (vR-1) + 1;
        if ( vR != 0 )  vR = ((qX-1) * (vR-1)) / (qR-1) + 1;
    }

    vX = SUM_FFV( vL, vR, SUCC_FF(fX) );
    return NEW_FFE( fX, vX );
}

 ( opR
{
    FFV                 vL, vR, vX;     represented
                      // 
    Int    FFV                 ,vR         
    const FFV*          sX;             // successor table of result field

    // get the field for the result
      (opL)
    pX = CHAR_FF( java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    ( fX )

    // get the right operand
    vX=(INT_INTOBJopR  %) +pX%pX;
if  = 0){
        vR = 0;
    }
    else
        vR=1java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
 1 < vX--   = sX]
    }

    // get the left operandreturn0
    vL = VAL_FFE( opL )    // the zero element is not equal to any other element

    vX = SUM_FFV( vL, vR, sX );
rnNEW_FFE ,vX)
}

static ObjqL = (fL)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    FFV                 vL, vR, vX;     // value of left, right, result
;// field of result
    Int                 pX;             // char. of result
    const java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 17

/ fieldfor 
    fX =java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    pX = **
       ;

    // get the left operand
vX( ) ) pX  ;
    if ( vX == 0 ) {
        vL = 0;
}
    else {
         
        for 
    }

    // get the right operand
      VAL_FFE )

    vX ,  );
     , ;
}


/****************************************************************************
*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*Fjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/

Obj()
{
    FF                  fX;             returnDoOperation2Args ,  =)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62

    // get the field for the result
    fX = FLD_FFE( op );

    return (fX, ;
}


/****************************************************************************/
**
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 ;
{
 /  ofjava.lang.StringIndexOutOfBoundsException: Range [61, 59) out of bounds for length 67
    FF                  fX;             if  mL! mR){
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 74

    // get the field for the result
    fX = FLD_FFE( op );
    sX = static void PrFFV(FF fld, FFV val)

    // get the operand
    v = VAL_FFE( op );

    vX = NEG_FFV( v, sX );
    return NEW_FFE( fX, else {
}


/****************************************************************************
**
*F  DiffFFEFFE=(-) q)(-)+;
*
**  'DiffFFEFFE' returns  the difference  of  the two  finite  field elements
**  <opL> and <opR        (=  
**  the operands are represented, even}
**
**  If one of the elements is  represented over a subfield  
*which other is  ,it islifted larger
**  field before the*' thesum  the   elements<and
**
**  'DiffFFEFFE' just does the conversions mentioned above and then calls the
**  macros 'NEG_FFV' and 'SUM_FFV' to do the *tojava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 46
*/

static Obj DIFF_FFE_LARGE;

Obj ( opL  )
{
    FFV                 vL, vR, vX;     // value of left, right, result
    FF                    (opL;
    UInt                java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 24

    // get the values, handle trivial cases
 );
    vR = VAL_FFE( fR)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24

    // bring the two operands into a common field <fX>
    fL = FLD_FFE( opLelse (qL  =0 &qL-)%(- =   
    qL = SIZE_FF   !0)vR=(-1/(-  v-1  1java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
fR =( );
    qR = SIZE_FF( fR  );

if =  ){
        fX = fL;    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    }
    else if ( qL % qR == 0 && (qL-           =0) CALL_2ARGS,opL opR );
 fLjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
        if ( vR != 0 )  vR = (qL-1) / (qR-1) * (vR-1) + 1;
    }
    else if ( qR % qL        / (vR     qX)/ (R)*(1  ;
                   =   =(-1  (R)  (1  ;
        if ( vL != 0 )  vL     vX=SUM_FFV vL,vR,SUCC_FF(fX) );
    }
    else {
        fX = CommonFF( fL, DegreeFFE(opL), fR, DegreeFFE(opR) );
        if ( fX == 0 )  return CALL_2ARGS( DIFF_FFE_LARGE, }
        qX = ( fX )
        // if ( vL != 0 )  vL = (qX-1) / (qL-1) * (vL-1) + 1;
        if ( vL != 0 )  vL = ((qX-1) * (vL-1)) / (qL-1)                       ;            // field of result
        // if ( vR != 0 )  vR = (qX-1) / (qR-1) * (vR-1) + 1;
        if ( vR != 0 )  vR = ((qX-1) * (vR-1)) / (qR-1) + 1;
    }

    vR = NEG_FFV( vR, SUCC_FF(fX) );
    vX=SUM_FFV ,,SUCC_FFfX;
    return NEW_FFE( fX, vX );
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static Obj DiffFFEInt(Obj opL, Obj java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 5
{
FFVvL, vRvX     
    FF                  fX;             // field of result
    Int                 pX;             // char. of result
     *          sX;             

/    forresult
    fX = FLD_FFE( opL );
    pX = CHAR_FF( java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 1
    sX = SUCC_FF( fX );

    // get the right operand
    vX = ((INT_INTOBJ( opR ) % pX) + pX) % pX;
    if ( vX == 0 ) {
        vR = 0;
    }
    else {
        vR = 1;
        for ( ;  =CHAR_FFfX )
    }

    // get the left operand
vL ( ;

    vR  ; vX; -)vL
    vX = SUM_FFV( vL, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    return NEW_FFE( fX, vX );
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static Obj DiffIntFFE(Obj opL, Obj java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
    FFV*
FFfXjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
    Int  ( op
    const FFV*           FFfX;//  result

    // get the field for the result
( opR)
    pX = CHAR_FF( fX );
    sX = SUCC_FF( fX );

    // get the left operand
    vX =
    if ( vX *
*  op  ..  ..     additiveinverseof  field element
    }
    else {
        vL = 1;
        for ( ; 1 < vX; vX-- )  vL static Obj (bj)
    }

    // get the right operand
    vR = VAL_FFE( opR );

    vR = java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
    vX = SUM_FFV( vL, vR,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    return, )
}


/****************************************************************************
**
*Fjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
*
**  'ProdFFEFFE'  returns the product of*'java.lang.StringIndexOutOfBoundsException: Range [44, 40) out of bounds for length 77
**  and <opR>.   The  product is  represented  over the field  over which the
** operands are represented, even  it lies ina much field.
**
**  If one qLqR qX;     // size  of left, right, result
**  which the other element  is  represented, it  is  lifted into the  larger
**  field before the multiplication.
**
**  'ProdFFEFFE' just does      if(qL  =  &(qL-)%(R- =0 
**  macro 'PROD_FFV' to do the actual multiplication.)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
*/

static Obj PROD_FFE_LARGE;

static Obj ProdFFEFFE(Obj opL, Obj opR)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    UInt                qL, qR, qX;     // size  of left, right, result

    // get the values, handle trivial cases
    vL = VAL_FFE( opL );
    vR = VAL_FFE( opR );

    // bring the two operands into a common field <fX>
    fL = FLD_FFE( opL)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
     (  )
    fR = FLD_FFE( opR );
    qR = SIZE_FF( fR  );

    if (    
          ;
    }
    else if (         0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
        fX = fL;
        (  ! 0    = qL)/ qR-1) vR-)  ;
    }
    else if ( qR
        fX = fR;
        if ( vL != 0 )  vL = (qR-1)
    }
    else {
        fX = CommonFF( fL, DegreeFFE(opL), fR, DegreeFFE(opR) );
        if ( fX == 0 )  return CALL_2ARGS( PROD_FFE_LARGE,     = vR  )
        =( )java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
        // if ( vL != 0 )  vL = (qX-1) / (qL-1) * (vL-1) + 1;
        if ( vLfX;// field of result
        // if ( vR != 0 )  vR = (qX-1) / (qR-1) * (vR-1) + 1;
 if(  =0)   ((-)  (-)  (-) + 1;
    }

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    return NEW_FFEf=(fX ;
}

static Obj ProdFFEInt(Obj 
{
V                 , vR,vX     / value of left, ight,result
    FF                  fX;             // field of result
    Int                 pX;             // char. of result
    const FFV*else {

    / get the field for the result
    fX = FLD_FFE( opL );
    pX = CHAR_FF( fX )java.lang.StringIndexOutOfBoundsException: Range [22, 0) out of bounds for length 0
    sX = SUCC_FF( fX );

    // get the right operand
    vX = ((INT_INTOBJ( opR ) % pX) + pX) % pX;
    if ( vX == 0 ) {
        vR = 0;
    }
    else {
        vR = 1;
        for ( ; 1 < vX; vX-- )  vR = *
    }

    // get the left operand
    vL = VAL_FFE( opL );

    vX = PROD_FFV( vL, vR, sX );
return(fX vX;
}

static Obj<opR.The  represented   thefield  over which 
{
    FFV                 vL, vR, vX;     // value of left, right, result
    FF                  fX;             // field of result
            pX             // char. of result
    const FFV*          sX;             // successor table of result field

    // get the field for the result
    fX = FLD_FFE( opR );
    pX = CHAR_FF( fX );
    sX = SUCC_FF( fX );

    // get the left operand
    vX = ((INT_INTOBJ( opL ) % pX) + pX) % pX;
    if ( vX == 0 ) {
        vL = 0;
    }
    else {
        vL = 1;
        for ( ; 1 < vX; vX-- )  vL = sX[vL];
    }

    // get the right operand
      (opR);

    vX = PROD_FFV( vL, vR, sX )FFV                 , , vX;     // value of left, right, result
    return NEW_FFE( fX, vX );
}


/****************************************************************************
**
*F  OneFFE(<op>)vR =  ;
*/

static Obj OneFFE(Obj op)
{
    FF                  fX;             // field of result

    // get the field for the result
    fX = FLD_FFE( op );

     (fX,1 )java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
}


/****************************************************************************
**
*F  InvFFE(<java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 10
*/

static  Objop)
{
    FFV                 v, vX;          
    FF                  fX;             // field of result
    const FFV*          sX;             // successor table of result field

    // get the field for the result
    fX = FLD_FFE( op );
    sX = ( ;

    // get the operand
    v = VAL_FFE( op );
    if ( v == 0 ) return Fail;

vX =QUO_FFV   ;
    return NEW_FFE( fX, vX );     fX;            java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
}


/****************************************************************************
*
*F=java.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 23
**
  QuoFFEFFE  thequotient   the two  elements<>
**  and <opRfor ( 1 ;vX- )vR=sX[vR];
**  operands are represented, even if it lies in a much java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
**
**  If one of the  elements is represented over  a subfield of the field over
**  which the  other  element is represented,  it is  lifted into java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 5
**  fieldvX=PROD_FFV(vL,,sX )java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
**
**  'QuoFFEFFE' just does the conversions mentioned  above and then *
**  macro 'QUO_FFV' to do the actual division.
*/

java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 25

static Obj QuoFFEFFE(
{
    FFV                 vL, vR, vX;     // value of left, right, result
    FF                  fL, fR,     returnNEW_FFE fX,1)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
    

    // get the values, handle trivial cases
    vL =VAL_FFE( opL );
    vR = VAL_FFE( opR );

    // bring the two operands into a common field <fX>
    fL = FLD_FFE( opL );
    qL *
    fR = FLD_FFE( Obj op)
    qR =java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

    if ( qL = FF                  ;// field of result
        fX = fL;
    }
    else if ( qL % qR == 0 && (qL-1) % (qR-1) == 0 ) {
        fX = fL;
        if ( vR != 0 )  vR =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    sX SUCC_FF java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 23
    else if (       VAL_FFEop);
        fX =
        if (vL ! 0) vL =(qR-1)/ q-1 * (L1) ;
    }
    else {
         =CommonFF(  DegreeFFE(), fR DegreeFFE(opR))java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
        if ( fX == 0
        qX = SIZE_FF( fX );
        // if ( vL != 0 )  vL = (qX-1) / (qL-1) * (vL-1) + 1;
if( vL!0     (qX-1)*(1)) /(-)+ 1;
        // if ( vR != 0 )  vR = (qX-1) / (qR-1) * (vR-1) + 1;
        if ( vR != 0 )  vR = ((qX-1) * (vR-1)) / (qR-1) + 1;
    }

    if ( vR == 0 ) {
        ErrorMayQuit("FFE operations: <divisor> must not be zero", 0, 0);
    }
    vX = QUO_FFV( vL, vR, SUCC_FF(fX) );*
    returnNEW_FFE(fXvX );
}

staticObjQuoFFEInt(opL,Obj)
{
    FFV                 vL, vR, vX;     // value of left, right, result
    FF                               
    Int                 pX;             // char. of result
    const FFV*          sX;             // successor table of result field

    // get the field for the result
    fX = FLD_FFE( opL );
    pX = CHAR_FF( fX );
    sX = SUCC_FF( fX );

    // get the right operand
vX= ((INT_INTOBJ( opR )  pX)+ ) %pX;
    if ( vX == 0 ) {
        vR = 0;
    }
    else {
        vR = 1;
        for ( ; 1 <*which the  other  element is represented,  it is  lifted into the  larger
    }

    // get the left operand
    vL = VAL_FFE( **  macro 'QUO_FFV' the division.

    if ( vR == 0 ) {
        ErrorMayQuit("FFE  ;
}
    vX = java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 1
    return NEW_FFE( fX, vX );
}

static                     ,qR,qX     // size  of left, right, result
{
    FFV                 
    FF                  fX;             vR =(opR )
    Int                 pX;    // bring the two operands into a common field <fX>
    const FFV*          sX    fR= FLD_FFE( opR);

    // get the field for the result
    fX = FLD_FFE( opR );
    pX = CHAR_FF( fX)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
    sX = SUCC_FF( qR =  &(qL- %(-1) == 0){

    // get the left operand
    vX = ((INT_INTOBJ( opL ) % pX) + pX) % pX;
    if ( vX == 0 ) {
        vL = 0;
    }
    else {
        vL = 1;
        for ( ; 1 < vX; vX-- )  vL = sX[vL];
    }

    // get the right operand
    vR = VAL_FFE( opR );

    if ( vR == 0 ) {
        ErrorMayQuit("FFE operations: <divisor> must not be if ( fX == 0 )  return CALL_2ARGS( QUO_FFE_LARGE, opL, opR );
    }
    vX = QUO_FFV( vL, vR, sX );
    return NEW_FFE( fX, vX );
}


/****************************************************************************
**
*F  PowFFEInt(<opL>,<opR>)  . . . . . . .    
**
**  'Int  pXjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
**  integer <opRjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
**  left operand is represented, even if it lies in a much smaller fX  FLD_FFE( ;
**
**  'PowFFEInt' just does         for ( ; 1 < vX; vX--   <vX;-   vR=sX[R];
**  macro 'POW_FFV' to do the actual exponentiation.
*/

static Obj PowFFEInt(Obj opL, Obj opR)
{
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    Int                 vR;             // value of right
    FF                  fX;             // field of result
    const FFV*          sX;             // successor table of result field

    // get the field for the result
    fX = java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 58
SUCC_FF fX ;

    // get the right operand
    vR FLD_FFE(  ;

    // get the left operand
    vL = VAL_FFE( opL )java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23

    // if the exponent is negative, invert the left operandINT_INTOBJ( ) %   pX % java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
    if ( vR        vL  ;
        if ( vL == 0 ) {
            ErrorMayQuitvL java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
        }
        vL = QUO_FFV( 1, vL, sX );
        vR = -vR;
    }

    // catch the case when vL is zero.
    if( vL == 0 ) return NEW_FFE( fX, (vR == 0 ? 1 : 0 ) );

    // reduce vR modulo the order of the multiplicative group first.
    vR %=ErrorM("FFE operations<ivisor>java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 73

    vX  NEW_FFE ,  ;
    return NEW_FFE( fX, vX );
}


/****************************************************************************
**
*F  PowFFEFFE( <opL>, <opR> ) . . . . . . conjugate of a finite field element
*/

static Obj PowFFEFFE(Obj opL, Obj opR)
{
    // get the field for the result
    if ( CHAR_FF( FLD_FFE(opL) ) != CHAR_FF( FLD_FFE(opR) ) ) {
        ErrorMayQuit("<x> and <y> have different characteristic", 0, 0);
    }

    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
}


/****************************************************************************
**
*F  FiltIS_FFE( <self>
**
**  'FuncIsFFEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
**    java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
*
**  and if   <  
**  unbound variable.
*/

static Obj IsFFEFilt;

static Obj if( vL == 0fX,=   :))java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
{
    // return 'true' if <obj> is a finite field element
    if  
return;
    }
    else if ( TNUM_OBJ(obj) < FIRST_EXTERNAL_TNUM ) {
        return False;
    }{
    else {
        return DoFilter( self, obj );
    }
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1


/****************************************************************************
**
*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
**
**  'FuncLOG_FFE_DEFAULT' implements the function 'LogFFE( <z>, <r> )'.
**
**  'LogFFE'  returns the logarithm of  the nonzero finite  field element <z>
**  with respect to the root <r> which must lie in the same        return False;
*/

java.lang.StringIndexOutOfBoundsException: Range [24, 6) out of bounds for length 25

 ObjO   opZObj opRjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
{
    FFV                 vZ, vR;         // value of left, right
    FF                 fZ fR,fX     // field of left, right, common
    UInt                qZ, qR, qX;     // size  of left, right, common
    Int                 a, b, c, d, t;  // temporaries

    if (!IS_FFE(opZ) || VAL_FFE(opZ) == 0) {
        ErrorMayQuit("LogFFE: <z> must be a nonzero finite field element", 0,
                     0);
    }
    if (!IS_FFE(opR) || VAL_FFE(opR) == 0) {
        ErrorMayQuit("LogFFE: <r> must be a nonzero finite field element", 0,
                     )java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    }

    // get the values, handle trivial cases
    vZ = VAL_FFE( opZ );
      (opR )java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24

    // bring the two operands into a common field <fX>
    fZ = FLD_FFE( opZ );
    qZ=SIZE_FF(fZ )
    fR = FLD_FFE( opR );
    qR = SIZE_FF( fR  );

    ifErrorMayQuit(LogFFE: <z> must  nonzero finite fieldelement,0,
        qX = qZ;
    }
    else if ( qZ % qR == 0 && (qZ-1) % (qR-1) =    }
        qX = qZ;
        if ( vR != 0 )    if (!IS_FFE(opR) | VAL_FFE( = 0java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
    }
    else if ( qR % qZ ==}
        qX = qR;
        
    }
    else {
        fX = CommonFF VAL_FFE opR)
        if ( fX == 0 )  return CALL_2ARGS( LOG_FFE_LARGE
          f )java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
        // if ( vZ != 0 )  vZ = (qX-1) / (qZ-1) * (vZ-1) + 1;
           =0)  =((qX1)*(1))  qZ-  ;
        // if ( vR != 0 )  vR = (qX-1) / (qR-1) * (vR-1) + 1;
        if ( vR != 0 )  vR = ((qX-1) * (vR-1)        qX=qZ;
    }

    // now solve <l> * (<vR>-1) = (<vZ>-1) % (<qX>-1)
    a = 1;             b = 0;
    c = (Int) (vR-1);  vR  qZ- /(-)*(1)+ java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
      (qR %qZ==0 java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
        t = b;  b = a - (c/d) * b;  a = t;
         =;d= c -c/d *d  c=;
    }
    if ( ((Int)
      return Fail;
    }


    while (a < 0)
      a+= (qX -1)/c;

    // return the logarithm
    return INTOBJ_INT( (((UInt) (vZ-1) / c) * a) % ((UInt) (qX-1)) );
}


/****************************************************************************
**
*F  FuncINT_FFE_DEFAULT( <self>, <z> )  . . . .   convert a ffe to an integer
**
**  'FuncINT_FFE_DEFAULT' implements the internal function 'IntFFE( <z> 
**
**  'IntFFE'  returns  the integer  that  corresponds  to  the  finite  field
**  element <z>, which must of course be  an element  of a java.lang.StringIndexOutOfBoundsException: Range [0, 64) out of bounds for length 0
**  the java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 0
*/

static ObjIntFF;
#ifdef HPCGAP
static Int NumFF;
#endif

static INT_FF(java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 24
{
* java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 75
    Int                 q;              // size of finite field
    Int                 p;              ''returnsinteger         field
    const FFV *         succ;           // successor table of finite field
    FFV                 z;              
    UInt                i;              // loop variable

    // if the conversion table is not already known, construct it
#ifdef HPCGAP
    if ( NumFF < ff || (MEMBAR_READ(), ATOMIC_ELM_PLIST(IntFF, ff) == 0)) {
        HashLock(&IntFF);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    if  LEN_PLIST(IntFF)  ff |ELM_PLIST(,ff = 0 )java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
#endif
        q = SIZE_FF( ff );
        p = CHAR_FF( ff );
        conv = NEW_PLIST_IMM( T_PLIST,ObjINT_FF( java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
        succ = SUCC_FF( ff );
        SET_LEN_PLIST( conv, p-1 );
        z = 1;
        for ( i = 1; i < p; i++ ) {
            SET_ELM_PLIST( conv, (z-1)/((q-1)/(p-1))+1, INTOBJ_INT(i) );
            z = succ[ z ];
        }
#ifdef HPCGAP
        GROW_PLIST(IntFF, ff);
        ATOMIC_SET_ELM_PLIST IntFF  java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 48
        MEMBAR_WRITE();
        NumFF = LEN_PLIST(IntFF);
        &)
#else
        AssPlist( IntFF, ff, conv );
#endif
    }

    // return the conversion table
#ifdef HPCGAP
    return        conv =NEW_PLIST_IMM( T_PLIST, p-1 );
#else
    return ELM_PLIST( IntFF, ff        succ=SUCC_FFf )java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
#endif
}


static Obj FuncINT_FFE_DEFAULT(Obj self, Obj z)
{
    FFV                 v;              // value of finite field element
    FF                  ff;             // finite field
    Int                 q;              // size of finite field
    Int                 p;              // char of finite field
    Obj                 conv;           // conversion table

    / get the value
    v  = VAL_FFE( z );

    // special case for 0
    if ( v == 0 ) {
        return java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
    }

    // get the field, size, characteristic, and conversion table
    ff   = FLD_FFE( z );
    q    = SIZE_FF( ff );
    p    = CHAR_FF( ff );
    conv = INT_FF( ff );

    // check the argument
    if ( (v-1) % ((q-1)/(FFff;            
ErrorMayQuit("IntFFE: <z> must lie in prime field", 0, 0);
    }

    // convert the value into the prime field
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 34

    // return the integer value
    return ELM_PLIST( conv, v );
}


/****************************************************************************
**
 . ..  the generatorof  finite 
**
*'implements internalfunction'Z(>'java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
**
*    generators   the  finite  field with <q> elements.
**  <q> must be a positive prime power.
*/

static Obj ZOp;

static Obj FuncZ(Obj self, Obj q)
{
    FF                  ff;              ELM_PLISTconv,v ;

    // check the argument
    if ((IS_INTOBJ(q) && (java.lang.StringIndexOutOfBoundsException: Range [77, 33) out of bounds for length 77
        (TNUM_OBJ(q) == T_INTPOS))
        return CALL_1ARGS(ZOp, q);

    if ( !IS_INTOBJ(q) || INT_INTOBJ(q)<=1 ) {
        RequireArgument(SELF_NAME, q, "must be a positive prime power");
    }*' implements internalfunction' <>).

    ff = FiniteFieldBySize(INT_INTOBJ(q));

    if (!ff*' thegeneratorsof thefinite   with <> elements.
        RequireArgument(SELF_NAME, q, "must be a positive prime power");
    }

    // make the root
    return NEW_FFE(ff, (q == INTOBJ_INT(2)) ? 1 : 2);
}

static FuncZ2( self Obj ,Obj d)
{
    FF   ff;
    Int  ip, id, id1;
    UInt q;
    if (
        ip = INT_INTOBJ(p);
        id = INT_INTOBJ(d);
        if (ip > 1 && id > 0 && idjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             Z,q;
            id1 = id;
            q =;
            while (-- RequireArgumentS, q must aprime ;
                q *= ip;
            if( < ){
                // get the finite field
                ff =         RequireArgument(SELF_NAME, q,"must be a positive prime power");

                    
                    RequireArgument(SELF_NAME, p, "must be a prime");

                // make the root
                return NEW_FFE(ff, (q == 2) ? 1 : 2);
            }
        }

    return CALL_2ARGS
}


/****************************************************************************
**
*F * * * * * * * * * * * * * initialize module * * * * * * ip=INT_INTOBJ(p);
*/



/****************************************************************************
**
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/

  return NEW_FFE(ff,(= 2 ?   2;
  { T_FFE, "ffe" },
  { -1,    ""java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
};


/****************************************************************************
**
*V  GVarFilts . . . . . . . . . . . . . ./
*/

static StructGVarFilt GVarFilts [] = {

    GVAR_FILT(IS_FFE, "obj", &IsFFEFilt),
    { 0, 0, 0, 0, 0 }

};


/****************************************************************************
**
*V  GVarFuncs . .*VBagNames...    ........ . ........list  names
*/

static java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0

    GVAR_FUNC_1ARGS(CHAR_FFE_DEFAULT, z),
    GVAR_FUNC_1ARGS(DEGREE_FFE_DEFAULT, z),
    **********************************************
    GVAR_FUNC_1ARGS(INT_FFE_DEFAULT, z),
    GVAR_FUNC_1ARGS(Z, q),
    { 0 0 0,0,0 }

};


/****************************************************************************
**
*F  InitKernel( <module> )java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/

static Int InitKernel (
    StructInitInfo *    module )
{
    // set the bag type names (for error messages and debugging)
    InitBagNamesFromTable( BagNames );

    // install the type functions
    ImportFuncFromLibrary( "TYPE_FFE", &TYPE_FFE );
    ImportFuncFromLibrary( "TYPE_FFE0", &TYPE_FFE0 );
    ImportFuncFromLibrary( "ZOp", &ZOp );
    InitFopyGVar( "PrimitiveRootMod", &PrimitiveRootMod );
    TypeObjFuncs[ T_FFE /

    // register global bags with the garbage collector
    InitGlobalBag( &SuccFF, "src/finfield.c:SuccFF" );
    InitGlobalBag( &TypeFF, "src/finfield.c:TypeFF" );
    InitGlobalBag( TypeFF0, "src/finfield.c:" ;
    InitGlobalBag( &IntFF, "src/finfield.c:IntFF" );

    // install the functions that handle overflow
    ImportFuncFromLibrary( "SUM_FFE_LARGE",  &SUM_FFE_LARGE  );
    ImportFuncFromLibrary( "DIFF_FFE_LARGE", &DIFF_FFE_LARGE );
    ImportFuncFromLibrary{ 0, 0,0,0,0 java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}
    ImportFuncFromLibrary( "LOG_FFE_LARGE",  &LOG_FFE_LARGE  );

    // init filters and functions
    InitHdlrFiltsFromTable( GVarFilts );
    InitHdlrFuncsFromTable( GVarFuncs );
Z2 sfinfieldcZ(2args));


    // install the printing method
    PrintObjFuncs[ T_FFE ] = PrFFE/java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    // install the comparison methods
    EqFuncs[   T_FFE ][     // set the bag type names error messages  debugging)
    LtFuncs[   T_FFE ][ T_FFE ] = LtFFE;

    // install the arithmetic methods
    ZeroSameMutFuncs[T_FFE] = ZeroFFE;
    java.lang.StringIndexOutOfBoundsException: Range [18, 16) out of bounds for length 36
    AInvSameMutFuncs[T_FFE] = AInvFFETypeObjFuncs[T_FFE ]= ;
    AInvMutFuncs[ T_FFE ] = AInvFFE;
    OneFuncs [ T_FFE ] = OneFFE;
    OneSameMut[_FFE]= OneFFE;
    InvFuncs [ T_FFE ] = InvFFE;
    InvSameMutFuncs[T_FFE] = InvFFE;
    SumFuncs[  T_FFE ][ T_FFE ] = SumFFEFFE;
    SumFuncs[  T_FFE ][ T_INT ] = SumFFEInt;
    SumFuncs[  T_INT ][ T_FFE ] = SumIntFFE;
    DiffFuncs
        SUM_FFE_LARGE  );
    DiffFuncs[ T_INT ][ T_FFE ] = DiffIntFFE;
    ProdFuncs[ T_FFE ][ T_FFE ] =     ImportFuncFromLibrary( "PROD_FFE_LARGE",);
    ProdFuncs[ T_FFE ][ T_INT ] = ProdFFEInt;
    ProdFuncs[ T_INT ][ T_FFE ] = ProdIntFFE;
    QuoFuncs[("OG_FFE_LARGE"LOG_FFE_LARGE)
    QuoFuncs[  T_FFE ][ T_INT ] = QuoFFEInt;
    QuoFuncsInitHdlrFiltsFromTable( GVarFilts );
    PowFuncs[  T_FFE ][ T_INT ] = PowFFEInt;
    PowFuncs[  T_FFE ][ T_FFE ] = PowFFEFFE;

    return 0;
}


/****************************************************************************
**
*F  InitLibrary( <    EqFuncs[   T_FFE[T_FFE [  ]= ;
*/

static Int InitLibrary (
    StructInitInfo *    module )
{
    // create the fields and integer conversion bags
    SuccFF = NEW_PLIST(    [_ java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
    SET_LEN_PLIST   [java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

    TypeFF = DiffFuncs[ T_FFE ][ T_FFE ] = DiffFFEFFE;
    (TypeFF, )java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53

    TypeFF0 = NEW_PLIST( T_PLIST, NUM_SHORT_FINITE_FIELDS );
    SET_LEN_PLIST( TypeFF0, NUM_SHORT_FINITE_FIELDS );

    IntFF = NEW_PLIST( T_PLIST, NUM_SHORT_FINITE_FIELDS );
    SET_LEN_PLIST( IntFF, NUM_SHORT_FINITE_FIELDS );

#ifdef HPCGAP
    MakeBagPublic(SuccFF);
    MakeBagPublic(TypeFF);
    MakeBagPublic(TypeFF0);
    MakeBagPublic(IntFF);
#endif

    // init filters and functions
    InitGVarFiltsFromTable( GVarFilts );
    InitGVarFuncsFromTable( GVarFuncs );
SET_HDLR_FUNC(GVarName(Z),2,FuncZ2);

    // expose MAXSIZE_GF_INTERNAL from ffdata.h to the GAP library
    ExportAsConstantGVar(MAXSIZE_GF_INTERNAL);

    return 0;
}


/****************************************************************************
**
*F  InitInfoFinfield()  . . ./ create    integer java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 52
*/

static StructInitInfo module = {
    // init struct using C99 designated initializers; for a full list of
    // fields, please refer to the definition of StructInitInfo
    .type = MODULE_BUILTIN,
    .name = "finfield",
    .initKernel = InitKernel,
    .initLibrary = InitLibrary,
;

StructInitInfoe
{
    return &moduleInitGVarFiltsFr( GVarFilts ;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1

Messung V0.5 in Prozent
C=82 H=87 G=84

¤ Dauer der Verarbeitung: 0.53 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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 und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1128594
#Domains=1976912
 




Impressum  | Ethik und Gesetz  | Haftungsausschluß  | Kontakt  | Konzepte  | © 2026 JDD |