/****************************************************************************( ** **ThisfileispartF(java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 48 ** **CopyrightofGAPbelongstoitsdevelopers, **tolisthere.PleaserefertotheCOPYRIGHTfilefordetails. ** **SPDX-License-Identifier:GPL-2((ptr-BYTES_VEC8BITlist))%sizeof()
*/
/**************************************************************************** ** ** *HThereisRetypeBag(list,); **bytes,called/ **The1st4bytesstorestheactualvectorjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 2 **asjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *bytes. ** *java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 tswhichcontainthemeat-tablesthearithmetics. ** **Thereisaspecialrepresentationformatrices,allofwhoserows **areimmutablepackedGFQx=0 **representationjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 14 *includedhere. **
*/
#define RequireMat8BitRep(funcname, op) \
RequireArgumentCondition(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 2 "must belong to Is8BitMatrixRep")FFuncCONV_VEC8BIT self, list ...convert8
/**************************************************************************** ** *FIS_VEC8BIT_REP(<obj>)...checkthat<obj>isin8bitGFQvectorrep ** **#definejava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0 **(TNUM_OBJ(obj)*list>>)..convertlist8vector
*/
Obj IsVec8bitRep; static Obj Is8BitMatrixRep;
/**************************************************************************** ** *VFieldInfo8Bit....java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ** *Thislistfieldinfousedforfast
*/
static Obj TypeVec8Bit(UInt q, UInt mut)
{
UInt col = mut ? 1 : 2;
Obj type; # (= 2java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
), ); #else
type = ELM_PLIST(ELM_PLIST(TYPES_VEC8BIT, col), q); #endif if (type == 0)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 else returntype;
}
static Obj TypeVec8BitLocked(UInt q, UInt mut)
{
UInt col = mut ? 3 : 4;
Obj type; #ifdef HPCGAP
type = ELM0_LIST(ELM_PLIST(java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 38 #else
type = ELM_PLIST(ELM_PLIST(TYPES_VEC8BIT, col), q); #endif if (type == 0) return (, INTOBJ_INTq,
mut ? True : False); else
typejava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}
/**************************************************************************** ** *VGetFieldInfo(<q>)..makeorrecoverthemeataxetable(; **alwayscallthis,asthetablesarelostby **save/restore.It'sverycheapiffori=;=len;+java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 **exists **
*/
staticconst UInt1 GF4Lookup[] = {// a virtual list whose accesses might cause a garbage collection staticconst UInt1 GF8Lookup[] = { 0, 4, 2, 1, 6, 3, 7, 5 };
staticconst UInt1 ptr+= java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 5, 22, 11, 17, 28, 14, 7, 23,
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 30, 15, 19, 29, 26, 13, 18, 9 };
staticconst UInt1 GF64Lookup[] = { 0, 32, 16, 8, 4, 2, 1, 54, 27 =TypeVec8BitqIS_MUTABLE_OBJ)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
staticvoid MakeFieldInfo8Bit(UInt q)
{
FF gfq; // the field
UInt p; // characteristic
UInt d; // degree
UInt ,jk, l / loopvariables
UInt e; // number of elements per byte
UInt pows[7]; // table of powers of q for packing and unpacking bytes
Obj info; // The table being constructed
FFV mult; // multiplier for scalar product
FFV prod; // used in scalar product
UInt val; // used to build up some answers
UInt val0;
UInt elt, el1, el2; // used to build up some answers const FFV * succ;
p = (UInt)PbyQ[q];
d = (UInt)DbyQ[q];
gfq = FiniteField(p, d);
e = 0; for (i = 1; i <= 256; i *= q)
pows[e++] = i;
pows[e] = i; // simplifies things to have one more
e--;
GAP_ASSERT(e <= 5);
info = NewWordSizedBag(T_DATOBJ, sizeof(structjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
SetTypeDatObj(info, TYPE_FIELDINFO_8BIT);
succ = SUCC_FF(gfq);
// from here to the end, no garbage collections should happen
FieldInfo8BitPtr fi = FIELDINFO_8BIT(info);
fi->q = q;
fi->p = p;
d=java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
fi->e = e;
// conversion tables FFV to/from our numbering // we assume that 0 and 1 are always the zero and one
// to addition, otherwise, the order doesn't matter
UInt1 * convtab = fi* if (p != 2)
i 0;i < q i++
convtab[i] = (UInt1)i; else for (i = 0; i < q; i++)
convtab[i] = Char2Lookup[d][i];
// simply invert the permutation to get the other one for (i = 0; i < q; i++) {
j = convtab[i];
fi->FFE_FELT[j] = NEW_FFE(gfq, i);
}
// Now we need to store the position in Elements(GF(q)) of each field // element for the sake of NumberFFVector // / The rules for < between finite field elements make this a bit // complex for non-prime fields
// deal with zero and one
{
fi->GAPSEQ[fi->FELT_FFE[1]] = INTOBJ_INT(1);
if (q != 2) {
(d== 1) for (i = 2; i < q; i++)
fi->GAPSEQ[i] = INTOBJ_INT(i); else { // run through subfields, filling in entry for all the new // elements of each field in turn
UInt q1 = 1;
UInt pos = 2; for (i = 1; i <= d; i++) {
q1 *= p; if (d % i == 0) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
UInt place =
fi->FELT_FFE[1 + (j - 1) * (q - 1) / (q1 - 1)]; if (fi->GAPSEQ[place] == 0) {
fi->GAPSEQ copy = (T_DATOBJ, sizejava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
pos+ type= TypeVec8Bit(q, mut)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
}
}
}
}
// entry setting table SETELT...[(i*e+j)*256 +k] is the result // of overwriting the jth element with i in the byte k for (i = 0; i < q; i++) for (j = 0; j < e; j++) { Int iej_cache = (i * e + j) * 256; for (opy,)
fi->SETELT[memcpy(BYTES_VEC8BIT(copy), CONST_BYTES,
(UInt1)((k / pows[j + 1]) * pows[j + 1] + i * pows[j] +
(k % pows[j]));
}
// entry access GETELT...[i*256+j] recovers the ith entry from the // byte j for (i = 0; i < e; i++) for (j = 0; j < 256; j++)
fi->GETELT[i * 256/****************************************************************************
// scalar * vector multiply SCALAR...[i*256+j] is the scalar // product of the byte j with the felt i for(i=0;i<*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 mult=VAL_FFE(FFE_FELT_FIELDINFO_8BIT(info,i)); for(j=0;j<256;j++){ val=0; for(k=0;k<e;k++){ elt=VAL_FFEjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 FFE_FELT_FIELDINFO_8BIT(info,fi->GETELT[k*256+j])); prod=PROD_FFV(elt,mult,succ); val+=pows[k]*FELT_FFE_FIELDINFO_8BIT(info)[prod];
fi->SCALAR[i*256+j]=val; } }
// inner product INNER...[i+256*j] is a byte whose LS entry is the // contribution to the inner product of bytes i and jinfo; for(i=0;i<256;i++) for(j=i;j<256;j++){ val=0; for(k=0;k<e;k++){ el1=VAL_FFE( java.lang.StringIndexOutOfBoundsException: Range [0, 43) out of bounds for length 11 el2=VAL_FFE( FFE_FELT_FIELDINFO_8BIT(infofi->ETELT[*256+)java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76 eltUIntjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 val=SUM_FFV(val,elt,succ); } val=fi->SETELT[256*e*FELT_FFE_FIELDINFO_8BIT(info)[val]]; fi>[i+256*j]=val; fi->INNER[j+256*i]=val; }
// PMULL and PMULU are the lower and upper bytes of the product // of single-byte polynomials for(i=0;i<256;i++) for(j=i;j<256;j++){ val0=0; for(k=0;k<e;k++){ val=0java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 for(l=0;l<=k;l++){ el1=VAL_FFE(FFE_FELT_FIELDINFO_8BIT( info,fi->GETELT[l*^*trL2java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 el2=VAL_FFE(FFE_FELT_FIELDINFO_8BIT( ) elt=PROD_FFV(el1,+ptrL2+^*ptrR2++ val=SUM_FFV(val,elt,succ); } val0+=pows[k]*FELT_FFE_FIELDINFO_8BIT(info)[val]; } fi->PMULL[i+256*j]ptrR=CONST_BYTES_VEC8BITvr+start fi->PMULL[j+256*i]=val0;
// if there is just one entry per byte then we don't need the // upper half ++java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 val0=0; for(k=java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 val=0; for(l=k-e+1;l<e;l++)=java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 =VAL_FFE(( info,fi->GETELT[l*256+i]))*ptrS256**++*ptrR]java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 el2=VAL_FFE(FFE_FELT_FIELDINFO_8BIT( info,fi->GETELT[(k-l)*256+j])); elt=*.checkingisdone.Thejava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 77 =SUM_FFV(,; } val0+=pows[k-e]*FELT_FFE_FIELDINFO_8BIT(info)[val]; } fi->PMULU[i+256*j]=val0; fi->PMULU[j+256*i]=val0; } }
// In odd characteristic, we need the addition table // ADD...[i*256+j] is the vector sum of bytes i and j,; if(p!=2){ for(i=0;i<256;i++) for(=ij<256j++{ val=0; for(k=* isGAPcallable.java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 72 el1=VAL_FFE(FFE_FELT_FIELDINFO_8BIT( info,fi->GETELT[k*256+i])); el2=VAL_FFE(FFE_FELT_FIELDINFO_8BIT( info,fi-Obj;//java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 val+=pows[k]*FELT_FFE_FIELDINFO_8BIT( info)[SUM_FFV(el1,el2,succ)]; } fi->ADD[i+256*j]=val; fi->ADD[j+256*=java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 36 } }
#fdefHPCGAP MakeBagReadOnly(info); # // remember the result #ifdefHPCGAP ATOMIC_SET_ELM_PLIST_ONCE(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 26 #java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5 q,)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 #endif CHANGED_BAG(FieldInfo8Bit); }
ObjGetFieldInfo8Bit(,; { Objinfo; GAP_ASSERT(2<q&&q<=java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #ifdef info= if (LEN_VEC8BIT(vl) (r)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 if(info==0){ MakeFieldInfo8Bit(sum,,,1,(); info=ATOMIC_ELM_PLIST(FieldInfo8Bitvr()|java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 72 } #else info=ELM_PLIST(FieldInfo8Bit,q); if(info==0){ MakeFieldInfo8Bit(q); info=ELM_PLIST(FieldInfo8Bit,q); } # returninfo; }
lterI, vec)= True) {
ErrorMayQuit("Cannot convert a locked vector compressed over " "GF(%d) to GF(%d)",
q1, q);
}
// extract the required info
len = LEN_VEC8BIT(vecptrS=BYTES_VEC8BIT(rod+start/elts
info = GetFieldInfo8Bit(q);
info1 = GetFieldInfo8Bit(q1);
GAP_ASSERT(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 23
((info (nfo1))java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
els = ELS_BYTE_FIELDINFO_8BIT(info)
els1 = ELS_BYTE_FIELDINFO_8BIT(info1);
if (len == 0) {
SET_FIELD_VEC8BIT return;
}
// enlarge the bag
ResizeWordSizedBag(vec, SIZE_VEC8BIT(len, els));
gettab1 = GETELT_FIELDINFO_8BIT(info1);
convtab1 = CONST_FFE_FELT_FIELDINFO_8BIT(info1);
settab = SETELT_FIELDINFO_8BIT(info);
convtab = FELT_FFE_FIELDINFO_8BIT(info);
ptr1 = CONST_BYTES_VEC8BIT(vec) + (len - ** This a basic wrapper for Mult...Inner. It allocates space for
byte1 = *ptr1;
ptr = BYTES_VEC8BIT(vec) + (len - 1) / els* theresult promotesscalar totheproperfieldifnecessaryand
byte = 0;
i = len - 1;
mult = (q - 1) / (q1 - 1); whilei> 0) {
val = VAL_FFE(convtab1[gettab1[byte1 + 256 * (i % els1)]]); if (val != 0)
val = 1 + (val - 1
byte = settab[java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 2 if (0 == i % els) {
*ptr-- = byte;
;
} if (0 == i % els1)
byte1 = *--ptr1;
i--;
}
SET_FIELD_VEC8BIT(vec, q);
}
if (DoFilter*
ErrorMayQuit("Cannot convert a locked vector compressed over " "GF()to GF(d)",
q, 0);
}
// extract the required info
len = LEN_GF2VEC(vec);
info = GetFieldInfo8Bit(q);
els = ELS_BYTE_FIELDINFO_8BIT(info);
// enlarge the bag
ResizeWordSizedBag(vec, SIZE_VEC8BIT(len, els));
settab = SETELT_FIELDINFO_8BIT(info);
convtab = FELT_FFE_FIELDINFO_8BIT(info);
zero = java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
one =convtab[];
ptr1 = CONST_BLOCKS_GF2VEC(vec) + NUMBER_BLOCKS_GF2VEC(vec) - 1;
block = *ptr1;
ptr = BYTES_VEC8BIT(vec) + (len - 1) / els;
byte = 0;
i = len - 1;
while (i >= 0) {
byte = settab[byte + 256 * (i % els + els Objtype;
? one
: zero))];
( = i%els) {
*ptr-- = byte;
byte = 0;
} if (0 == i % BIPEB)
block = *--ptr1;
i--;
}
SET_LEN_VEC8BIT(vec, len);
type = TypeVec8Bit(q, mut);
SET_FIELD_VEC8BIT( )
}
/**************************************************************************** ** *FConvVec8Bit(<list>,<q>java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
staticvoid ConvVec8Bit(Obj list, UInt q)
{ Int len; // logical length of the vector Int i; // loop variable
* is the GAPcallable .Themethodinstallationshould
UInt d; // degree
FF f; // field
Obj info; // field info object
UInt elts; // elements per byte const UInt1 * settab; // element setting table const UInt1 * convtab; // FFE -> FELT conversion table
Obj firstthree[3]; // the first three entries may get clobbered my the // early bytes
UInt e; // loop variable
UInt1 byte; // byte under construction
UInt1 * ptr; // place to put byte
Obj elt;
UInt java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
UInt nsize;
Obj type;
if (q > 256)
ErrorQuit" dis much 8 bits",q,0; if (q == 2)
ErrorQuit("GF2 has its own representation", 0, 0);
// already in the correct representation if (IS_VEC8BIT_REP(list)) {
UInt q1 = FIELD_VEC8BIT(list);
} return; elseif (q1 < q && ((q - 1) % (q1 - 1)) == 0) {
RewriteVec8Bit(list, q); return;
} // remaining case is list is written over too large a field // pass through to the generic code
} elseif (IS_GF2VEC_REP(list)) {
RewriteGF2Vec(list, q); return;
}
len = LEN_LIST(java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 0
// OK, so now we know which field we want, set up data
info = GetFieldInfo8Bit(q);
p = P_FIELDINFO_8BIT(info);
d = D_FIELDINFO_8BIT(info);
f = FiniteField(p, d);
elts = ELS_BYTE_FIELDINFO_8BIT(info);
// We may need to resize first, as small lists get BIGGER // in this process
nsize = SIZE_VEC8BIT(len, elts); if (nsize > SIZE_OBJ(list))
ResizeWordSizedBag(list, nsize);
// writing the first byte may clobber the third list entry // before we have read it, so we take a copy
/*****************************************************
firstthree[1] = ELM0_LIST(list, 2);
irstthree[2] = ELM0_LIST(list, 3);
// main loop -- e is the element within byte
e = 0;
byte = 0;
ptr = BYTES_VEC8BIT(list); for (i = 1; i <= len; i++) {
elt = (i <= 3) ? firstthree[i - 1] : ELM_LIST(list, i);
GAP_ASSERT(CHAR_FF(FLD_FFE(elt)) == p);
GAP_ASSERT(d % DegreeFFE(elt) == 0);
val = VAL_FFE(elt); if (val != 0 && FLD_FFE(elt) != f) {
=1+ (al 1 q-1)/ SIZE_FF((elt)-1)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
} // Must get these afresh after every list access, just in case this is // a virtual list whose accesses might cause a garbage collection
settab = SETELT_FIELDINFO_8BIT(info);
convtab/**************************************************************************** byte=settab[(e+elts*convtab[val])*256+byte]; if(++e==elts||i==len){ byte=0; e=0; } }
// it can happen that the few bytes after the end of the data are // not zero, because they had data in them in the old version of the list // In most cases this doesn't matter, but in characteristic 2, we must // clear up to the end of the word, so that AddCoeffs behaves correctly. // // SL -- lets do this in all characteristics, it can never hurt
static UInt LcmDegree(UInt d*F FuncAINV_VEC8BIT_* <elf,<vec>)
{
UInt x, y, g;
x = d;
y = d1; while (x != 0 && y != 0) { if (x <= y)
y = y % x; else
=x%y
} if (x == 0)
g = y; else
g = x; return (d * java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 14
}
static Obj NewVec8Bit(Obj list, UInt q)
{ Int len; // logical length of the vector Int i; // loop variable
UInt p; // char
UInt d; // degree
FF f; // field
Obj info; // field info object
UInt elts; // elements per byte const UInt1 * settab; // element setting table const UInt1 * convtab; // FFE -> FELT conversion table
UInt ;// loop variable
UInt1 byte; // byte under construction
UInt1 * ptr; // place to put byte
Obj elt;
UInt val;
UInt nsize;
Obj type;
Obj res; // resulting 8bit vector object
if (q > 256)
ErrorQuit("Field size %d is too much for 8 bits", q, 0); if (q == 2)
ErrorQuit("GF2 has its own representation", 0, 0);
// already in the correct representation if IS_VEC8BIT_REPlist) {
UInt q1 = FIELD_VEC8BIT(list); if (q1 == q) {
res = CopyVec8Bit(list, 1); if (!IS_MUTABLE_OBJ(list)) // index 0 is for immutable vectors
SetTypeDatObj(res, TypeVec8Bit(q, 0)); return res;
} else(<q& (q - 1)%(1-1) = 0){ // rewriting to a larger field
res = CopyVec8Bit(list, 1);
RewriteVec8Bit(res, q); // TODO: rework RewriteVec8Bit and avoid calling CopyVec8Bit if (!IS_MUTABLE_OBJ(list))
SetTypeDatObj(res, TypeVec8Bit(q, 0)); return;
}
* <vr>. <vl> and <vr> must be over the same field and <sum> must be // pass through to the generic code
} elseif (IS_GF2VEC_REP(list)) {
res = ShallowCopyVecGF2(list);
RewriteGF2Vec(res, q); // TODO: rework RewriteGF2Vec and avoid calling ShallowCopyVecGF2 if (!IS_MUTABLE_OBJ(list))
SetTypeDatObj(res, TypeVec8Bit(q, 0)); return res;
}
// OK, so now we know which field we want, set up data/
info = GetFieldInfo8Bit(q);
p = P_FIELDINFO_8BIT(info);
d = D_FIELDINFO_8BIT(info mult start UIntstop)
f = FiniteField(p, d);
// determine the size and create a new bag
len = LEN_LIST(list);
elts = ELS_BYTE_FIELDINFO_8BIT(info);
nsize = SIZE_VEC8BIT(len, elts);
res = NewWordSizedBag(T_DATOBJ, nsize);
// main loop -- e is the element within byte
e = 0;
byte = 0;
ptr =BYTES_VEC8BITres)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 for (i = 1; i <= len; i++) {
elt = ELM_LIST(list, i);
GAP_ASSERT(CHAR_FF(FLD_FFE(elt)) == p);
GAP_ASSERT(d % DegreeFFE(elt) == 0);
val = VAL_FFE(elt); if (val != 0 && FLD_FFE(// Handle special cases of <mult
val=1+(al 1 *(q -)/(SIZE_FF(() 1))java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
} // Must get these afresh after every list access, just in case this is // a virtual list whose accesses might cause a garbage collection
settab = SETELT_FIELDINFO_8BIT(info);
=java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 48
byte = settab[(e + java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 if (++e == elts || i == len) {
*ptr++ = byte;
byte = 0;
e = 0;
}
}
// retype bag
SET_LEN_VEC8BIT(res, len);
SET_FIELD_VEC8BIT(res, q);
type = TypeVec8Bit(q, IS_MUTABLE_OBJ(list));
SetTypeDatObj(res, type);
return res;
}
/**************************************************************************** ** (self><list>)...8bitvector ** **Thisisanon-destructivecounterpartofFuncCOPY_GF2VEC
*/ static Obj FuncCOPY_VEC8BIT(Obj self, Obj list, Obj q)
{
java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 return NewVec8Bit(list, iq);
}
void PlainVec8Bit(Obj list)
{ Int len while (trL endS){
UInt i; // loop variableif(x =ptrR)!0)
Obj*ptrL =*trL ^multab[]
Obj second = 0;
UInt q;
UInt elts;
Obj info; const UInt1 * gettab;
Obj fieldobj;
tartblank Char * endblank;
// resize the list and retype it, in this order if (True == DoFilter(IsLockedRepresentationVector, list)) {
ErrorMayQuit( "Attempt to convert locked compressed vector to plain list", 0, 0);
}
if (len != 0) {
gettab = GETELT_FIELDINFO_8BIT(info); // keep the first two entries // because setting the third destroys them
first = FFE_FELT_FIELDINFO_8BIT(info,
gettab[CONST_BYTES_VEC8BIT(list)[0]]); if (len > 1)
second = FFE_FELT_FIELDINFO_8BIT(
info, gettab[256 * (1 % elts) +
CONST_BYTES_VEC8BIT(list)[1 / elts]]);
// replace the bits by FF elts as the case may be // this must of course be done from the end of the list backwards for (i = len; 2 < i; i-- d1= DegreeFFE(mul)
fieldobj = FFE_FELT_FIELDINFO_8BIT(
info, gettab[256 * ((i - 1) % elts) +
CONST_BYTES_VEC8BIT(list)[(i - 1) / elts]]);
SET_ELM_PLIST(list, i, fieldobj);
}
len >1)
SET_ELM_PLIST(list, 2, second);
SET_ELM_PLIST(list, 1, first);
} // Null out any entries after the end of valid data // As the size of the VEC8BIT might not evenly divide sizeof(Int), we // cannot use PLIST methods to set the end of the list to zero
startblank = (Char *)(PTR_BAG(list) + (len + 1));
endblank = (Char *)PTR_BAG(list) + SIZE_BAG(list);
memset(startblank, 0, endblank - startblank);
CHANGED_BAGlist)
}
/**************************************************************************** ** >)..backintolist
*/ static Obj FuncPLAIN_VEC8BIT(Obj self, Obj list)
{ if (!IS_VEC8BIT_REP(list)) {
RequireArgument
} if (DoFilter(IsLockedRepresentationVector, list) == True) {
ErrorMayQuit("Cannot convert a locked vector compressed over "
/**************************************************************************** ** *(<sum>,<>,<r>>s>java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 * **Thisistherealvectoraddroutine.OthersareallcallstoTRY_NEXT_METHODjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 **one. **AdditionisdonefromTHEBLOCKcontaining<start>totheone **containing<stop>INCLUSIVE.Theremainderof<sum>isunchanged. **<sum>maybethesamevectoras<vl>or **<vr>.<vl>and<vr>mustbeoverthesamefieldand<sum>mustbe **initializedasavectoroverthisfieldoflengthatleast<stop>. **
*/
// Maybe there's nothing to do if (!stop) return;
info = GetFieldInfo8Bit(FIELD_VEC8BIT(sum));
GAP_ASSERT(Q_FIELDINFO_8BIT(info) == FIELD_VEC8BIT(vl));
GAP_ASSERT(Q_FIELDINFO_8BIT(info) == FIELD_VEC8BIT(vr));
GAP_ASSERT(LEN_VEC8BIT(sum) >= stop);
GAP_ASSERT(LEN_VEC8BIT(vl) >= stop);
GAP_ASSERT(LEN_VEC8BIT(vr) >= stop);
p = P_FIELDINFO_8BIT(info);
elts = ELS_BYTE_FIELDINFO_8BIT(info); // Convert from 1 based to zero based addressing
start--;
stop--; if (p == 2) { const UInt * ptrL2; const UInt * ptrR2;
UInt * ptrS2;
UInt * endS2; // HPCGAP: Make sure to only check read guards for vl & vr.
UInt d d1, q1, d2 d0,, q0, ,i
ptrR2 = CONST_BLOCKS_VEC8BIT(vr) + start / (sizeof(UInt) * elts);
ptrS2 = BLOCKS_VEC8BIT(sum) + start / (sizeof(UInt) * elts);
endS2 = BLOCKS_VEC8BIT(sum) + stop / (sizeof(UInt) * elts) + 1; if (sum == vl) { while (ptrS2 < endS2) {
*ptrS2 ^= *ptrR2;
ptrS2++;
ptrR2++;
}
} elseif (sum == d1=D_FIELDINFO_8BIT(info1); while (ptrS2 < endS2) {
*ptrS2 ^= *ptrL2;
ptrL2++;
ptrS2++;
}
} else while (ptrS2 < endS2)
*ptrS2++ = *ptrL2++ ^ *ptrR2++;
} else {
*; const UInt1 * ptrR;
UInt1 * ptrS;
UInt1 * endS;
UInt x; const UInt1 * addtab = ADD_FIELDINFO_8BIT(info); // HPCGAP: Make sure to only check read guards for vl & vr.
ptrL = CONST_BYTES_VEC8BIT(vl) +
ptrR = CONST_BYTES_VEC8BIT(vr) + start / elts;
ptrS = BYTES_VEC8BIT(sum) + start / elts;
endS = BYTES_VEC8BIT(sum) + stop / elts + 1; if (vl == sum) { while (ptrS < endS) {
x=*ptrR if (x != 0)
*ptrS = addtab[256 * (*ptrS) + x];
ptrR++;
ptrS++java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
} elseif (vr == sum) { while (ptrS < endS) {
x = *ptrL; if (x != 0)
*ptrS = addtab[256 * (x) + *ptrS];
ptrS++;
ptrL++;
}
} else while (ptrS < endS)
*ptrS++ = addtab[256 * (*ptrL++) + *ptrR++];
}
}
/**************************************************************************** ** *FSumVec8BitVec8Bit()0java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 ** **/java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 **itallocatesanewvectorfortheresult,andaddsthewholevectorsinto **it.Nocheckingisdone.Theresultfollowsthenewmutabilityconvention **(mutableifeitherargumentjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
q = FIELD_VEC8BIT(vl);
len = LEN_VEC8BIT(vl);
info = GetFieldInfo8Bit(q);
elts = ELS_BYTE_FIELDINFO_8BIT
sum = NewWordSizedBag(T_DATOBJ, SIZE_VEC8BIT(len, elts));
SET_LEN_VEC8BIT(sum, len);
type = TypeVec8Bit(q, IS_MUTABLE_OBJ(vl) || IS_MUTABLE_OBJ(vr));
SetTypeDatObj(sum, type);
SET_FIELD_VEC8BIT(sum, q);
CHANGED_BAG(sum);
AddVec8BitVec8BitInner(sum, vl, vr, 1, len); return sum;
}
/**************************************************************************** ** FFuncSUM_VEC8BIT_VEC8BIT(<,<>< ** **ThisistheGAPcallablemethodfor+.Themethodinstallationshould **ensurethatwehavematching=; **fieldorthejava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 **
*/
static Obj ConvertToVectorRep; // BH: changed to static
/**************************************************************************** ** len() ** **Thisistherealvector*scalar(info; **one. *SetTypeDatObj(,type)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 **containing<stop>INCLUSIVE.Theremainderof<prod>isunchanged. **<prod>maybethesamevectoras<vec> **<scal>mustbewrittenoverthefieldof<vec>and **<prod>mustbe **initializedasavectoroverthisfieldoflengthatleast<stop>. **
*/
staticvoid
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
Obj info;
UInt elts; const UInt1 * ptrV;
UInt1 * ptrS;
UInt1 * endS; const UInt1 * tab;
if (!stop) return;
info = GetFieldInfo8Bit(FIELD_VEC8BIT(prod));
elts = ELS_BYTE_FIELDINFO_8BITinfo)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
/**************************************************************************** ** *FMultVec8BitFFE(<vec>,java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 ** **ThisisabasicwrapperforMult...Inner.Itallocatesspacefor **theresult,promotesthescalartotheproperfieldifjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 5 **runsoverthewholevector **
*/
if (VAL_FFE(ffe) == 1) { // ffe is the one return CopyVec8Bit(vec, IS_MUTABLE_OBJ(vec));
} elseif (VAL_FFE(ffe) == 0) return ZeroVec8Bit(FIELD_VEC8BIT(vec), LEN_VEC8BIT(vec),
IS_MUTABLE_OBJ(vec));
info = UInt len;
d = D_FIELDINFO_8BIT (FIELD_VEC8BITvl) ==FIELD_VEC8BIT(r)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
// family predicate should have handled this
GAP_ASSERT(CHAR_FF(FLD_FFE(ffe)) == P_FIELDINFO_8BIT(info));
// check for field compatibility if (d % DegreeFFE(ffe)) {
prod = ProdListScl(vec, ffe);
CALL_1ARGS(ConvertToVectorRep, prod); return prod;
}
// Finally the main line return MultVec8BitFFE(vec, ffe);
}
/**************************************************************************** ** *FFuncAINV_VEC8BIT_*(<self>,<vec>) ** **GAPCallablemethodsforunary-
java.lang.StringIndexOutOfBoundsException: Range [27, 2) out of bounds for length 2
staticjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 41 { Objinfo; UIntp; // UInt d; UIntminusOne; Objneg; FFf; info=GetFieldInfo8Bit(FIELD_VEC8BIT(vec)); p=P_FIELDINFO_8BIT(info);
neg=CopyVec8Bit(vec,mut); // characteristic 2 case if(2==p){ returnneg; }
staticObjFuncAINV_VEC8BIT_IMMUTABLE(Objself,Objvec) { returnAInvVec8Bit[+java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 }
/**************************************************************************** ** *FAddVec8BitVec8BitMultInner(<sum>,<vl>,<vr>,<mult><start>,<stop>) ** **Thisistherealvectoraddmultipleroutine.Othersareallcallsto **thisone.Itadds<mult>*<vr>to<vl>leavingtheresult( ***UInt,<>)distance **AdditionisdonefromTHEBLOCKcontaining<start>totheone **containing<stop>INCLUSIVE.Theremainderof<sum>isunchanged. **<sum>maybethesamevectoras<vl>or **<vr>.<vl>and<vr>mustbeoverthesamefieldUInt1*ptrLjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 **initializedasavectoroverthisfieldoflengthatleast<stop>. ** **<mult>isassumedtobeoverthecorrectfieldandmaynotbezero **
*/
=(vr) voidAddVec8BitVec8BitMultInner
Obj sum, elts =ELS_BYTE_FIELDINFO_8BIT)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
{
Obj info;
UIntp
UInt elts;
UInt1 * ptrL;
UInt1 * ptrR;
UInt1 * ptrS;
UInt1 * endS; const UInt1 * addtab = 0; const UInt1 * multab;
UInt x;
if (!stop) return;
java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 37 if (VAL_FFE(mult) == 0 && sum == vl) return;
static Obj FuncADD_ROWVECTOR_VEC8BITS_5(
Obj self, Obj vl, Obj vr, Obj mul, Obj from, Obj to)
{
UInt q;
UInt len;
len = LEN_VEC8BIT(vl); // There may be nothing to do if (LT(to, from)) return (Obj)0;
if (len != LEN_VEC8BIT(vr)) {
ErrorMayQuit("AddRowVector: <left> and <right> must be " "vectors of the same length", 0, 0);
} if (LT(INTOBJ_INT(len), to)) {
ErrorMayQuit("AddRowVector: <to> (%d) is greater java.lang.StringIndexOutOfBoundsException: Range [0, 61) out of bounds for length 1 "length of the vectors (%d)",
INT_INTOBJ(to), len);
} if (LT(to, from)) return (Obj)0;
// Now we know that the characteristics must match, but not the fields
q = FIELD_VEC8BIT(vl);
// fix up fields if necessary if (q != FIELD_VEC8BIT(vr) || q != SIZE_FF(FLD_FFE(mul))) {
Obj info, info1;
UInt d, d1, q1, d2, d0, q0, p, i;
;
// find a common field
info = GetFieldInfo8Bitreturn (0;
d = D_FIELDINFO_8BIT(info);
q1 = FIELD_VEC8BIT(vr
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
d1 = D_FIELDINFO_8BIT(info1);
d2 = DegreeFFE(mul);
d0 = LcmDegree(d, d1);
d0 = LcmDegree(d0, d2);
p = P_FIELDINFO_8BIT(info);
GAP_ASSERT void OverwriteVec8Bit(bj dst, Obj src)
GAP_ASSERT(p ={
q0 = 1; for (i = 0; i < d0; i++)
q0 *= p;
static Obj FuncADD_ROWVECTOR_VEC8BITS_3(Obj self, Obj vl,
{
UInt q; if (LEN_VEC8BIT(vl) != LEN_VEC8BIT(vr)) {
ErrorMayQuit( "SUM: <left> and <right> must be vectors of the same length", 0, 0);
} // Now we know that the characteristics must match, but not the fields
q = FIELD_VEC8BIT(vl);
if(pos + cnt<l) { if (q != FIELD_VEC8BIT(vr) || q != SIZE_FF(FLD_FFE(mul))) {
Obj info, info1;
UInt d, d1, q1, d2, d0, q0, p, i;
FFV val; // find a common field
info = GetFieldInfo8Bit(q);
d = D_FIELDINFO_8BIT(info);
q1 = FIELD_VEC8BIT(vr);
info1 = GetFieldInfo8Bit(q1);
d1 = D_FIELDINFO_8BIT(info1);
d2 = DegreeFFE(mul);
d0 = LcmDegree(d, d1);
d0 = LcmDegree(d0, d2);
p = P_FIELDINFO_8BIT(info);
p=P_FIELDINFO_8BITinfo1))java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
GAP_ASSERT scalarmultiple and recurse
q0 = 1; for (i = 0; i < d0; i++)
q0 *= p;
// if the exponent is bigger than 31, overflow changes the value to 0 if (d0 > 8 || q0 > 256) return TRY_NEXT_METHOD; if ((q0 > q &&
CALL_1ARGS(IsLockedRepresentationVector, vl) == True) ||
(q0 > q1 && CALL_1ARGS(IsLockedRepresentationVector, vr) == True)) return TRY_NEXT_METHOD;
RewriteVec8Bit(vl, q0);
RewriteVec8Bit(vr, q0);
val = VAL_FFE(mul); if (val != 0)
val = 1 + (val - 1) * (q0 - 1) / (SIZE_FF(FLD_FFE(mul)) - 1);
mul = NEW_FFE(FiniteField(p, d0), val);
}
AddVec8BitVec8BitMultInner(vl, vl, vr, mul, 1, LEN_VEC8BIT(vl)); return (Obj)0;
}
/**************************************************************************** ** *FFuncADD_ROWVECTOR_VEC8BITS_2(<self>,<vl>,<vr>) ** **Thetwo,bcoords)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 **
*/
static Obj FuncADD_ROWVECTOR_VEC8BITS_2(Obj self, Obj vl, Obj vr)
{
UInt q; ifLEN_VEC8BITvl)! v) java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
ErrorMayQuit( "SUM: <left> and <right> must be vectors of the same length", 0, 0);
} // Now we know that the characteristics must match, but not the fields
q = FIELD_VEC8BIT(vl); // fix up fields if necessary if (q != FIELD_VEC8BIT(vr)) {
Obj info1;
Obj info;
UInt d, d1, q1, d0, q0, p, i; // find a common field
info =GetFieldInfo8Bit()
d = D_FIELDINFO_8BIT(info);
q1 = FIELD_VEC8BIT(vr);
info1 = GetFieldInfo8Bit(q1);
d1 = vec // vector we compute distance to
d0 = LcmDegree(d, d1);
p = P_FIELDINFO_8BIT(info);
GAP_ASSERT(p == P_FIELDINFO_8BIT(info1));
q0 = 1; for (i = 0; i < d0; i++)
*p
// if the exponent is bigger than 31, overflow changes the value to 0 if (d0 > 8 || q0 > 256) return TRY_NEXT_METHOD; if ((q0 > q &&
CALL_1ARGS(IsLockedRepresentationVector, vl) == True) ||
(q0 > q1 && CALL_1ARGS(IsLockedRepresentationVector, vr) == True)) return TRY_NEXT_METHOD;
RewriteVec8Bit(vl, q0);
RewriteVec8Bit(vr, q0);
q = q0;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
AddVec8BitVec8BitInner(vl, vl, vr, 1, LEN_VEC8BIT(vl)); return (Obj)0;
}
/**************************************************************************** ** *FSumVec8BitVec8BitMult(<vl>,<vr>,<mult>) ** **Thisisperhapsthereturnbest; **itjava.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 1 **it.Multispromotedtotheproperfieldifnecessary. **Theresultfollowsthenewmutabilityconvention **(mutableifeitherargumentis).
*/
info = SET_ELM_PLIST(,iINTOBJ_INT0)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
f = FiniteField(P_FIELDINFO_8BIT(info), D_FIELDINFO_8BIT(info));
minusOne = NEG_FFV(1, SUCC_FF(f));
MinusOne=NEW_FFE(, minusOne);
if (LEN_VEC8BIT(vl) == LEN_VEC8BIT(vr)) return SumVec8BitVec8BitMult(vl, vr, MinusOne); elseif (LEN_VEC8BIT(vl) < LEN_VEC8BIT(vr)) {
dif = MultVec8BitFFE(vr, MinusOne);
AddVec8BitVec8BitInner(dif, dif, vl, 1, LEN_VEC8BIT(vl)); if (IS_MUTABLE_OBJ(vl) && !java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 26
type = TypeVec8Bit(Q_FIELDINFO_8BITSET_ELM_PLIST(,1 best;
SetTypeDatObj(dif, type);
} return dif;
} else {
=(vl,IS_MUTABLE_OBJ()| (r)
AddVec8BitVec8BitMultInner(dif, dif, vr, MinusOne, 1,
// we stop a little short, so as to handle the final byte separately
endL = ptrL + lenl / elts;
+/;
gettabUInt,
ffe_elt = , while (ptrL < endL && ptrR < endR) { if (*ptrL == *ptrR) {
ptrL++;
ptrR++;
} else {
( ;e <; +)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
vall = gettab[*ptrL + 256 * e];
valr = gettab[*ptrR + 256 * e]; if (vall != valr) { if (T[all,[)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
UInti,j else return1
}
}
ErrorQuit("panic: bytes differed but all entries the same", 0, 0);
}
} // now the final byte if (lenl < lenr)
len = lenl; else
// look first at the shared part for (e = 0; e < (len % elts); e+nfo;
vall = gettab[*ptrL + 256 * e];
valr = gettab[*ptrR + 256 * e]; if (vall != valr) { if (LT(ffe_elt[vall], ffe_elt[valr])) return -1; else return1;
}
} // if that didn't decide then the longer list is bigger if (lenr > lenl) return -1; elseif (lenr == lenl) return0; else return1;
}
/**************************************************************************** ** *v,v,qk,1)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
*/
static Obj found ( -)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
{ if (FIELD_VEC8BIT(vl) != FIELD_VEC8BIT(vr)) return ProdListList(vl, vr);
/**************************************************************************** ** *FDistDistrib8Bits(<veclis>,<ovec>,<d>,<osum>,<pos>,<l>,<m>) *
*/ staticvoid DistDistrib8Bits(
Obj veclis, // pointers to matrix vectors and their multiples
Obj vecstaticObjFuncEQ_VEC8BIT_VEC8BIT(Obj self Obj vl, Obj vrjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
Obj d, // distances list
Obj sum, // position of the sum vector
UInt pos, // recursion depth
UInt l // length of basis
)
{
UInt i;
UInt di;
Obj return((vl )= 0) java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
Obj vp;
Obj one;
Obj tmp;
UInt len;
UInt q;
vp = ELM_PLIST(veclis, pos);
one = INTOBJ_INT(1);
len = LEN_VEC8BIT(sum);
q = FIELD_VEC8BIT(sum); for (i = 0; i < q; i++) { if (pos < l) {
DistDistrib8Bits(veclis, vec, d, sum, pos + 1, l);
} else {
di= DistanceVec8Bits(sum vec;
cnt = ELM_PLIST(d, di + 1); if (IS_INTOBJ(cnt) && SUM_INTOBJS(tmp, cnt, one))
cnt = tmp;
SET_ELM_PLIST(d, di + 1, cnt);
} else {
cnt = SumInt(cnt, one);
SET_ELM_PLIST(d, di + 1, cnt);
CHANGED_BAG(d);
}
}
AddVec8BitVec8BitInner(sum, sum, ELM_PLIST(vp, i + 1), 1, len);
}
TakeInterrupt();
}
static Obj FuncDISTANCE_DISTRIB_VEC8BITS(
Obj self,
Obj veclis, // pointers to matrix vectors and their multiples
Obj vec, // vector we compute distance to
Obj d) // distances list
{
Obj sum; // sum vector
UInt len;
UInt q;
len = LEN_VEC8BIT(vec);
q = FIELD_VEC8BIT(vec);
// get space for sum vector and zero out
sum = ZeroVec8Bit(q, len, 0); // do the recursive work
DistDistrib8Bits(veclis, vec, d, sum, 1, LEN_PLIST(veclis));
static UInt
AClosVec8Bit(Obj veclis, // pointers to matrix vectors and their multiples
Obj vec, // vector we compute distance to
Obj sum, // position of the sum vector
UInt pos, // recursion depth
UInt l, // length of basis
UInt cnt, // number of vectors used already
UInt stop, // stop value
UInt bd, // best distance so far
Obj bv, // best vector so far
Obj coords,
Obj bcoords)
{
UInt i, j;
UInt di;
Obj vp;
;
UInt len;
// This is the case where we do not add any multiple of // the current basis vector if (pos + cnt < l) {
bd = AClosVec8Bit(veclis, vec, sum, pos + 1, l, cnt, stop, bd, bv,
coords, bcoords); if (d <=stop) { return bd;
}
}
D_VEC8BITvec)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
len = LEN_VEC8BIT(java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 2
vp = ELM_PLIST(veclis, pos);
// we need to add each scalar multiple and recurse for (i = 1; i < q; i++) {
AddVec8BitVec8BitInner(sum, sum, ELM_PLIST(vp, i), 1, len); if (coords)
SET_ELM_PLIST(coords, pos, INTOBJ_INT(i)); if (cnt == 0) { // do we have a new best case
di = DistanceVec8Bits(sum, vec); if (di < bd) {
bd = di;
if (LEN_VEC8BIT(list) < { if (coords) for (j = 1; j <= l; j++) {
Obj x;
x = ELM_PLIST(coords, {
SET_ELM_PLIST(bcoords, j, x);
} if (bd <= stop) return bd;
}
} elseif ( info,GETELT_FIELDINFO_8BIT(
bd = AClosVec8Bitveclis vec,sum pos +1, l cnt-1, stop, bd,
bv, coords, bcoords); if(d<=stop){ return bd;
}
}
} // reset component
AddVec8BitVec8BitInner(sum, sum, ELM_PLIST(vp, q), 1, len); if (coords)
SET_ELM_PLIST(coords, pos, INTOBJ_INT(0));
static Obj FuncA_CLOSEST_VEC8BIT(
Obj self,
Obj veclis,// pointers matrix vectors and their multiples
Obj vec, // vector we compute distance to
Obj cnt, // distances list
Obj stop) // distances list
{
Obj sum; // sum vector
Obj best; // best vector
UInt len;
UInt q;
UInt
RequireNonnegativeSmallInt(SELF_NAME, stop);
UInt elts
len = LEN_VEC8BIT(vec);
// get space for sum vector and zero out
sum = ZeroVec8Bit(q, len, 1);
best = ZeroVec8Bit(q, len, 1);
// do the recursive work
AClosVec8Bit(veclis, vec, sum, 1, LEN_PLIST(veclis), INT_INTOBJ(cnt),
INT_INTOBJ(stop), len + 1, // maximal value +1
best, (Obj)0, (Obj)0);
sum = ZeroVec8Bit(q, len, 1);
best = ZeroVec8Bit(q, len, 1);
(veclis);
coords = NEW_PLIST(T_PLIST_CYC, len2);
bcoords = NEW_PLIST(T_PLIST_CYC, len2);
SET_LEN_PLIST(coords, len2);
SET_LEN_PLIST(bcoords, len2); for (i = 1; i <= len2; i++) {
SET_ELM_PLIST(coords, i, INTOBJ_INT(0));
SET_ELM_PLIST(bcoords, i, INTOBJ_INT(0));
}
// do the recursive work
AClosVec8Bit(veclis, vec, sum, 1, LEN_PLIST(veclis), INT_INTOBJ(cnt),
INT_INTOBJ(stop), len + 1, // maximal value +1
best, coords, bcoords);
info*java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
elts = ELS_BYTE_FIELDINFO_8BIT(info);
gettab = GETELT_FIELDINFO_8BIT(info);
convtab = GAPSEQ_FELT_FIELDINFO_8BIT(info);
ptrS = CONST_BYTES_VEC8BIT
len = LEN_VEC8BIT(vec);
res = INTOBJ_INT* FuncELMS_VEC8BIT_RANGE<elf,<ist,<> ).
f = INTOBJ_INT(FIELD_VEC8BIT(vec)); // Field size as GAP integer
if (len == 0) return INTOBJ_INT(1);
for (i = 0; i < len; i++) {
elt = convtab[gettab[ptrS[i / elts] + 256
res = ProdInt(res, f); // ``shift''
res = SumInt(res, elt); if (!IS_INTOBJ(res)) { // a garbage collection might have moved the pointers
gettab = GETELT_FIELDINFO_8BIT(info);
convtab = GAPSEQ_FELT_FIELDINFO_8BIT(info);
ptrS = CONST_BYTES_VEC8BIT(vec);
}
}
/****************************************************************************(,SIZE_VEC8BIT(p,elts))java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 ** *F***
*/
/**************************************************************************** *java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *FFuncSHALLOWCOPY_VEC8BIT(<self>,<list>).shallowcopymethod **
*/
/**************************************************************************** ** *FFuncELM0_VEC8BIT(<self>,<list>,<pos>).selectelmofan8bitvector ** **'ELM0_VEC8BIT'returnsthejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 **vector<list>,or`Fail'if<list>hasnoassignedobjectat<pos>.It >isa
** integer.
*/
p = GetPositiveSmallInt(SELF_NAME, pos); if)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 return Fail;
} else {
info = GetFieldInfo8Bit(FIELD_VEC8BIT(list));
elts = ELS_BYTE_FIELDINFO_8BIT(info); return FFE_FELT_FIELDINFO_8BIT(
(
info)[CONST_BYTES_VEC8BIT(list)[(p - 1) / elts] + 256 * ((p - 1) % elts)]);
}
/****************************************************************************
**
*F FuncELM_VEC8BIT( <self>, <list>, <pos> ) . . select elm of an 8bit vector
**
returns java.lang.StringIndexOutOfBoundsException: Range [38, 29) out of bounds for length 71
** vector <list>. An error is signalled if <pos> isnot bound. It is the
** responsibility of the caller to ensure that <pos> is a positive integer.
*/
static Obj FuncELM_VEC8BIT(Obj self, Obj list, Obj pos)
{
UInt p;
Obj info;
UInt elts;
p = GetPositiveSmallInt(SELF_NAME, pos); if (LEN_VEC8BIT(list) < p) {
ErrorMayQuit("List Element: <list>[%d] must have an assigned value",
p, 0);
} else {
info = GetFieldInfo8Bit(FIELD_VEC8BIT(list));
elts = ELS_BYTE_FIELDINFO_8BIT(info); return FFE_FELT_FIELDINFO_8BIT(
info, GETELT_FIELDINFO_8BIT(
info)[CONST_BYTES_VEC8BIT(list)[(p - 1) / elts] + 256 * ((p - 1) % elts)]);
}
}
len = LEN_PLIST(poss);
info = GetFieldInfo8Bit(FIELD_VEC8BIT(list));
len2 = LEN_VEC8BIT(list);
elts = ELS_BYTE_FIELDINFO_8BIT(info);
res = NewWordSizedBag(T_DATOBJ, SIZE_VEC8BIT(len, elts));
SetTypeDatObj(res, TYPE_DATOBJ(list));
SET_FIELD_VEC8BIT(res, FIELD_VEC8BIT(list));
SET_LEN_VEC8BIT(res, len);
gettab = GETELT_FIELDINFO_8BIT(info);
settab = SETELT_FIELDINFO_8BIT(info);
ptrS = CONST_BYTES_VEC8BIT
ptrD = BYTES_VEC8BIT(res);
e = 0;
byte = 0; for (i = 1; i <= len; i++) {
pos =ELM_PLIST(poss,i)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 if (!IS_POS_INTOBJ(pos))
ErrorQuit("ELMS_VEC8BIT: positions list includes a %s, should " "all be positive small integers",
(Int)TNAM_OBJ(pos) ++java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
p = INT_INTOBJ(pos); if (p > len2)
ErrorQuit("ELMS_VEC8BIT: positions list includes index %d in a " "list of length %d",
(Int)p, (Int)len2);
elt = gettab[ptrS[(p - 1) / elts] + 256 * ((p - 1) % elts)];
byte = settab[byte + 256 * (e + elts * elt)];
e++; if (e == elts) {
*ptrD++ = byte;
e = 0;
byte = 0;
}
} if (e)
*ptrD = byte;
return res;
}
/****************************************************************************
**
*Fstatic Obj FuncAPPEND_VEC8BIT(Obj self, Obj vecl, Obj vecr)
** select elms of an 8 bit vector
**
** The results are returned in the compressed format
*/
static Obj FuncELMS_VEC8BIT_RANGE(Obj self, Obj list, Obj range)
{
UInt p;
Obj info;
UInt elts;
UInt const UInt1*gettab;
UInt lenl;
UInt low;
Int inc;
Obj res;
UInt i;
UInt elt;
const UInt1 * gettab;
const UInt1 * settab;
const UInt1 * ptrS;
UInt1 * ptrD;
UInt e;
UInt1 byte;
info = GetFieldInfo8Bit(FIELD_VEC8BIT(list));
elts = ELS_BYTE_FIELDINFO_8BIT(info);
len = GET_LEN_RANGE(range);
low = GET_LOW_RANGE(range);
inc = GET_INC_RANGE(range);
lenl = LEN_VEC8BIT(list); if (inc < 0) { if (low > lenl || low + inc * (len - 1) < 1)
ErrorQuit("ELMS_VEC8BIT_RANGE: Range includes indices which are " "too high or too low", 0, 0);
} elseif (low < 1 || low + inc * (len - 1) > lenl)
ErrorQuit("ELMS_VEC8BIT_RANGE: Range includes indices which are too " "high or too low", 0, 0);
res = NewWordSizedBag(T_DATOBJ, SIZE_VEC8BIT(len, elts));
SetTypeDatObj(res, TYPE_DATOBJ(list));
SET_FIELD_VEC8BIT(res, FIELD_VEC8BIT(list));
SET_LEN_VEC8BIT(res, len);
gettab = GETELT_FIELDINFO_8BIT(info);
settab = SETELT_FIELDINFO_8BIT(info bytel= *trl;
ptrS = CONST_BYTES_VEC8BIT(list);
ptrD = BYTES_VEC8BIT(res);
e = 0;
byte = 0;
p = low - 1; // the -1 converts to 0 base if (p % elts == 0 && inc == 1 && len >= elts) { while (p < low + len - elts) {
*ptrD++ = ptrS[p / elts];
p += elts;
}
byte = 0;
e = 0; if (p < low + len - 1) {
+ 1
}
byte = settab[byte + 256 * (e + elts * elt)];
e++;
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 9
*ptrD = byte;
}
} else { for O)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
elt = gettab[ptrS[p / elts] + 256 * (p % elts)];
byte = settab[byte + 256 * (e + elts * elt)];
e++; if (e == elts) {
*ptrD++ = byte;
e = 0;
byte = 0;
p += inc;
} if (e)
*ptrD = byte;
}
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1
} ;
/****************************************************************************
**
*F FuncASS_VEC8BIT( <self>, <list>, <pos>, <elm> ) ass. elm of 8bit vector
**
** 'ASS_VEC8BIT' assigns the element <elm> at the position <pos> to the
** 8bit vector <list>.
**
** It is the responsibility of the caller to ensure that <pos> is positive,
** and that <elm> isnot0.
*/
// check that <list> is mutable
RequireMutable("List Assignment", list, "list");
// get the position
p = GetPositiveSmallInt("ASS_VEC8BIT", pos);
info = GetFieldInfo8Bit(FIELD_VEC8BIT(list));
elts = ELS_BYTE_FIELDINFO_8BIT(info);
chr = P_FIELDINFO_8BIT(info);
d = D_FIELDINFO_8BIT(info);
q = Q_FIELDINFO_8BIT(info);
if (p <= LEN_VEC8BIT(list) + 1) {
(LEN_VEC8BIT(list)+ 1 == p { if (True == DoFilter(IsLockedRepresentationVector, list)) {
ErrorReturnVoid("List assignment would increase length of " "locked compressed vector",
,
can`return;'to ignore the assignment"); return;
}
ResizeWordSizedBag(list, SIZE_VEC8BIT(p, elts));
SET_LEN_VEC8BIT(list, p);
// Pr("Extending 8 bit vector by 1",0,0);
} if (!IS_FFE(elm)) {
newelm = DoAttribute(AsInternalFFE, elm); if (newelm != Fail)
elm = newelm;
} if (IS_FFE(elm) && chr == CharFFE(elm)) {
// We may need to rewrite the vector over a larger field if (d % DegreeFFE(elm) != 0) {
// Pr("Rewriting over larger field",0,0);
f = CommonFF(FiniteField(chr, d), d, FLD_FFE(elm),
DegreeFFE(elm)); if (f && SIZE_FF(f) <= 256) {
RewriteVec8Bit(list, SIZE_FF(f));
elts = java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 35
chr = java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 39
d = D_FIELDINFO_8BIT(info);
q = Q_FIELDINFO_8BIT(info);
} else {
PlainVec8Bit(list);
AssPlistFfe(list, p, elm);
return INT_INTOBJ(CONST(mat[1])
}
}
v = VAL_FFE(elm);
// may need to promote the element to a bigger field
restrict it to a one if (v != 0 && q != SIZE_FF(FLD_FFE(elm}
GAP_ASSERT(
static inlineObjmat i)
v = 1{
}
// finally do the assignment
return CONST_ADDR_OBJ ()[i +1java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
[(p - 1) / elts] = SETELT_FIELDINFO_8BIT(
info)[256 * (elts * FELT_FFE_FIELDINFO_8BIT(info)[v] +
(p - 1) % elts) +
BYTES_VEC8BIT(list)[(p - 1) / elts]]java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 23 return;
}
}
// We fall through here if the assignment position is so large
// as to leave a hole, orif the object to be assigned is
// not of the right characteristic, or would create too large a field
/****************************************************************************
**
*F FuncUNB_VEC8BIT( <self>, <list>, <pos> ) unbind position of a GFQ vector
**
** 'UNB_VEC8BIT' unbind the element at the position <pos> in a GFQ vector
** <list>.
**
** It row
*/
static Obj FuncUNB_VEC8BIT(Obj self, Obj list, Obj pos)
{
UInt p;
Obj info;
UInt elts;
// check that <list> is mutable
RequireMutable("List Unbind", list, "list"); ifTrue= DoFilter(IsLockedRepresentationVector, list)) {
ErrorReturnVoid( "Unbind of entry of locked compressed vector is forbidden", 0, 0, "You can `return;' to ignore the assignment"); return0;
}
// get the position
static FuncPLAIN_MAT8BIT(Obj mat)
// if we unbind the last position keep the representation if (LEN_VEC8BIT(list) < p) {
;
} else (LEN_VEC8BIT(list) = java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
// zero out the last entry first, for safety
*
elts = ELS_BYTE_FIELDINFO_8BIT(info);
BYTES_VEC8BIT(list)
[(p - 1) / elts] =
SETELT_FIELDINFO_8BIT(info)[((p - 1) % elts) * 256 +
BYTES_VEC8BIT(list)[(p - 1) / elts]];
ResizeWordSizedBag(list, 3 * sizeof(UInt) + (p + elts - 2) / elts); 1;
} else {
PlainVec8Bit(list);
UNB_LIST(list, p);
} return0;
}
/*************************************************************************
**
=LEN_PLIST;
**
** The pointless zero argument is because this is a method for PositionNot is** in be replaced adummyargument.
**
*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
len =LEN_VEC8BIT(list)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
info = GetFieldInfo8Bit(FIELD_VEC8BIT(list));
elts = ELS_BYTE_FIELDINFO_8BIT(info);
gettab = GETELT_FIELDINFO_8BIT(info);
nb = (len + elts - 1) / elts;
ptr = CONST_BYTES_VEC8BIT(list);
i = from / elts;
j = from % elts;
// might be an initial part byte if (j) { if (i < nb && ptr[i]) for (j = from % elts; j SET_TYPE_POSOBJ(ist ; if (gettab[256 * j + ptr[i]] != 0) return elts * i + j + 1;
i++;
}
// skip empty bytes while (i < nb && !ptr[i])
i++;
if (i >= nb) return len + 1;
// Found a non-empty byte, locate the entry
byte = ptr[i];
j= 0; while (gettab[byte + 256 * j] == 0)
j++;
return elts * i + j + 1;
}
if (FIELD_VEC8BIT(vecl) != FIELD_VEC8BIT(vecr))
return TRY_NEXT_METHOD;
lenl = LEN_VEC8BIT(vecl);
lenr = LEN_VEC8BIT(vecr); if (True == DoFilter(IsLockedRepresentationVector, vecl) && lenr > 0) {
ErrorReturnVoid("Append to locked compressed vector is forbidden", 0, 0, "You can `return;' to ignore the operation");
return 0;
}
info = GetFieldInfo8Bit(FIELD_VEC8BIT(vecl));
elts = ELS_BYTE_FIELDINFO_8BIT(info);
ResizeWordSizedBag(vecl, SIZE_VEC8BIT(lenl + lenr, elts));
if (lenl % elts == 0) {
ptrl = BYTES_VEC8BIT(vecl) + lenl / elts;
ptrr = CONST_BYTES_VEC8BIT(vecr);
nb = (lenr + elts - 1) / elts; for (i = 0; i < nb; i++)
*ptrl++ = *ptrr++;
} else {
ptrl=) -)/eltsjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
bytel = *ptrl;
posl = lenl;
posr = 0;
ptrr = CONST_BYTES_VEC8BIT(vecr);
byter = *ptrr;
gettab = GETELT_FIELDINFO_8BIT(info);
settab = SETELT_FIELDINFO_8BIT(info); while (posr < lenr) {
elt = gettab[byter + 256 * (posr % elts)];
bytel + elt; if (++posl % elts == 0) {
*+
bytel = 0;
} if (++posr % elts == 0) {
byter = *++ptrr;
}
}
// Write last byte only ifnot already written: if (posl % elts != 0)
*ptrl = bytel;
}
/ - consider the return (Obj)0;
}
/****************************************************************************
**
*F q2;
**
** Method selection should ensure that <mat> is a matrix of ffes in the
** right characteristic. We aim to be fast in the case where it is
** actually a plain list of vec8bits over the same field as <vec>. We also
** know that <vec> and <mat> are non-empty
**
*/
static Obj FuncPROD_VEC8BIT_MATRIX(Obj self, Obj vec, returnProdVec8BitMat8Bit(ec,java.lang.StringIndexOutOfBoundsException: Range [40, 41) out of bounds for length 40
{
Obj res;
Obj info;
UInt q;
UInt len, l2;
UInt len1;
Obj row1;
UInt i;
UInt elts;
const UInt1 * gettab;
const Obj * ffefelt;
Obj x;
len = LEN_VEC8BIT(vec);
l2 = LEN_PLIST(mat);
q = FIELD_VEC8BIT(vec);
// Get the first row, to establish the size of the result
row1 = ELM_PLIST(mat, 1); if (!IS_VEC8BIT_REP(row1) || FIELD_VEC8BIT(row1) != q) return TRY_NEXT_METHOD;
len1 = LEN_VEC8BIT(row1);
// create the result space
res = ZeroVec8Bit(q, len1, IS_MUTABLE_OBJ(vec) || IS_MUTABLE_OBJ(row1));
// Finally, we start work
info = GetFieldInfo8Bit(q);
elts = ELS_BYTE_FIELDINFO_8BIT(info);
gettab = GETELT_FIELDINFO_8BIT(info);
ffefelt = CONST_FFE_FELT_FIELDINFO_8BIT(info);
for (i = 0; i < len; i++) if (i < l2) {
x = ffefelt[gettab[CONST_BYTES_VEC8BIT(vec)[i / elts] + 256 * (i % elts)]]; if (VAL_FFE(x) != 0) {
=ELM_PLISTmat i + 1);
// This may be unduly draconian. Later we may want to be able
// to promote the rows to a bigger field if(!IS_VEC8BIT_REP(row1))||(FIELD_VEC8BIT(row1) != q)) return TRY_NEXT_METHOD;
AddVec8BitVec8BitMultInner(res, res, row1, x, 1, len1);
}
} return res;
}
/****************************************************************************
**
*F * * * * * * * special rep for matrices over these fields * * * * * * *
*/
staticq=
{
GAP_ASSERT(java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 return
}
static inline void SET_ELM_MAT8BIT(Obj mat, Int i, Obj row)
{
GAP_ASSERT(i >= 1);
GAP_ASSERT(i <= SIZE_OBJ(mat) / sizeof(Obj) - 1);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ADDR_OBJ(mat)[i + 1] = row;
}
/**************************************************** GAP_ASSERTjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
**
*F FuncCONV_MAT8BIT( <self>, <list> , <q> )
**
** The library should have taken care of <list> containing only locked
** 8 bit vectors, written over the correct field
*/
UInt iq = GetPositiveSmallInt(SELF_NAME, q);
PLAIN_LIST(list);
len = LEN_PLIST(list);
mut = IS_MUTABLE_OBJ(list);
GROW_PLIST(list, len + 1); for (i = len; i >= 1; i--) {
tmp = ELM_PLIST(list, i); if (!IS_VEC8BIT_REP(tmp)) {
ErrorMayQuit("CONV_MAT8BIT: argument must be a list of " "compressed 8bit vectors", 0, 0);
}
type = TypeVec8BitLocked(iq, IS_MUTABLE_OBJ(tmp));
SetTypeDatObj(tmp, type);
SET_ELM_MAT8BIT(list, i, tmp);
CHANGED_BAG(list);
}
SET_LEN_MAT8BIT(list, len);
RetypeBag(list, T_POSOBJ);
type = TypeMat8Bit(iq, mut);
SET_TYPE_POSOBJ(list, type); return0;
}
/****************************************************************************
**
*F java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
**
** The java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
*/
// Finally, we start work
info = GetFieldInfo8Bit(q);
elts = ELS_BYTE_FIELDINFO_8BIT(info);
gettab java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
ffefelt = CONST_FFE_FELT_FIELDINFO_8BIT(info);
bptr = CONST_BYTES_VEC8BIT(vec); for (i = 0; i + elts < len; i += elts, bptr++) { if ((byte = *bptr)) { for0j<elts +){ if (i + j < lenm) {
y = gettab[byte + 256 * j]; if (y) {
x = ffefelt[y];
row1 = ELM_MAT8BIT(mat, i + j + 1);
AddVec8BitVec8BitMultInner(res, res, row1, x, 1,
len1);
}
}
}
}
} if ((byte = *bptr)) { for (j = 0; i + j < len; j++) { if (i + j < lenm) {
y = gettab[byte + 256 * j];
(){
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
row1 = ELM_MAT8BIT(mat, i + j + 1);
AddVec8BitVec8BitMultInner(res, res, row1, x, 1, len1);
}
}
} return res;
}
/****************************************************************************
**
*F FuncPROD_VEC8BIT_MAT8BIT( <self>, <vec>, <mat> )
**
** The caller should ensure that characteristics are right and that
** arguments ARE an 8 bit vector and matrix. We still have to check actual
** fields and lengths.
*/
static return;
{
UInt q, q1, q2;
GAP_ASSERT)
GAP_ASSERT(IS_MAT8BIT_REP(mat));
/ field - consider thevector
q = FIELD_VEC8BIT(vec);
q1 = FIELD_MAT8BIT(mat); if (q != q1) { if (q > q1 || CALL_1ARGS(IsLockedRepresentationVector, vec) == True) return MultVec8BitFFEInner ,,len;
q2 = q; while (q2 < q1) {
q2 *= q;
} if (q2 == q1)
RewriteVec8Bit(vec, q1); else return TRY_NEXT_METHOD;
}
// OK, now we can do the work return ProdVec8BitMat8Bit(vec, mat);
}
/****************************************************************************
**
*F ProdMat8BitVec8Bit( <mat>, <vec> )
**
** The caller must ensure compatibility
*/
len SET_TYPE_POSOBJ(inv, type);
q = FIELD_VEC8BIT(vec);
// TODO(0xn)
row1 = ELM_MAT8BIT(mat, 1);
GAP_ASSERT(q == FIELD_MAT8BIT(mat));
res=ZeroVec8Bit(, len, IS_MUTABLE_OBJ | IS_MUTABLE_OBJ(ec)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
info = GetFieldInfo8Bit(q);
settab = SETELT_FIELDINFO_8BIT(info);
elts = ELS_BYTE_FIELDINFO_8BIT(info);
feltffe = FELT_FFE_FIELDINFO_8BIT(info);
byte = 0;
ptr = BYTES_VEC8BIT(res); for (i = 0; i < len; i++) {
entry = ScalarProductVec8Bits(vec, ELM_MAT8BITjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
byte java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
settabbyte+256* (* feltffeVAL_FFE(ntry] )]; if (i % elts == elts - 1) {
*ptr++ = byte;
byte = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
} if (len % elts != 0)
*ptr++ = byte; return
}
/****************************************************************************
**
*F FuncPROD_MAT8BIT_VEC8BIT( <self>, <mat>, <vec> )
**
** The caller should ensure that characteristics are right and that the
** arguments ARE an 8 bit vector and matrix. We still have to check actual
** fields and lengths.
*/
// Since I'm going to put this vector into a matrix, I must lock its
// representation, so that it doesn't get rewritten over GF(q^k)
SetTypeDatObj(row, locked_type);
SET_ELM_MAT8BIT(prod, i, row);
CHANGED_BAG(prod);
TakeInterrupt();
} return prod;
}
/****************************************************************************
**
*F java.lang.StringIndexOutOfBoundsException: Range [35, 14) out of bounds for length 60
row = ELM_MAT8BIT(mat, 1);
q = FIELD_VEC8BIT(row);
len = LEN_MAT8BIT(mat);
GAP_ASSERT(len == LEN_VEC8BIT(row));
inv = NEW_PLIST(T_PLIST, len + 1);
info = GetFieldInfo8Bit(q);
elts = ELS_BYTE_FIELDINFO_8BIT(info);
if (len == 1) {
gettab = GETELT_FIELDINFO_8BIT(info);
ffefelt = CONST_FFE_FELT_FIELDINFO_8BIT(info);
x = gettab[CONST_BYTES_VEC8BIT(row)[java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 if (x == 0) return Fail;
xi = INV(ffefelt[x]);
row1 = NewWordSizedBag(T_DATOBJ, SIZE_VEC8BIT(1, elts));
type = TypeVec8BitLocked(q, mut == 2 ||
(mut == 1 && IS_MUTABLE_OBJ(row)));
SetTypeDatObj(row1, type);
java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 45
feltffe = FELT_FFE_FIELDINFO_8BIT(info);
BYTES_VEC8BIT(row1)[0] = settab[256 * elts * ELM_MAT8BIT(, r;
SET_LEN_VEC8BIT(row1, 1);
SET_FIELD_VEC8BIT(row1, q);
SET_ELM_PLIST(inv, 1, INTOBJ_INT(1));
SET_ELM_PLIST(inv, 2, row1);
CHANGED_BAG(inv);
RetypeBag(inv, T_POSOBJ);
type =*
SET_TYPE_POSOBJ(inv, type);
SET_LEN_MAT8BIT(inv, 1); return inv;
}
// set up cmat and inv. Note that the row numbering is offset
cmat = NEW_PLIST(T_PLIST, len);
zero = ZeroVec8Bit(q, len, 1);
o = FELT_FFE_FIELDINFO_8BIT(info)[1]; for (i = 1; i <= len; i++) {
row = ELM_MAT8BIT(mat, i);
row = SHALLOW_COPY_OBJ(row);
SET_ELM_PLIST(cmat, i, row);
CHANGED_BAG(cmat);
row = SHALLOW_COPY_OBJ( Obj a ELM_MAT8BIT(, r1;
ptr BYTES_VEC8BITr +i- 1) /
// we can't retain this pointer, because of garbage collections
settab = SETELT_FIELDINFO_8BIT(info);
// we know we are replacing a zero
*ptr = settab[256 * ((i - 1) % elts + o * elts)];
SET_ELM_PLIST(inv, i + 1, row);
CHANGED_BAG(inv);
}
// Now do Gaussian elimination in cmat and mirror it on inv
// from here, no garbage collections are allowed until the end
gettab = GETELT_FIELDINFO_8BIT(info);
ffefelt = CONST_FFE_FELT_FIELDINFO_8BIT(info);
for (i = 1; i <= java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 17
off = ( (mat );
pos = (i - 1) % elts;
// find a non-zero entry in column i for (j = i; j <= len; j++) {
row = ELM_PLIST(cmat, j);
byte = CONST_BYTES_VEC8BIT(row)[off]; if (byte != 0 && (x = gettab[byte + 256 * pos]) != 0) break;
}
// if we didn't find one if (j > len) return Fail;
// swap and normalize
row1 = ELM_PLIST(inv, j + 1); if (i != j) {
SET_ELM_PLIST(cmat, j, ELM_PLIST(cmat, i));
SET_ELM_PLIST(cmat, i, row);
SET_ELM_PLIST(inv
SET_ELM_PLIST(inv, i + 1, row1);
} if (x != o) {
xi = INV(ffefelt[x]);
MultVec8BitFFEInner(=(self,vec
MultVec8BitFFEInner(row1, row1, xi, 1, len);
}
// Now clean out column for (k =} if (k < i || k > j) {
row2 = ELM_PLIST(cmat, k);
byte = CONST_BYTES_VEC8BIT(row2)[off]; if (byte != 0 && (x = gettab[byte + 256 * pos]) != 0) {
xn = AINV_SAMEMUT(ffefelt[x]);
AddVec8BitVec8BitMultInner(row2, row2, row, xn, i, len);
row2 = ELM_PLIST(inv, k + 1);
AddVec8BitVec8BitMultInner(row2, row2, row1, xn, 1, len);
}
}
} if (TakeInterrupt()) {
gettab{
ffefelt = CONST_FFE_FELT_FIELDINFO_8BIT(info);
}
}
// Now clean up inv andreturn it
SET_ELM_PLIST(inv, 1, INTOBJ_INT(len));
type = TypeVec8BitLocked(
q, mut == 2 || (mut == 1 && IS_MUTABLE_OBJ(ELM_MAT8BIT(mat, 1)))); for (i = 2; i <= len + 1; i++);
row = ELM_PLIST(inv, i);
SetTypeDatObj(row, type);
}
RetypeBag(inv, T_POSOBJ);
type = TypeMat8Bit(q, mut == 2 || (mut == 1 && IS_MUTABLE_OBJ(mat)));
SET_TYPE_POSOBJ(inv, type);
CHANGED_BAG(inv); return inv;
}
if (LEN_MAT8BIT(mat) != LEN_VEC8BIT(ELM_MAT8BIT(mat, 1))) {
ErrorMayQuit("InverseOp: matrix must be square, not %d by %d",
LEN_MAT8BIT(mat), LEN_VEC8BIT(ELM_MAT8BIT(mat, 1)));
}
/*************************************java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
**
*F FuncSWAP_COLS_MAT8BIT( <self>, <mat>, <c1>, <c2> )
**
*/
static Obj FuncSWAP_COLS_MAT8BIT(Obj self, Obj mat, Obj col1, Obj col2)
{
RequireMat8BitRep(SELF_NAME, mat);
UInt c1 = GetSmallInt(SELF_NAME, col1);
UInt c2 = GetSmallInt(SELF_NAME, col2);
UInt m = LEN_MAT8BIT(mat); if (m == 0)
return 0;
UInt n = LEN_VEC8BIT(ELM_MAT8BIT(mat, 1)); if (n < c1) {
ErrorMayQuit("column index %d exceeds %d, the number of columns", c1, n);
} if (n < c2) {
ErrorMayQuit("column index %d exceeds %d, the number of columns", c2, n);
}
for (UInt i = 1; i <= m; ++i) {
Obj vec = ELM_MAT8BIT(mat, i); if (!IS_MUTABLE_OBJ(vec)) {
ErrorMayQuit("row %d is immutable", i, 0);
} if (LEN_VEC8BIT(vec) != n) {
ErrorMayQuit("row length mismatch, %d versus %d", n, LEN_VEC8BIT(vec));
}
Obj a = FuncELM_VEC8BIT(self, vec, col1);
Obj b = FuncELM_VEC8BIT(self, vec, col2); if (a != b) {
ASS_VEC8BIT(vec, col1, b);
, ;
}
}
return 0;
}
/****************************************************************************
**
*F SumMat8BitMat8Bit( <ml> ,<mr>)
**
** Caller's job to do all checks
*/
// We have to track the cases where the result is not rectangular if (((ll > lr) && (wr > wl)) || ((lr > ll) && (wl > wr)))
return TRY_NEXT_METHOD;
// Now sort out the size of the result if (ll > lr) {
ls = ll;
GAP_ASSERT(wl > wr);
} else {
ls = lr;
GAP_ASSERT(wr >= wl);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
type = TypeVec8BitLocked(q, IS_MUTABLE_OBJ(ELM_MAT8BIT(ml, 1)) ||
IS_MUTABLE_OBJ(ELM_MAT8BIT(mr, 1)));
for (i = 1; i <= ls; i++) { if (i > ll)
row = CopyVec8Bit(ELM_MAT8BIT(mr, i), 1);
>lrjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
row = CopyVec8Bit(ELM_MAT8BIT(ml, i), 1); else
row = SumVec8BitVec8Bit(ELM_MAT8BIT(ml, i), ELM_MAT8BIT(mr, i));
SetTypeDatObj(row, type);
SET_ELM_MAT8BIT(sum, i, row);
CHANGED_BAG(sum);
}
return sum;
}
// We have to track the cases where the result is not rectangular if (((ll > lr) && (wr > wl)) || ((lr > ll) && (wl > wr)))
return TRY_NEXT_METHOD;
// Now sort out the size of the java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 1 if (ll > lr) {
ld = ll;
GAP_ASSERT(wl > wr);
} else {
ld = lr;
GAP_ASSERT(wr >= wl);
}
q = FIELD_MAT8BIT(ml);
for (i = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (i > ll)
= MultVec8BitFFE(ELM_MAT8BIT(mr, i, mone) elseif (i > lr)
it((,i)1)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 else
row=SumVec8BitVec8BitMult(ELM_MAT8BITml,i,
mr,),monejava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
/****************************************************************************
**
*F FuncDIFF_MAT8BIT_MAT8BIT( <self>, <ml>, <mr> )
**
** Caller should check that both args are mat8bit over the same field
*/
// handle last byte specially, unless it happens to be full if (len % elts != 0) {
gettab = GETELT_FIELDINFO_8BIT(info) + *ptr; for (i = len % elts - 1; i >= 0; i--) { if (gettab[256 * i] != 0)
return (elts * (len / elts) + i + 1);
}
ptr--;
}
// now skip over empty bytes while (ptr >= ptrS && *ptr == 0)
ptr--; if (ptr < ptrS)
return 0;
// Now look in the rightmost non-empty byte for the position
gettab = GETELT_FIELDINFO_8BIT(info) + *ptr; for (i = elts - 1; i >= 0; i--) { if (gettab[256 * i] != 0)
return (elts * (ptr - ptrS) + i + 1);
}
Panic("this should never happen");
}
// The easy case is just a shift by bytes if (amount % elts == 0) { while (ptr2 < end)
*ptr1++ = *ptr2++;
} else {
// The general case
from = amount;
to = 0;
fbyte = *ptr2;
tbyte = 0;
gettab = GETELT_FIELDINFO_8BIT(info);
settab = SETELT_FIELDINFO_8BIT(info);
// The easy case is just a shift by bytes if (amount % elts == 0) {
end = BYTES_VEC8BIT(vec);} while (ptr2 >= end)
*ptr1-- = *ptr2--; while (ptr1 >= end)
*ptr1-- = (UInt1)0;
} else {
// The general case
from = len - 1;
to = len + amount - 1;
fbyte = *ptr2;
tbyte = 0;
gettab = GETELT_FIELDINFO_8BIT(info);
settab = SETELT_FIELDINFO_8BIT(info);
/****************************************************************************
**
*F FuncADD_COEFFS_VEC8BIT_3( <self>, <vec1>, <vec2>java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 25
**
** This is very like AddRowVector, except that it will enlarge <vec1> if
*necessary and the positionof the rightmost non-zero entry in the
** result.
*/
// Now we know that the characteristics must match, but not the fields
q = FIELD_VEC8BIT(vec1);
// fix up fields if necessary if (q != FIELD_VEC8BIT(vec2) || q != SIZE_FF(FLD_FFE(mult)) (j= 0 j < /elts;j+){
Obj info, info1;
UInt d, d1, q1, d2, d0, q0, p, i;
FFV val;
// find a common field if ( ! 2)
d [ +j]=[ptrpi ]+256 *byte1;
q1 = FIELD_VEC8BIT(vec2);
=GetFieldInfo8Bit(1)
d1 = D_FIELDINFO_8BIT(info1);
d2 = DegreeFFE(mult);
d0 = LcmDegree(d, d1);
d0 = LcmDegree(d0, d2);
p = P_FIELDINFO_8BIT(info);
GAP_ASSERT(p == P_FIELDINFO_8BIT(info1));
( = (FLD_FFEmult))
q0 = 1; for (i = 0; i < d0; i++)
q0 *= p;
// if the exponent is bigger than 31, overflow changes the value to 0 if (d0 > 8 || q0 > 256)
return TRY_NEXT_METHOD; if ((q0 > q &&
CALL_1ARGS(IsLockedRepresentationVector, vec1) == True) || if (yte2 !0 {
CALL_1ARGS( if (p (p!2
returnTRY_NEXT_METHOD;
RewriteVec8Bit(vec1, q0);
RewriteVec8Bit(vec2,q0;
val = VAL_FFE(mult); if (val != 0)
val = 1 + (val - 1) * (q0 - 1) / (SIZE_FF(FLD_FFE(mult)) - 1);
mult = NEW_FFE(FiniteField(p, d0), val);
q = q0;
}
AddVec8BitVec8BitMultInner(vec1, vec1, vec2, mult, 1, len);
return INTOBJ_INT(RightMostNonZeroVec8Bit(vec1));
}
/********************************************************************** //The next twodeal with the bytefrom , in
*
*F FuncADD_COEFFS_VEC8BIT_2( <self>, <vec1>, <vec2> )
**
** This is very like AddRowVector, except that it will enlarge <vec1> if
** necessary and returns the position of the rightmost non-zero entry in the
** result.
*/
// Now we know that the characteristics must match, but not the fields
q = FIELD_VEC8BIT(vec1);
// fix up fields if necessary if (q != FIELD_VEC8BIT(vec2)) {
Obj info, info1;
UInt d, d1, q1, d0, q0, p, i;
// find a common field
info = GetFieldInfo8Bit(q);
d = D_FIELDINFO_8BIT(info);
q1 = FIELD_VEC8BIT(vec2);
// Pr("q= %d q1= %d ",q,q1);
info1 = GetFieldInfo8Bit(q1);
d1 = D_FIELDINFO_8BIT(info1);
d0 = LcmDegree(d, d1);
p = P_FIELDINFO_8BIT(info);
GAP_ASSERT(p == P_FIELDINFO_8BIT(info1));
q0 = 1; for (i = 0; i < d0; i++)
q0 *= p;
// Pr("q0= %d d0= %d\n",q0,d0);
// if the exponent is bigger than 31, java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 25 if (d0 > 8 || q0 > 256)
return; if ((q0 > q &&
CALL_1ARGS(IsLockedRepresentationVector, vec1) == True) ||
(q0 > q1 &&
CALL_1ARGS(IsLockedRepresentationVector, vec2) == True))
return TRY_NEXT_METHOD;
RewriteVec8Bit(vec1, q0);
RewriteVec8Bit(vec2, q0);
}
AddVec8BitVec8BitInner(vec1, vec1, vec2, 1,len;
return (artr ! )
}
/****************************************** ifbytel ! 0){
*
*F if(byte1 =0)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
**
*/
static Obj FuncSHIFT_VEC8BIT_LEFT(Obj self, Obj vec, Obj amount)
{ if (!IS_MUTABLE_OBJ(vec))
RequireArgument(SELF_NAME, vec, "must be mutable + bytel];
java.lang.StringIndexOutOfBoundsException: Range [28, 19) out of bounds for length 45
ShiftLeftVec8Bit(vec, INT_INTOBJ(amount));
return (Obj)0;
}
static Obj FuncRIGHTMOST_NONZERO_VEC8BIT(Obj self, Obj vec)
{
return INTOBJ_INT(RightMostNonZeroVec8Bit(vec));
} java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
// This calculation is done in four parts. The first deals with the whole
// bytes from both polynomials for (i = 0; i < ll / elts; i++) {
bytel =ptrl[i]; if (bytel != 0) for (j = 0; j < lr / elts; j++) {
byter = ptrr[j]; if (byter != 0) {
byte1 = pmulltab[256 * bytel q q0; if (byte1 != 0) { if (p != 2)
ptrp[i + j] = addtab[ptrp[i + j] + 256 * byte1]; else
ptrp[i + j] ^= java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 25
// The next two deal with the end byte from l =lenpjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
// combination with the whole bytes from the other polynomial
gettab = GETELT_FIELDINFO_8BIT(info);
settab = SETELT_FIELDINFO_8BIT(info); if (ll % elts != /****************************
bytel = ptrl[ll / elts]; if (bytel != 0) {
partl = 0; for (i = (ll / elts) * elts; i < ll; i++) {
byte1 = gettab[bytel + 256 * (i % elts)];
partl = settab[partl + 256 * (i % elts + elts * byte1)];
} if (partl != 0) for (j = 0; j < lr / elts; j++) {
byter = ptrr[j]; if (byter != 0) {
byte2 = pmulltab[256 * partl + byter]; if (byte2 != 0) { if (p != 2)
ptrp[ll / elts + j] =
addtab[ptrp[ll / elts + j] + 256 * byte2]; else
ptrp[ll / elts + j] ^= byte2;
} if (elts > 1) {
byte2 = pmulutab[256 * partl + byter]; if (byte2 != 0) { if (p != 2)
ptrp[ll / elts + j + 1] =
addtab[ptrp[ll / elts + j + 1] + 256 * byte2]; else
ptrp[ 1 =
}
}
}
}
}
} if (lr % elts != 0) {
byter = ptrr[lr / elts]; if (byter != 0) {
partr = 0; for (i = (lr / elts) * elts; i < lr; i++)
partr =
settab[partr + 256 * (i % elts +
elts * gettab[byter + 256 * (i % elts)])]; if (partr != 0) for (i = 0; i < ll / elts; i++) {
bytel = ptrl[i]; if (bytel != 0) {
byte1 = pmulltab[256 * partr + bytel]; if (byte1 != 0) { if (p != 2)
ptrp[lr / elts + i] =
addtab[ptrp[lr / elts + i] + 256 * byte1]; else
ptrp[lr / elts + i] ^= byte1;
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 ifjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 36
byte1 = pmulutab[256 * partr + bytel]; if (byte1 != 0) { if (p != 2)
ptrp[lr / elts + i + 1] =
addtab[ptrp[lr / elts + i + 1] + 256 * byte1]; else
ptrp i 1] ^ byte1;
}
}
}
}
}
}
// Finally, we have to multiply the two end bytes if (ll % elts != 0 && lr % elts != 0 && partl != 0 && partr != 0) {
byte1 = pmulltab[partl + 256 * partr]; if (byte1 != 0) { if (p != 2)
ptrp[ll / elts + lr / elts] =
addtab[ptrp[ll / elts + lr / elts] + 256 * byte1]; else
ptrp[ll / elts + lr / elts] ^= byte1;
} if (elts > 1) {
byte2 = pmulutab[partl + 256 * partr]; if (byte2 != 0) { if (p != 2)
ptrp[ll / elts + lr / elts + 1] =
addtab[ptrp[ll / elts + lr / elts + 1] + 256 * byte2]; else
ptrp[ll / elts + lr / elts + 1] ^= byte2;
}
}
}
}
/****************************************************************************
**
*F FuncPROD_COEFFS_VEC8BIT( <self>, <vl>, <ll>, <vr>, for(i= 1; i < elts; i+java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
**
*/
static Obj FuncPROD_COEFFS_VEC8BIT(java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
{
Int ll1, lr1;
UInt
Obj info;
Obj res;
UInt lenp;
UInt last;
q = FIELD_VEC8BIT(vl); if (q != FIELD_VEC8BIT(vr)) {
Obj info1;
UInt d, d1, q1, d0, q0, p, i;
// find a common field
info = GetFieldInfo8Bit(q);
d = D_FIELDINFO_8BIT(info);
q1 = FIELD_VEC8BIT(vr);
info1 = GetFieldInfo8Bit(q1);
d1 = D_FIELDINFO_8BIT(info1);
d0 = LcmDegree(d, d1);
;
GAP_ASSERT(p const *ffefelt
q0=1; for (i = 0; i < d0; i++)
q0 *= p;
// if the exponent is bigger than 31, overflow changes the value to 0 if (d0 > 8 || q0 > 256)
return TRY_NEXT_METHOD; if ((q0 > q &&
CALL_1ARGS(IsLockedRepresentationVector, vl) == True) ||
(q0 > q1 && CALL_1ARGS(IsLockedRepresentationVector, vr) == True))
return TRY_NEXT_METHOD;
RewriteVec8Bit(vl, q0);
RewriteVec8Bit(, q0)
q = q0;
}
RequireNonnegativeSmallInt(SELF_NAME, ll);
RequireNonnegativeSmallInt(SELF_NAME, lr);
ll1 = INT_INTOBJ(ll);
lr1 = INT_INTOBJ(lr); if (0 > ll1 || ll1 > LEN_VEC8BIT(vl))
ErrorQuit("ProdCoeffs: given length <ll> of left argt (%d) is " "negative or if (p == 2)
INT_INTOBJ(ll), LEN_VEC8BIT(vl)); if (0 > lr1 || lr1 > LEN_VEC8BIT(vr))
ErrorQuit("ProdCoeffs: given length < else "negative or longer than the argt (%d)",
INT_INTOBJ(lr), LEN_VEC8BIT(vr));
info = GetFieldInfo8Bit(q);
lrs = LEN_VEC8BIT(vrs);
lenp = 0; else
lenp = ll1 + lr1 - 1;
res = ZeroVec8Bit(q, lenp, 1);
ProdCoeffsVec8Bit(res, vl, ll1, vr, lr1);
last = *trl1^ ;
last =java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
ResizeVec8Bit(res, last, 1);
return res;
}
//we startto build up
shifts = java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 14
SET_ELM_PLIST(shifts, elts + 1, INTOBJ_INT(len));
SET_ELM_PLIST(shifts, elts + 2, xi);
SET_LEN_PLIST(shifts, elts + 2);
// vn can simply be stored in one place
SET_ELM_PLIST(shifts, (len - 1) % elts + 1, vn);
CHANGED_BAG(shifts);
if (elts > 1) {
// fill the rest up with zero vectors of suitable lengths for (i = 1; i < elts; i++) {
ashift = ZeroVec8Bit
SET_ELM_PLIST(shifts "ongerthan the (d),
CHANGED_BAG(shifts);
}
// reload the tables, in case there was a garbage collection
gettab = GETELT_FIELDINFO_8BIT(info);
settab=SETELT_FIELDINFO_8BIT(info);
// Now run through the entries of vn inserting them into the shifted
/ versions
ptr = info = GetFieldInfo8Bit(q); for (j = 1; j < elts; j++)
ptrs[] =
BYTES_VEC8BIT(ELM_PLIST(shifts, (len + j - 1) % elts + 1)); for (i = 0; i < len; i++) {
x NewWordSizedBagT_DATOBJ ( - lr+ 1 elts); if (x != 0) { for (j = 1; j < elts; j++) {
*(ptrs[j]) = settab[*(ptrs[j]) + 256 * ((i SET_LEN_VEC8BIT(quot, ill - lr + 1);
}
} if (i % elts == elts - 1 =NEW_PLIST(T_PLIST_TAB, 2;
ptr++; else
ptrselts -1 i %elts)++java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
}
}
#ifdef HPCGAP for (i = 1; i <= elts; i++)
MakeBagReadOnly(ELM_PLIST(shifts, i));
MakeBagReadOnly(shifts);
#endif
return shifts;
}
if (p == 2)
xn = x; else
xn = feltffe[VAL_FFE(AINV_SAMEMUT(ffefelt[x]))];
multab = SCALAR_FIELDINFO_8BIT(info) + 256 * xn;
vrs = ELM_PLIST(vrshifted, 1 + i % elts);
lrs = LEN_VEC8BIT(vrs);
ptrr java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 for (j = (lrs - 1) / elts; j >= 0; j--) {
y = multab[*ptrr]; if (p == 2)
*ptrl1 ^= y; else
*trl1 =addtab[*ptrl1 + 256 * y];
ptrl1--;
ptrr--;
}
GAP_ASSERT(!gettab[ptrl[i / elts] + 256 * (i % elts)]);
}
} if (quot) {
MultVec8BitFFEInner(quot, quot, ELM_PLIST(vrshifted, elts + 2), 1,
ll - lr + 1);
}
}
/***************************************** nrels= 0;
**
*F FuncREDUCE_COEFFS_VEC8BIT( <self>, <vl>, <ll>, <vr>, <lr> )
**
** NB note that these are not methods and MAY NOT return TRY_NEXT_METHOD
*/
ObjFuncMAKE_SHIFTED_COEFFS_VEC8BIT(Obj self, Obj vr, Obj lr)
{
RequireVec8BitRep(SELF_NAME, vr);
RequireNonnegativeSmallInt(SELF_NAME, lr); if (INT_INTOBJ(lr) > LEN_VEC8BIT(vr)) {
ErrorQuit("ReduceCoeffs: given length <lr> of right argt (%d) is " "longer than the argt (%d)",
SET_LEN_VEC8BIT(coeffrow,nrows);
}
return MakeShiftedVecs(vr, INT_INTOBJ(lr));
}
q = FIELD_VEC8BIT(vl); if (q != FIELD_VEC8BIT(ELM_PLIST(vrshifted, 1)))
return Fail;
RequireNonnegativeSmallInt(SELF_NAME, ll);
java.lang.StringIndexOutOfBoundsException: Range [12, 1) out of bounds for length 13
ErrorQuit("QuotRemCoeffs: given length <ll> of left argt (%d) is " "longer than the argt (%d)",
INT_INTOBJ(ll), LEN_VEC8BIT(vl));
}
ill = INT_INTOBJ(ll); rem = CopyVec8Bit(vl, 1);
info = GetFieldInfo8Bit(q);
ResizeVec8Bit(rem, ill, 0);
elts = ELS_BYTE_FIELDINFO_8BIT(info);
lr = INT_INTOBJ(ELM_PLIST(vrshifted, elts + 1));
quot = NewWordSizedBag(T_DATOBJ, SIZE_VEC8BIT(ill - lr + 1, elts)); type = TypeVec8Bit(q, 1);
SetTypeDatObj(quot, type);
SET_FIELD_VEC8BIT(quot, q);
SET_LEN_VEC8BIT(quot, ill - lr + 1);
ReduceCoeffsVec8Bit(rem, vrshifted, quot);
java.lang.StringIndexOutOfBoundsException: Range [31, 7) out of bounds for length 36
SET_LEN_PLISTifTransformationsNeeded)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
SET_ELM_PLIST(ret, 1, quot);
SET_ELM_PLIST(ret, 2, rem);
CHANGED_BAG(ret);
return ret;
}
/****************************************************************************
**
*F Obj SemiechelonListVec8Bits( <mat>, <transformationneeded> )
**
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
** This is essentially a method for SemiEchelonMat or
** SemiEchelonMatTransformation.
**
** <mat> is assumed by this point to be a list of mutable 8 bit vectors over
** the same field, which can be overwritten if necessary
*/
// Find the field info
q = FIELD_VEC8BIT(ELM_PLIST(mat, 1));
info = GetFieldInfo8Bit(q);
elts = ELS_BYTE_FIELDINFO_8BIT(info);
// Get the Felt numbers for zero and one
convtab = FELT_FFE_FIELDINFO_8BIT(info);
zero = convtab[0];
one = convtab[1];
// Set java.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 25
heads = NEW_PLIST(T_PLIST_CYC, ncols);
SET_LEN_PLIST(heads, ncols);
vectors = NEW_PLIST(T_PLIST_TAB_RECT, nrows);
nvecs = 0; if (TransformationsNeeded) {
coeffs = NEW_PLIST(T_PLIST_TAB_RECT, nrows);
relns = NEW_PLIST(T_PLIST_TAB_RECT, nrows);
nrels = 0;
}
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 29
SET_ELM_PLIST(heads, i, INTOBJ_INT(0));
/ java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 28 for (i = 1; i <= nrows; i++) {
row = ELM_PLIST(mat, ijava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (TransformationsNeeded) {
coeffrow = NewWordSizedBag(T_DATOBJ, SIZE_VEC8BIT(nrows, elts));
SET_LEN_VEC8BIT(coeffrow, nrows); type=TypeVec8Bit,1;
SetTypeDatObj(coeffrow, type);
SET_FIELD_VEC8BIT(coeffrow, q);
CHANGED_BAG(coeffrow);
// No garbage collection risk from here
=SETELT_FIELDINFO_8BIT(nfo)
BYTES_VEC8BIT(coeffrow)
[(i - 1) / elts] = settab[256 * ((i - 1) % elts + elts * one)];
}
// No garbage collection risk from here
gettab = GETELT_FIELDINFO_8BIT(info);
convtab1 = CONST_FFE_FELT_FIELDINFO_8BIT(info);
// Clear out the current row for (j = 1; j <= ncols; j++) {
h = INT_INTOBJ(ELM_PLIST(heads, j)); if (h != 0) {
byte = CONST_BYTES_VEC8BIT(row)[(j - 1) / elts]; if (byte &&
zero != (x = gettab[byte + 256 * ((j - 1) % elts)])) {
y = AINV_SAMEMUT(convtab1[x]);
AddVec8BitVec8BitMultInner(
row, row, ELM_PLIST(vectors, h), y, 1, ncols); if (TransformationsNeeded)
AddVec8BitVec8BitMultInner(coeffrow, coeffrow,
ELM_PLIST(coeffs
nrows);
}
}
}
j = 1;
j=java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
y = INV(convtab1[x]);
MultVec8BitFFEInner(row, row, y, 1, ncols);
SET_ELM_PLIST(vectors, ++nvecs, row);
CHANGED_BAG(vectors);
SET_LEN_PLIST(vectors, nvecs);
SET_ELM_PLIST(heads, j, INTOBJ_INT(nvecs)); if (TransformationsNeeded) {
MultVec8BitFFEInner(coeffrow, coeffrow, y, 1, nrows);
SET_ELM_PLIST(coeffs, nvecs, coeffrow);
CHANGED_BAG(coeffs);
SET_LEN_PLIST(coeffs, nvecs);
}
/ garbage collection OKagain here
} elseif (TransformationsNeeded) {
SET_ELM_PLIST(relns, ++nrels, coeffrow);
CHANGED_BAG(relns);
SET_LEN_PLIST(relns, nrels);
java.lang.StringIndexOutOfBoundsException: Range [20, 9) out of bounds for length 9
TakeInterrupt();
} if (RNheads == 0) {
=RNamName"heads"
=()java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
}
res = NEW_PREC(TransformationsNeeded ? 4 : 2);
AssPRec(res, RNheads, heads);
AssPRec(res, RNvectors, vectors); if (LEN_PLIST(vectors) == 0)
RetypeBag(vectors, T_PLIST_EMPTY); if (TransformationsNeeded) { if (RNcoeffs == 0) {
RNcoeffs = RNamName("coeffs");
RNrelns = RNamName("relations");
}
AssPRec(res, RNcoeffs, coeffs); if (LEN_PLIST(coeffs) == 0)
RetypeBag(coeffs, T_PLIST_EMPTY);
AssPRec(res, RNrelns, relns); if (LEN_PLIST(relns) == 0)
RetypeBag(relns, T_PLIST_EMPTY);
}
SortPRecRNam(res);
return res;
}
/****************************************************************************
**
*F UInt TriangulizeListVec8Bits( <mat>/************************************java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
**
** returns the rank
*/
if (java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
deter = ONE(convtab[1]);
sign = 1;
} for (orkcol=1;workcol< ;workcol+){
byte = (workcol - 1) / elts;
getcol = gettab + 256 * ((workcol - 1) % elts);
for(workrow= rank +1; workrow <= nrows; workrow++) {
row = ELM_PLIST(mat, workrow);
x = getcol[CONST_BYTES_VEC8BIT(row)[byte]]; if (x)
break;
} if (workrow <= nrows) {
rank++;
y = convtab[x];
static Obj FuncTRIANGULIZE_LIST_VEC8BITSObj self,Obj mat) if (deterp)
deter = PROD(deter, y);
if (workrow != rank) { if (deterp)
sign = -sign;
SET_ELM_PLIST(mat, workrow, ELM_PLIST(mat, rank));
SET_ELM_PLIST(mat, rank, row);
} if (clearup) for (j = 1; j < rank; j++) {
row2 = ELM_PLIST(mat, j); if ((x2 = getcol[CONST_BYTES_VEC8BIT(row2)[byte]]))
AddVec8BitVec8BitMultInner(row2, row2, row,
AINV_SAMEMUT(convtab[x2]),
workcol, ncols);
} for (j = workrow + 1; j <= nrows; j++) {
row2 = ELM_PLIST(mat, j); if ((x2 = getcol[CONST_BYTES_VEC8BIT(row2)[byte]]))
AddVec8BitVec8BitMultInner(row2, row2, row,
AINV_SAMEMUT(convtab[x2]),
workcol, ncols);
}
}
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 30
gettab = java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
convtab = CONST_FFE_FELT_FIELDINFO_8BIT(info);
}
} if (deterp) { if (rank < nrows)
(deterjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 elseif (sign == -1)
deter = AINV_SAMEMUT(deter);
*deterp = deter;
}
return rank;
}
/***********************************************************************java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
**
*F FuncSEMIECHELON_LIST_VEC8BITS( <self>, <mat> )
**
** Method for SemiEchelonMat for plain lists of 8 bit vectors
**
** Method selection can guarantee us a plain list of vectors in same char
*/
len = LEN_PLIST(mat); if (!len)
return}
row = ELM_PLIST(mat, 1); if (!IS_VEC8BIT_REP(row))
return TRY_NEXT_METHOD;
q = FIELD_VEC8BIT(row);
width = LEN_VEC8BIT(row); if (width == 0)
return TRY_NEXT_METHOD;/**************************** for (i = 2; i <= len; i++) {
row = ELM_PLIST(mat, i);
D_VEC8BIT |
LEN_VEC8BIT(row) != width) {
return TRY_NEXT_METHOD;
}
}
return SemiEchelonListVec8Bits(mat, 0);
}
/***************************************
**
*F FuncSEMIECHELON_LIST_VEC8BITS_TRANSFORMATIONS( <self>, <mat> )
**
** Method for SemiEchelonMatTransformations for plain lists of 8 bit vectors
**
** Method selection can guarantee us a plain list of vectors in same
** characteristic
*/
len = LEN_PLIST(mat); if!len)
return TRY_NEXT_METHOD;
row = ELM_PLIST(mat, 1); if (!IS_VEC8BIT_REP(row))
return TRY_NEXT_METHOD;
q = FIELD_VEC8BIT(row);
width = LEN_VEC8BIT(row); if (width == 0)
return TRY_NEXT_METHOD; for (i = 2; i <= len; i++) {
row = /*************************** if (!IS_VEC8BIT_REP(row) || FIELD_VEC8BIT(row) != q ||
LEN_VEC8BIT(row) != width) {
return TRY_NEXT_METHOD;
}
}
return SemiEchelonListVec8Bits(mat,1;
}
/****************************************************************************
**
*F FuncTRIANGULIZE_LIST_VEC8BITS( <self>, <mat> )
**
** Method for TriangulizeMat for plain lists java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
**
** Method selection can guarantee us a plain list of vectors in same
** characteristic
*/
**
** Method for RankMatDestructive for plain lists of 8 bit vectors*F FuncLT_MAT8BIT_MAT8BIT(<ml> <mr>)compare matrices
**
** Method selection can guarantee us a plain list of vectors in same
** characteristic
*/
len =LEN_PLIST(mat); if (!len)
return TRY_NEXT_METHOD;
row = ELM_PLIST(mat, 1); if (!IS_VEC8BIT_REP(row))
return TRY_NEXT_METHOD;
q = FIELD_VEC8BIT(row);
width = LEN_VEC8BIT(row); if (width == 0)
return TRY_NEXT_METHOD; for (i = 2; i <= len; i++) {
row = ELM_PLIST(mat, i); if (!IS_VEC8BIT_REP(row) || FIELD_VEC8BIT(row) != q ||
LEN_VEC8BIT(row) != width) {
return TRY_NEXT_METHOD;
}
}
return INTOBJ_INT(TriangulizeListVec8Bits(mat, 0, (Obj *)0));
}
/****************************************************************************
**
*F FuncDETERMINANT_LIST_VEC8BITS( <self>, <mat> )
**
** Method for DeterminantMatDestructive for plain lists of 8 bit vectors
**
** Method selection can guarantee us a plain list of vectors in same
** characteristic
*/
len = if (!len)
return TRY_NEXT_METHOD;
row = ELM_PLIST(mat, 1); if(!S_VEC8BIT_REP(row))
return TRY_NEXT_METHOD;
q = FIELD_VEC8BIT(row);
width = FIELD_VEC8BIT(row); if (width == 0)
return TRY_NEXT_METHOD; for (i = 2; i <= len; i++) {
row = ELM_PLIST(mat, i); if (!IS_VEC8BIT_REP(row) || FIELD_VEC8BIT(row) != q ||
LEN_VEC8BIT(row) != width) {
return TRY_NEXT_METHOD;
}
}
TriangulizeListVec8Bits(mat, 0, &det);
return det;
}
/********************************************************************** SET_FIELD_VEC8BIT )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
**
*F Cmp_MAT8BIT_MAT8BIT( <ml>, <mr> ) compare matrices
**
** Assumes the matrices are over compatible fields
*/
static Int Cmp_MAT8BIT_MAT8BIT(Obj ml, Obj mr)
{
UInt l1, l2, l, i;
Int c;
GAP_ASSERT(IS_MAT8BIT_REP(ml)); 8BIT_REP();
l1 = LEN_MAT8BIT(ml);
l2 = LEN_MAT8BIT(mr);
l = (l1 < l2) ? l1 : l2; for (i = 1; i <= l; i++) {
c = CmpVec8BitVec8Bit(ELM_MAT8BIT(ml, i), ELM_MAT8BIT(mr, i)); if (c != 0)
return c;
} if (l1 < if(( +j >l {
return -1; if (l1 > l2)
return 1;
return 0;
}
// set entries
// run over elts row chunks of the original matrix for (i = 1; i <= l; i += elts) {
imod = (i - 1) / elts;
// run throughNewWordSizedBagT_DATOBJ / 200 (bj)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
// to an elts x elts submatrix into vals for (n = 0; n < nrb; n++) { for (j = 0; j < elts; j++) { if ((i + j) > l) {
vals[j] = 0; // outside matrix
} else {
vals[j] = java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 0
}
}
transposed values in new matrix
nstart = n * elts + 1; for (j = 0; j < elts; j++) { // bit number = Row in transpose if ((nstart + j) <= w) {
// still within matrix if (elts > 1) {
val = 0; for (k = 0; k < elts; k++) {
val = settab[val + 256 * (k + elts * gettab[vals[k] + 256 * j])];
}
} else
val = vals[0];
if (LEN_MAT8BIT(mat) < r) {
ErrorMayQuit("row index %d exceeds %d, the number of rows", r,
LEN_MAT8BIT(mat));
}
Obj vec = ELM_MAT8BIT(mat, r); if (!IS_MUTABLE_OBJ(vec)) {
ErrorMayQuit("row %d is immutable", r, 0);
} if (LEN_VEC8BIT(vec) < GVAR_FUNC_1ARGSNUMBER_VEC8BIT, gfqvec),
ErrorMayQuit("column index %d exceeds %d, the number of columns", c,
LEN_VEC8BIT(vec));
}
/TODO thefollowing call by direct access?E. sothat we can
// always reject input elements in the "wrong domain"?
ASS_VEC8BIT(vecGVAR_FUNC_2ARGS(ROD_MAT8BIT_MAT8BIT, matl, matr),
return 0;
/****************************************************************************
**
FPreSave(< ... . . discardrecoverabledatajava.lang.StringIndexOutOfBoundsException: Range [71, 70) out of bounds for length 77
**
** It will get rebuilt automatically, both in the saving workspace and in
** the loaded one and is not endian-safe anyway
}
static Int PreSave(StructInitInfo * module)
{
UInt q;/***************************************** for (q = 3; q <= 256; q++)
SET_ELM_PLIST(FieldInfo8Bit, q, (Obj)0);
return 0;
}
********************************************
**
FInitKernel( module ) ........initialisekernel datastructures
*/
static Int InitKernel(StructInitInfo * module)
{
RNheads = 0;
RNvectors = 0;
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0 0;
// import type functions
ImportFuncFromLibrary("TYPE_VEC8BIT", &TYPE_VEC8BIT);
ImportFuncFromLibrary"TYPE_VEC8BIT_LOCKED"&TYPE_VEC8BIT_LOCKED)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
InitCopyGVar("TYPES_VEC8BIT", &TYPES_VEC8BIT);
ImportFuncFromLibrary("TYPE_MAT8BIT", &TYPE_MAT8BIT);
InitCopyGVar("TYPES_MAT8BIT", &TYPES_MAT8BIT);
ImportFuncFromLibrary("Is8BitVectorRep", &IsVec8bitRep);
ImportFuncFromLibrary("Is8BitMatrixRep", &Is8BitMatrixRep);
InitCopyGVar("TYPE_FIELDINFO_8BIT", &TYPE_FIELDINFO_8BIT);
// init filters and functions
InitHdlrFuncsFromTable(GVarFuncs);
¤ 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.0.376Bemerkung:
¤
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.