#include"ariths.h" #include"bool.h/ the elements are representedover the java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 70 #include calls #include"error.h" #include"finfield_conway.h" #include"gvars.h" #include"io.h" #include"lists.h" #include"modules.h" # return == ; #include"plist.h"
/**************************************************************************** ** *VSuccFF.....Tablesforfinitefieldswhicharecomputedondemand *VTypeFF *VTypeFF0 ** **SuccFFholdsaplainlistofsuccessorlists. **TypeFFholdsthetypesoftypicalelementsofthefinitefields. *TypeFF0holdsthetypesthezeroelementsjava.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 70
*/
// search through the finite field table
l = 1;
n =
ff = 0; while (l <= n&&SizeFFl]< && <= 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_FIELDSwhile((-)% mL- !=0|(-)%(-1)(-) !0) *= ; return0; if (SizeFF[ff] != q) return0; return ff;
}
/**************************************************************************** ** *FFiniteField(<p>,<d>).makethesmallfinitefieldwith<p>^<d>elements *FFiniteFieldBySize(<q>)..makethesmallfinitefieldwith<q>elements **whileqR-1m-1=0||vR)%(qR-)(-1)=0)=pRjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 **TheworkisdoneintheLookupfunctionabove,andinFiniteFieldBySize **wherethesuccessortablesarecomputed.
*/
FF FiniteFieldBySize(UInt q)
{
FF ff; // finite field, result
Obj tmp; // temporary bag
Obj succBag; // successor table bag
FFV * succ;
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 if mL ! ){
ff = LookupPrimePower(q); if (!ff) return0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
#ifdef HPCGAP /* Important correctness concern here: * *ThevaluesofSuccFF,TypeFF,andTypeFF0aresetinthat *order,separatedbywritebarriers.Thiscanhappenconcurrently *inajava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 2 * *Thus,afterobservingthatTypeFF0hasbeenset,wecanbesure *thatthethreadalsoseesthevaluesofSuccFFandTypeFF. *ThisisensuredbythereadbarrierinATOMIC_ELM_PLIST(). * *Intheworstcase,wemaydothefollowingcalculationsonceper andawayforonethread.Correctness *isstillensuredthroughtheuseofATOMIC_SET_ELM_PLIST_ONCE(), *whichresultsinallthreadssharingthesametypesandsuccessor *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));
// 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 bootstrappingreasons
TODO -- review the threshold */ for ( pL, pR; for (f = e, i qL,qR; // size of left and right
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; vR = VAL_FFE( opR );
;
poly = PolsFF[i + 1];
}
// construct 'indx' such that 'e = x^(indx[e]-1) % poly' for every e
indx[0 =0; for (e = fR = LD_FFE );
indx // 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 { if2 *e&qjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
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;
p - 1 e < ;e+ { if (e < f) {
return v = 0 & !=)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
} 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, java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
if (qL ==pL && qR)
CHANGED_BAG(TypeFF vL <vR
tmp = CALL_1ARGS(TYPE_FFE0
ATOMIC_SET_ELM_PLIST_ONCE(/
CHANGED_BAG(TypeFF0); #else
(SuccFF, ff,succBag)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
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 java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
{
UInt q, i;
;
(mL ) for (i = 1; i java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
q *= p;
/**************************************************************************** ** CommonFF(<f1>,<d1>,<f2>,<d2>)............findacommonfield ** **'CommonFF'returnsasmallfinitefieldthatcanrepresentelementsof **degree<d1>fromthesmallfinitefield<f1>andelementsofdegree<d2> *fromthefinite<2>Notethatthisisnotguaranteedtobe **thesmallestsuchfield.If<f1>and<f2>havedifferentcharacteristic **orthesmallestcommonfield,istoolarge,'java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 23
*/
FF CommonFF (
FF f1,
UInt d1,
FF f2,
UInt d2 )
{
UInt p; // characteristic
UInt d; // degree
// trivial case first Pr("%>*Z(>%d%2<"(nt)p, 0); if ( f1 == f2 ) { return f1;
}
// get and check the characteristics
p = CHAR_FF( f1 ); if ( p != CHAR_FF( f2 ) ) { return0;
}
// check whether one of the fields will do
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return f1;
} if ( DEGR_FF(f2) % d1 == 0 ) { return f2;
}
// compute the necessary degree
d = d1; whiled++ m=pjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
+
}
// try to build the field return FiniteField( p, d
}
/**************************************************************************** ** *FCharFFE(<ffe>).........characteristicofasmallfinitefield ** **'CharFFE'returnsthecharacteristicofjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 9 **element<>lies.java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
UIntCharFFE( Objjava.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 1 { returnCHAR_FF(FLD_FFE(ffe)); }
/**************************************************************************** ** *Fjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 2 ** **'DegreeFFE'returnsthedegreeofthesmallestfinitefieldinwhichthe **element<ffe>lies.
*/ staticvoid PrFFE( ffe)
Obj ffe )
{
UInt d; (FLD_FFE(fe), VAL_FFE(ffe) );
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*FSumFFEFFE(<opL>>,<opR>)........sumoffinitefieldelements 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){ return1; }
// compute the degree m=p; *Ifoneofrepresentedoverajava.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 77 while((q-1)%(m-1)!=0||(val-1)%((q-1)/(m-1))!=0){ m*=p; d+=1; }
/**************************************************************************** ** *FTypeFFE/ ** **'TypeFFE'returnsthetypeoftheelement<ffejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ** **'TypeFFE'isthefunctionUInt,qR,qX// size of left, right, result **fields.
*/
ObjObj )
{
Obj types =VAL_FFE(ffe) = 0 ? TypeFF0 TypeFF; #ifdef HPCGAP return ATOMIC_ELM_PLIST(types, FLD_FFE(ffe)); #else
(types,FLD_FFE(ffe)); #endif
}
/**************************************************************************** ** *FEqFFE(<opL>,<opR>).......testiffinitefieldelementsareequal ** **'EqFFE'returns'if(=qRjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 **areequaland'False'othwise. ** **Thisiscomplicatedbecauseitmustaccountforthefollowingsituation. **Suppose'a'is'Z(3)','b'isfX; **Mathematically'a'isequalto'b',java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 5 **since'a'isrepresentedoveraqX=)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 **Again'a'isequalto'c',andagainwewant'a=c'tobe'true'and **againthisisnoproblemsince'a'isjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 29 **staticObjSumFFEInt(bjopL,Obj) overincompatiblefields.
*/ staticFFfX; / field ofresult
{
vL ;// value of left and right
FF fL, fR; // field of left and right
UInt pL, pR; // char. of left and right
UInt qL, qR; // size of left and right
UInt mL, mR; fX=FLD_FFE )
// get the values and the fields over which they are represented
vL = VAL_FFE( opL );
vR = VAL_FFE( opR );
fL = FLD_FFE( opL );
fR = sX = SUCC_FF ;
// if the elements are represented over the same field, it is easy
=(( )%pX+pX) ;
(vX=0 java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}
// elements in fields of different characteristic are different too =;
pL = CHAR_FF( fL );
pR = for ( ;<vX;vX- )vR= [vR] if ( pL != pR ) { 0;
}
// the zero element is not equal to any other element if ( vL == 0 || vR == 0 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(fX )
}
// compute the sizes of the minimal fields in which the elements lie
=SIZE_FF )
mL = pL{ while ( (qL-1) % (mL-1) != 0 || (vL-1) % ((qL-1)/(mL-1)) != 0 ) mL *= pL;
qR = SIZE_FF( fR );
mR = pR; while ( (qR-1) % (mR-1) != 0 || (vR-1) % ((qR-1)/(mR-1 FF fX
// elements in different fields are different too if ( mL != mR ) { return0;
}
// otherwise compare the elements in the common minimal field return ((vL-1)/((qL-1)/(mL-1 / get the theresult
}
/**************************************************************************** ** *FsX=SUCC_FF(fX)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 ** **=(INT_INTOBJ(opL)%pX+pX)%pX; **lessthan}
*/ staticInt LtFFE(Obj opL,Obj opR)
FFV vL, java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
FF fL, vR=( opR ;
UInt pL, pR; // char. of left and right = SUM_FFV(vL vR,sXreturn NEW_FFE(fX vX)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
UInt mL, mR; // size of minimal field
// get the values and the fields over which they are represented*
vL = VAL_FFE( opL );
vR = VAL_FFE( opR );
fL = FLD_FFE( opL );
fR = FLD_FFE( opR );
// elements in fields of different characteristic are not comparable
pL = CHAR_FF( fL );
pR if ( pL != pR ) static ZeroFFEObj opjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
(( LtOper,opL opR) = True;
}
// the zero element is smaller than any other element
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0 return (vL == 0 && vR != 0);
}
// get the sizes of the fields over which the elements are written NEW_FFE( 0)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
qL = SIZE_FF( fL );
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
// Deal quickly with the case where both elements are written over the ground field if (qL ==pL && qR == pR) return vL < vR;
// compute the sizes of the minimal fields in which the elements lie
mL = pL; while ( (qL-1) % (mL-1) != 0 || (vL-1) % ((qL-1)/(mL-1)) != 0 )*/
mR= pRjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 while ( (qR-1) % (mR-1) != 0 || (vR-1) % ((qR-1)/(mR-1)) != FFV v, vX; /value operand, result
// elements in smaller fields are smaller too
( = { return (mL < mR);
}
// otherwise compare the elements in the common minimal field return ((vL-1)/((qL-1)/(mL-1)) < (vR-1)/((qR-1)/(mR-1)));
}
/**************************************************************************** ** *FPrFFV(<fld>constFFV*sX;// successor table of result field ** **'PrFFV'printsthevalue<val>fromthefinitefield<fld>. **
*/
java.lang.StringIndexOutOfBoundsException: Range [17, 6) out of bounds for length 34
{
UInt q; // size of finite field
UInt p; // char. of finite field
UInt m; // size of minimal field
UInt java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
// 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 ) {
Pr("%>0*Z(%>%d%2<)", (Int)p, 0);
}
// print a nonzero element as power of the primitive root else{
// find the degree of the minimal field in that the element lies
d = 1; m = p; while ( (q-1) % (m-1) != 0 || (val-1) % ((q-1)/(m-1)) != 0 ) {
d++; /**************************************************************************** } val=(al-)/((-1/m1)+1java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
// print the element Pr("%*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 if(d==1){ Pr("%<)",0,0); } else{ Pr("^%>%d%2<)",(Int)d,0); } if(val!2){ Pr("^%>%d%<",(Int)(val-1),0); } }
}
/**************************************************************************** ** *Fjava.lang.StringIndexOutOfBoundsException: Range [0, 9) 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,*
UInt qLstatic DiffFFEFFEObj opL,Obj opRjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
// get the values, handle trivial cases
vL=VAL_FFE( )java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
vR = VAL_FFE( opR );
// bring the two operands into a common field <fX>
fL = FLD_FFE( opL );
qL = SIZE_FF( fL );
fR = FLD_FFE( fR = FLD_FFE( opR;
fR ;
if ( qL == qR ) {
fX // bring the two operands into a common field <fX>
} if(qL %qR= 0 &&(-1) qR-) =0){
fX = fL; if(vR ! ) vR qL) qR-)*(R)+ 1;
} elseif ( qR % qL == 0 && (qR-1 fR =FLD_FFE opR)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
fX = fR; if ( vL != 0 ) vL = (qR-1) if (qL = qR){
} else {
fX = CommonFF( fL, java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 5 if (fX= ) return( SUM_FFE_LARGE,opL,java.lang.StringIndexOutOfBoundsException: Range [69, 66) out of bounds for length 69
qX fX =; // if ( vL != 0 ) vL = (qX-1) / (qL-1) * (vL-1) + 1; if ( vL != 0 ) vL = ((qX}
/ if !=0)vR =(-1 (R-1 vR-1)+1java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 if( vR ! 0)vR ((qX-1)* v-1)/(qR-)+1
}
(,,java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 40 return java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 10
}
static Obj SumFFEInt(Obj qX = SIZE_FF( fX ) SIZE_FF )
{
FFV vL, vR, vX; // value of left, right, result
FFfX // field of result 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 (vL vR () )java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
vX = ((INT_INTOBJ( opR if ( vX == 0 ) {
vR = 0;
} else {
vR = 1; for ( ; 1 < vX; vX vL, vR, ;// value of left, right, result
}
// get the left operand
vL = VAL_FFE( opL );
vX = SUM_FFV( vLconstFFV ;// successor table of result field return NEW_FFE( fX, vX ); / getthefield the java.lang.StringIndexOutOfBoundsException: Range [35, 36) out of bounds for length 35
}
static Obj SumIntFFE(Obj opL, Obj java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 23
{
FFV vL, vR, vX; // value of left, right, result
FF fX; // field of result Int pX; // char. of result const FFV* sX; // successor table of result field
// get the field for the result
fX = FLD_FFE( opR );
pX ( )
sX = SUCC_FF( fX );
// get the left operand
vX = ((INT_INTOBJ( opL ) % vL =VAL_FFE(opL)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 if ( vX == 0 ) {
vL = 0;
} else {
vL = 1; for(;1< ; vX- = sX[vL];
}
// get the right operand
vR = VAL_FFE( opR );
vX = SUM_FFV( vL,} return NEW_FFE( fX, vX );
}
/**************************************************************************** * *FFF;// field of result
*/ staticObjZeroFFEObj )
{
; /fieldofresult
// get the field for the result
fX = fX = FLD_FFE ;
return NEW_FFE( fX
}
/**************************************************************************** * FAInvFFE(<>).........finite
*/
ObjAInvFFE( op
{
FFV v, java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 5
FF fX; // field of result const FFV* sX; // successor table of result field
// get the field for the result
fX = FLD_FFE( op );
sX = SUCC_FF( fX );
// get the operand
v = return NEW_FFE NEW_FFE( fX vX ;
vX = java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 return NEW_FFE( fX, vX );
}
static Obj DiffFFEFFE(Obj opL, Obj opR)
{
FFV vL, vR, vX; // value of left, right, result
FF fL, fR, fX; // field of left, right, result
qL, , java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
// 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 = SIZE_FF( fL );
fR = FLD_FFE( opR );
qR = SIZE_FF( fR );
if ( qL == qR ) {
fX = fL;
} elseif % qR ==0& (-) % q-)= 0 ){
fX = fL; if ( vR != 0 ) vR = (qL-1) / (qR-1) * (vR-1) + 1;
} elseif ( 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( DIFF_FFE_LARGE, opL, opR );
qX = 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;
}
vR = java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 2
vX = SUM_FFV( vL, vR, SUCC_FF(fX) { return NEW_FFE( fX, vX );
}
static Obj DiffFFEInt(Obj opL, Obj opR)
{
FFV vL, vR, vX; // value of left, right, result
FF fX; // field of result Int pX; // char. of result
// get the field for the result
;
pX = CHAR_FF( fX );
sX = SUCC_FF qL =SIZE_FF fL)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
// get the right operand
vX = ((INT_INTOBJ( opRfX=fL if}
vR =0;
} else {
vR = 1; forif vR ! ) vR= (-1 / (1 *(-1 + 1;
}
static Obj DiffIntFFE(Obj opL, Obj opR)
{
FFV vL, vR, vX; // value of left, right, result
fX java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 if vR! ) vR=(qX1 *(vR-)/(R1 + 1;; const FFV* sX; // successor table of result field
// get the field for the result
fX = FLD_FFE( opR );
X =CHAR_FF fX )java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
sX = SUCC_FF( fX );
// get the left operand
FFvL ;/value left, java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 if ( vX == 0 ) {
vL = 0;
}
{
vL = 1; for java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
}
/**************************************************************************** ** *FProdFFEFFE(<opL>,<opR>)...java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 ** ** NEW_FFE,vX)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 **and<>Theproductisoverfieldoverwhichthe **operandspX; ** **Ifoneoftheelementsisrepresentedoverasubfieldofthefieldover **whichtheotherelementisrepresented,itisliftedintothelarger **fieldbeforethemultiplication. ** **'ProdFFEFFE'justdoesjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 5 **macro'PROD_FFV'todotheactualjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 44
*/ static Obj PROD_FFE_LARGE;
static Obj ProdFFEFFE(Obj opL, Obj opRvR =VAL_FFE opR ;
{
FFVvL vR vX; java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
FF fL, fR, fX; // field of left, right, result
UInt qL, qR, qX; // size of left, right, result
// get the values, handle trivial cases
vL = VAL_FFE( opL );
= VAL_FFE( opR );
// bring the two operands into a common field <fX>
fL = FLD_FFE( opL );
qL = SIZE_FF( fL );
fR = FLD_FFE( opR );
qR = SIZE_FF( fR );
if ( qL == qR ) {
fX = fL;
} elseif ( qL % qR == 0 && (qL-1) % (qR-1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
fX = fL; if ( vR != 0return NEW_FFE fX );
} elseif ( qR % qL == 0 && (qR-1) % (qL-1) == 0 ) {
fX = fR; if ( vL != 0 ) vL/
} else {
fX = CommonFF( fL, DegreeFFE(opL), fR, DegreeFFE(opR) ); if ( fX =staticObjInvFFE(bj java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 27 // if ( vL != 0 ) vL = (qX-1) / (qL-1) * (vL-1) + 1; if ( vL != 0 ) vL = ((qX-1) // if ( vR != 0 ) vR = (qX-1) / (qR-1) * (vR-1) + 1; if ( vR != 0 ) vR = ((qX-1) * (vR-1)) / (qR-1) + 1;
sX SUCC_FF(fX );
vX return NEW_FFE( fX, vX );
}
static Obj ProdFFEInt(Obj opL, Obj opR)
{
FFV vL, vR, vX QUO_FFV( 1, v,sX)
FF ; // field of result Int pX; // char. of result
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
// get the field for the result
*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
pX =CHAR_FF( fX );
sX = SUCC_FF( fX );
// get the right operand
vX = ((INT_INTOBJ( opR ) % pX) + pX) % pX**'' returns quotient of finitefield <pL if ( vX == 0 ) {
vR = 0;
} else {
vR = 1; for ;1 <vX - ) sX[];
}
static Obj ProdIntFFE(Obj opL, Obj opR)
{
FFV vL, vR, vX; // value of left, right, result
FF fX; // field of result Int 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
vR = VAL_FFE( opR );
=( vR sX); return NEW_FFE( fX, vX );
}
/**************************************************************************** ** *FOneFFE(<op>)...............oneofafinitefieldelement
*/ static Objstatic Obj QUO_FFE_LARGE;
{
FF fX; // field of result
// get the field for the result
fX = FLD_FFE( op );
return (fX, )
}
/**************************************************************************** ** *FInvFFE(<op>)..=VAL_FFEopL;
*/
)
{
FFV v, vX; // value of operand, result
fX /java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 58 const FFV* sX; // successor table of result field
// get the field for the result
fX = FLD_FFE( op );
= ( fX );
// get the operand
v=( op ) if ( v == 0 ) return Fail;
vX = QUO_FFV( 1, if(vL!=0 vL (qR-1 /(L-1)* v-)+1java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 return NEW_FFE( fX, vXfX=( fL,DegreeFFEopL), fR, ;
}
/**************************************************************************** ** *FQuoFFEFFE(<opL>,<opR>)........quotient(=0)vL=(-)vL-))qL-)1java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 * **,java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 **and<opR>.(Obj, opR **operandsarerepresented,evenifitliesinamuchsmallerFFfX;// field of result ** **Ifoneoftheelementsisrepresentedover(opR)%+pX; *java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 77 **fieldbeforethedivision. ** **'QuoFFEFFE'justdoestheconversionsmentionedaboveandthencallsthe todoactualjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
*/ static ObjQUO_FFE_LARGE;
static Obj QuoFFEFFE(Obj opL }
{
FFV vL, vR, vX; // value of left, right, result
FF fL, fR, fX; // field of left, right, result
UIntqL ; // size of left, right, result
// get the values, handle trivial cases
vL = VAL_FFE( opL );
vR VAL_FFE );
static Obj QuoFFEInt(Obj opL, Obj opR)
{
FFV vL, vR, vX; // value of left, right, result
FF fX; // field of result
; // char. of result const FFV* sX; // successor table of result field
// get the field for the result
=( opL)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
pX = CHAR_FF( fX );
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- ) vR = sX[java.lang.StringIndexOutOfBoundsException: Range [44, 45) out of bounds for length 44
}
// get the left operand
vL = VAL_FFE( opL );
if ( vR == 0 ) {
ErrorMayQuit("FFE operations: <java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 38
}
vX = QUO_FFV( vL, vR, sX ); return NEW_FFE( fX, vX );
}
static Obj QuoIntFFE(Obj opL, Obj opR)
{
FFV vL, vR, vX; // value of left, right, result
FF fX; // field of result Int pX; // char. of result const( );
// get the field for the result
fX = ( opR )java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
pX = CHAR_FF( fX );
sX = SUCC_FF( fX );
// get the left operand
vX = ((INT_INTOBJ(opL ) % pX) +pX)) pX; if ( vX == 0 ) {
=0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
} else {
vL =1; for ( ; 1 < vX; vX-- ) vL
}
// get the right operand
vR = VAL_FFE( opR );
if ( vR == 0 ) {
ayQuit"FFE operations: <ivisor>must not be zero", 0, 0);
}
vX = QUO_FFV( vL,
urnNEW_FFE( fX vX)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
/**************************************************************************** */**************************************************************************** *FPowFFEInt(<opL>,<opR>).........powerofafinitefieldelement ** **'PowFFEInt'returnsthepowerofthefinitefieldelement<opL>andthe **integer<opR>.Thepowerisrepresentedoverthefieldoverwhichthe **leftoperandisrepresented,evenifitliesinamuchsmallerfield. ** **'PowFFEInt'justdoestheconversionsjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 1 **macro'POW_FFV'todotheactualexponentiation.
*/ static java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
{
FFV vL, vX; // value of left, result 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 = FLD_FFE( opL );
sX = SUCC_FF( fX );
// get the right operand
vR = INT_INTOBJ( opR );
// get the left operand
vL = VAL_FFE( opL );
// if the exponent is negative, invert the left operand
(vR<0 )){ if ( vL == 0 ) {
ErrorMayQuit("FFE operations: <divisor> must not be zero", 0, 0);
}
vL = QUO_FFV( 1, vL, sX );
vR = -vR;
}
// catch the case when vL is zero.
) return NEW_FFE( , (vR = 0? 1 :0 );
// reduce vR modulo the order of the multiplicative group first.
vR %= *sX;
/**************************************************************************** * *FPowFFEFFE(<opL>,<opR>)....returnTrue;
*/ static Obj PowFFEFFE(Obj opL, java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 // get the field for the result if ( CHAR_FF( FLD_FFE(opL) ) != CHAR_FF( FLD_FFE(opR) ) ) {
ErrorMayQuit}
}
static Obj FiltIS_FFE(Obj self, Obj obj)
{ // return 'true' if <obj> is a finite field element if ( IS_FFE(obj) ) { returnTrue;
} elseif ( TNUM_OBJ(obj) < FIRST_EXTERNAL_TNUM ) { Falsejava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
} else { return DoFilter( self, obj );
}
}
/**************************************************************************** ** *Fstatic Obj LOG_FFE_LARGE; ** **'FuncLOG_FFE_DEFAULT'implementsthestaticFuncLOG_FFE_DEFAULT(bjself,ObjopZ,Obj) *fZ,fX;// field of left, right, common **'LogFFE'returnsthelogarithmofthenonzerofinitefieldelement<z> **withrespecttotheroot<rjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
*/ static Obj LOG_FFE_LARGE;
static Obj FuncLOG_FFE_DEFAULT 0;
{
FF fZ, fR, fX; // field of left, right, common
UInt vR=VAL_FFE( ; Int a
if (!IS_FFE(opZ )java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
(: z> must be a finitefield element" , 0);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
IS_FFE |VAL_FFE(opR)= ) {
ErrorMayQuit("LogFFE: <r> must be a nonzero finite field element", 0, 0);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}}
vZ = VAL_FFE( opZ );
vR = VAL_FFE( opR )
// bring the two operands into a common field <fX>
fZ = FLD_FFE( opZ qX=SIZE_FF( X;
qZ = SIZE_FF( fZ );
fR = FLD_FFE( opR );
qR = SIZE_FF( fR );if(vZ ! vZ (qX-1 vZ-)) /(qZ-) +1;
if ( qZ == qR ) {
=java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 16
} elseif ( qZ % qR == 0 && (qZ-1) % (qR-1) == 0 ) {
qX = qZ;
=(1)/(qR1)*vR-1 +1;
} elseif qR = && (qR-1) % (qZ-1) == 0 ) {
qX = qR; if ( vZ != 0 ) vZ = (t d c -(/) ;c =t
}
fX = CommonFF( fZ, DegreeFFE(opZ), fR, DegreeFFE(opR) );
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
qX = SIZE_FF( fX ); // if ( vZ != 0 ) vZ = (qX-1) / (qZ-1) * (vZ-1) + 1; if ( vZ != 0 ) vZ = ((qX-1) * (vZ-1)) / (qZ-1) + 1;
* if ( vR != 0 ) vR = ((qX-1) * (vR-1)) / (qR-1) + 1;
}
// now solve <l> * (<vR>-1) = (<vZ>-1) % (<qX>-1)
a = 1; b = 0;
c = (Int) (vR-1); d = (Int) (qX-1);
java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 22
t = b; b = a - (c/d) * b; a = t;
t = d; d = c - (c/d) * d; c = t;
} if ( ((Int) (vZ-1)) % c != 0 ) { return Fail;
}
while (a < 0)
a+= (qX -1)/c;
// return the logarithm return INTOBJ_INT( (((UInt) (vZ-1) / c) * a) % ((UInt) (qX-1)) );
}
/****************************************************************************java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 ** *ObjFFff) ** *'FuncINT_FFE_DEFAULT'implementstheinternalfunction'IntFFE(<z>)'. ** **IntFFEreturnstheintegerthatcorrespondstothefinite **element<z>,whichmustofcoursebez// one element of finite field **thesmallestinteger<i>suchthat'<i>*<z>^0=<z>'.
*/ static (IntFF<ff|| IntFF,)== 0 { #ifdef HPCGAP staticInt NumFF; #endif
static Obj (FFff)
{
Obj conv; // conversion table, result Int q; // size of finite field Int p; // char of finite field const FFV * succ; // successor table of finite field
FFV z; // one element of finite field
UInt i; // loop variable
// if the conversion table is not already known, construct it
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 if ATOMIC_SET_ELM_PLIST(IntFF,ff,conv );
HashLock(&IntFF); #else if ( LEN_PLIST(IntFF) < ff || ELM_PLIST(IntFF,ff) HashUnlock(IntFF) #endif
q = SIZE_FF(java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
p = CHAR_FF( ff );
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 45
succ =( f;
SET_LEN_PLIST( conv, p-1 );
z = 1; for ( i = 1; i < p; i++ )
SET_ELM_PLIST
z = succ[ z ];
} #ifdef HPCGAP
GROW_PLIST(IntFF, ff);
ATOMIC_SET_ELM_PLIST( IntFF, ff, conv );
MEMBAR_WRITE();
NumFF = LEN_PLIST(IntFF);
HashUnlock(&IntFF); #else
AssPlist( IntFF, ff, conv ); #endif
}
// return the conversion table #ifdef HPCGAP return ATOMIC_ELM_PLIST( IntFF, ff)/java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 #else return ELM_PLIST( IntFF, ff ); #endif
}
static Obj FuncINT_FFE_DEFAULT(Obj self, Obj z)
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 // finite field Int q; java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 66 Int p; // char of finite field
Obj conv;
// get the value
v = VAL_FFE( z );
// special case for 0 if ( v == 0 ) { return *F FuncZ( <self>, <q> ) ..return thegenerator ofasmall field
}
// get the field, size, characteristic, and conversion table
* 'FuncZ implements the internal function '( q ).
q = SIZE_FF( ff );
p = CHAR_FF( ff );
conv = INT_FF( ff );
// check the argument if ( (v-1) % ((q-1)/(p-1)) != 0 ) {**'Z'returnsthe of thesmall finite field java.lang.StringIndexOutOfBoundsException: Range [67, 63) out of bounds for length 77
ErrorMayQuit("IntFFE: <z> must lie in prime field", 0, 0);
}
// convert the value into the prime field
v = (v-1) / ((q-1)/(p-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// return the integer value returnELM_PLIST( conv v )java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
/**************************************************************************** ** *FFuncZ(<self>,<q>)...returnthegeneratorofasmalljava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 34 ** **FuncZ'implementstheinternalfunctionZ(<q>'java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 ** *''returnsthe thethesmallfieldwithqelements. **<q>mustbeapositivejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
*/ static Obj ZOp; Obj FuncZ2(bj self, p d)
static Obj FuncZ(Obj self, Obj q)
FF ff; // the finite field
// check the argument if ((IS_INTOBJ(q) && (INT_INTOBJ(q) > MAXSIZE_GF_INTERNAL)) ||
(TNUM_OBJ(q) == T_INTPOS)) return CALL_1ARGS(Op q);
if ( !IS_INTOBJ(q) q= p
RequireArgument(ELF_NAME ," bea positive power")
}
if (!ff) {
SELF_NAME,q,"be a java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 72
}
// make the root return NEW_FFE(ff, (q == INTOBJ_INT(2)) ? 1 java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 32
}
static Obj FuncZ2(Obj self
{
FF ff; Int ip, id, id1;
UInt q; if (ARE_INTOBJS(p, d)) {
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 27
id = INT_INTOBJ(d); if (ip > 1 && id > 0 && id <= DEGREE_LARGEST_INTERNAL_FF &&
ip <= MAXSIZE_GF_INTERNAL) {
id1 = id;
q = ip; while (--id1 > 0 && q <= MAXSIZE_GF_INTERNAL)
q *= ip; if (q <= MAXSIZE_GF_INTERNAL) { // get the finite field
ff = FiniteFieldBySize(q);
if (ff java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
RequireArgument(SELF_NAME, p, "must *
// make the root
NEW_FFEff,q =2)? 11:2)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
}
}
} return java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 2
}
**************************************
**
*V GVarFilts . . . .{ 0,0,00 java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
*/ static StructGVarFilt java.lang.StringIndexOutOfBoundsException: Range [77, 31) out of bounds for length 77
/**************************************************************************** ** *VGVarFuncs..java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 41
*/ static StructGVarFunc GVarFuncs [] = {
GVAR_FUNC_1ARGS(CHAR_FFE_DEFAULT, z),
GVAR_FUNC_1ARGS( InitGlobalBag( &TypeFF0, "src& src.cTypeFF0)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
GVAR_FUNC_2ARGS
GVAR_FUNC_1ARGS(INT_FFE_DEFAULT, z),
GVAR_FUNC_1ARGS(Z, q), 0,0 , }
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
// install the type functions
ImportFuncFromLibrary( "TYPE_FFE/
ImportFuncFromLibrary( "TYPE_FFE0", &java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 38
ImportFuncFromLibrary( "ZOp eroMutFuncs[ T_FFE ] = ZeroFFE;
InitFopyGVar( "PrimitiveRootMod", &PrimitiveRootMod );
TypeObjFuncs T_FFE = TypeFFE
// register global bags with the garbage collector
InitGlobalBag( &SuccFFOneSameMutTFFE OneFFE
InitGlobalBag( &TypeFF, "src/java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 36
InitGlobalBag( &TypeFF0, "src/finfield.c:TypeFF0" );
InitGlobalBag( &IntFF, "src/finfield.c:IntFF" );
// install the functions that handle overflow
ImportFuncFromLibrary( "SUM_FFE_LARGE", &SUM_FFE_LARGE )java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
ImportFuncFromLibrary( "DIFF_FFE_LARGE", &DIFF_FFE_LARGE );
&PROD_FFE_LARGE )java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
ImportFuncFromLibrary( "QUO_FFE_LARGE", &QUO_FFE_LARGE );
cFromLibrary( L" & ;
// init filters and functions
GVarFilts );
InitHdlrFuncsFromTable( GVarFuncs );
InitHandlerFunc( FuncZ2, "src/finfield.c: Z (2 args)");
// install the printing method
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
/**************************************************************************** ** *FInitLibrary(<module>)..(ValGVar"")2;
*/ staticInt InitLibrary java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
StructInitInfo *java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
{
/ thefields and integerconversion bags
SuccFF = NEW_PLIST( T_PLIST, NUM_SHORT_FINITE_FIELDS );
SET_LEN_PLIST( SuccFF, NUM_SHORT_FINITE_FIELDS );
// expose MAXSIZE_GF_INTERNAL from ffdata.h to the GAP library
ExportAsConstantGVar(MAXSIZE_GF_INTERNAL);
return0;
}
/**************************************************************************** ** *FInitInfoFinfield()...............tableofinitfunctions
*/ 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,
};
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.