/**************************************************************************** ** ** This file is part of GAP, a system for computational discrete algebra. ** ** Copyright of GAP belongs to its developers, whose names are too numerous ** to list here. Please refer to the COPYRIGHT file for details. ** ** SPDX-License-Identifier: GPL-2.0-or-later
*/
/**************************************************************************** ** *F DepthOfPcElement( <self>, <pcgs>, <w> )
*/ template <typename UIntN> static Obj DepthOfPcElement(Obj self, Obj pcgs, Obj w)
{ Int ebits; // number of bits in the exponent
// if the pc element is the identity we have to ask the pcgs if ( NPAIRS_WORD(w) == 0 ) return INTOBJ_INT( LEN_LIST(pcgs) + 1 );
// otherwise it is the generators number of the first syllable else {
ebits = EBITS_WORD(w); return INTOBJ_INT((CONST_DATA_WORD(w)[0] >> ebits)+1);
}
}
/**************************************************************************** ** *F ExponentOfPcElement( <self>, <pcgs>, <w>, <pos> )
*/ template <typename UIntN> static Obj ExponentOfPcElement(Obj self, Obj pcgs, Obj w, Obj pos)
{
UInt expm; // signed exponent mask
UInt exps; // sign exponent mask
UInt ebits; // number of exponent bits
UInt npos; // the wanted generator number
UInt num; // number of syllables in <w> const UIntN * ptr; // pointer to the syllables of <w>
UInt i; // loop
UInt gen; // current generator number
// all exponents are zero if the pc element if the identity
num = NPAIRS_WORD(w); if ( num == 0 ) return INTOBJ_INT(0);
// otherwise find the syllable belonging to <exp> else {
ebits = EBITS_WORD(w);
exps = (UInt)1 << (ebits-1);
expm = exps - 1;
npos = INT_INTOBJ(pos);
ptr = CONST_DATA_WORD(w); for ( i = 1; i <= num; i++, ptr++ ) {
gen = ((*ptr) >> ebits) + 1; if ( gen == npos ) { if ( (*ptr) & exps ) return INTOBJ_INT(((*ptr)&expm)-exps); else return INTOBJ_INT((*ptr)&expm);
} if ( npos < gen ) return INTOBJ_INT(0);
} return INTOBJ_INT(0);
}
}
// the leading exponent is zero iff the pc element if the identity if ( NPAIRS_WORD(w) == 0 ) return Fail;
// otherwise it is the exponent of the first syllable else {
exps = (UInt)1 << (EBITS_WORD(w)-1);
expm = exps - 1;
p = CONST_DATA_WORD(w)[0]; if ( p & exps ) return INTOBJ_INT((p&expm)-exps); else return INTOBJ_INT(p&expm);
}
}
/**************************************************************************** ** *F ExponentsOfPcElement( <self>, <pcgs>, <w> )
*/ template <typename UIntN> static Obj ExponentsOfPcElement(Obj self, Obj pcgs, Obj w)
{
UInt len; // length of pcgs
Obj el; // exponents list
UInt le;
UInt indx;
UInt expm; // signed exponent mask
UInt exps; // sign exponent mask
UInt ebits; // number of exponent bits
UInt num; // number of syllables in <w> const UIntN * ptr; // pointer to the syllables of <w>
UInt i,j; // loop
UInt gen; // current generator number
ptr = CONST_DATA_WORD(w); for ( i = 1; i <= num; i++, ptr++ ) {
gen = ((*ptr) >> ebits) + 1; for (j=le; j< gen;j++) { // zero out intermediate entries
SET_ELM_PLIST(el,indx,INTOBJ_INT(0));
indx++;
}
¤ 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.15Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.