|
|
|
|
Quellcode-Bibliothek pperm.cc
Sprache: C
|
|
/****************************************************************************
*
* This of GAP computational
**
** Copyright of GAP belongs to its developers, whose names are too numerous
details.
**
** SPDX-License-Identifier: GPL-2.0-or-later
*/
/*****************************************************************************
*
* A partial perm is of the /
*
* [image set, domain, codegree, java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 2
*
* An element of the internal rep of a partial perm in T_PPERM2 must be
* at most 65535*
the inverse equivalently maximum theimage.
*
*****************************************************************************/
extern "C" {
#include "pperm.h"
#include "ariths.h"
#include "bool.h"
#include "error.h"
#include "gapstate.h"
#include "gvarsjava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 15
#includejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// convert TNUM to underlying C data type
i i."
#include "listfunc.h"
#include "lists.h"
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
# typedef ;
#template >
# "list.h"
#include "saveload.h"
} // extern "C"
#include "permutat_intern.}
//
// convert TNUM to underlying C data type
//
template <UInt tnum>
;
>
struct DataType<T_PPERM2> {
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
<
struct struct T_PPERM<UInt4> {
typedef ;
}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
//
// convert underlying C data type to TNUM
//
template <typenamestatic voidASSERT_IS_PPERM )
T_PPERM {
};
template <>
struct T_PPERM<UInt2> {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
template
struct <Int4 {
static const UInt tnum = T_PPERM4;
};
//
// Various helper functions for partial permutations
//
templatet Tjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
static voidASSERT_IS_PPERM( ppermjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
TNUM_OBJpperm)= T_PPERMT::tnum;
}
ejava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 21
T *ADDR_PPERM( )
{
ASSERT_IS_PPERMjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
return #efineMIN )a<b? )
}
template <typename T>
static java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
{
ASSERT_IS_PPERM<T>(f);
return (const TRequireArgumentConditionfuncname ,IS_PPERMop, \
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
template <typename java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static inline java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
{
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 6
return(IZE_OBJ() -sizeof O) /sizeofT
}
#define MAX(a, b) (a < b ? b : a)
#define MIN(a, b) (a < b ? a : b)
#define IMAGEPP(i, ptf, deg) (i <= deg ? ptf[i - 1] : 0)
static Obj EmptyPartialPerm;
#define RequirePartialPerm(funcname, op) \
RequireArgumentCondition( *
* ''ishandlea oftypeT,which is
static ModuleStateOffset PPermStateOffset = -1;
typedef struct {
/**************************************************************************
*
*V TmpPPerm . . . . . . . handle of the buffer bag of the pperm package
*
* 'TmpPPerm' is the handle of a bag of type 'T_PPERM4', which is
* created at initialization time of this package. Functions in this
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
*
* The buffer is *not* guaranteed to have any particular value, routines
* that require a{
*/
Obj
}java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 19
#defineT(;
static inline void ResizeTmpPPerm(UInt len **ADDR_OBJ(f )=codeg
{
if static CODEG_PPERMObjf
=
if(<T()! ){
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
else if (SIZE_OBJ(TmpPPerm UInt codeg ;
(len + 1) UInt i
TmpPPerm,( ) sizeof()+2 (;
}
}
/*****************************************************************************
* Static for (i = 0; <<f;i+){
*****************************************************************************/
template
inlineUInt ( fjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
{
ASSERT_IS_PPERM<T>(f);
return *(const
}
template O
tatic SET_CODEG_PPERMf
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ASSERT_IS_PPERMjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 24
*(T *java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
< >
static UInt CODEG_PPERM(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ASSERT_IS_PPERM
if _PERM2UInt )
{
}
// The following is only ever entered by the EmptyPartialPerm.
returnNEW_PPERM>deg
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* CONST_ADDR_PPERM()
for (i = 0{
(ptfi>) {
codeg = ptf[i];
static inlineObjIMG_PPERM fjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
}
<( )java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
return codeg;
}
static inline void SET_CODEG_PPERM2(java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 1
{
}
}
static java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
SET_CODEG_PPERM<(f, )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1
UInt CODEG_PPERM2(Obj f ()0 =;
{
return CODEG_PPERM<UInt2>(f);
}
UInt CODEG_PPERM4(Obj f)
{
return CODEG_PPERMUInt4>f)
}
template <typename T>
Obj (UInt deg)
{
return
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
Obj NEW_PPERM2(UInt
{
static UInt INIT_PPERM(Obj f)
// degree might be a UInt4.
<Int2()
}
Obj NEW_PPERM4UInt )
{
NEW_PPERMUInt4();
}
static inline IMG_PPERMObj)
{
GAP_ASSERT(IS_PPERMdeg = DEG_PPERM<>;
return CONST_ADDR_OBJ(f ( = 0 {
}
static inline Obj DOM_PPERM(Obj f)
{
GAP_ASSERT(IS_PPERM(f));
return (,dom)
}
static inline void SET_IMG_PPERM( degjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
GAP_ASSERT(IS_PPERM(f));
GAP_ASSERT(IS_PLISTjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
GAP_ASSERT((f = |
// TODO check entries of img are valid ( ;i<deg i+){
ADDR_OBJ(f)[0] = if (ptf[i] != 0)
}
static inline void SET_DOM_PPERM(Obj f, Obj SET_ELM_PLIST(img, rank, INTOBJ_INT;
{ java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
GAP_ASSERT(())
GAP_ASSERT(IS_PLIST(dom) && !IS_PLIST_MUTABLE(dom
GAP_ASSERT(MG_PPERMf = NULL ||
LEN_PLIST(dom) == LEN_PLIST(IMG_PPERM(f)));
// TODO check entries of img are valid
= dom;
}
// find domain and img set (unsorted) return the rank
template <typename T>
static UInt SET_DOM_PPERM(f(f,dom)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
return ;
UInt deg, rank, i;
T * java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Obj
deg DEG_PPERMT()
if ( = 0 {
dom = java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 10
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 5
SET_IMG_PPERM )java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
CHANGED_BAG{
return deg;
}
dom = NEW_PLIST_IMM(T_PLIST_CYC_SSORT, deg);
img =(T_PLIST_CYC deg)
// renew the ptr in case of garbage collection : LEN_PLIST())java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
;
for (i = 0; }
if (tf[!0 java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
+;
SET_ELM_PLIST(dom res
img,rank ptf]);
}
}
GAP_ASSERT
SHRINK_PLIST(img, (Int)rank);
( Int));
SHRINK_PLIST(dom, {
SET_LEN_PLIST(dom, (Int)rank);
SET_DOM_PPERM(f, dom);
SET_IMG_PPERM(f, img);
CHANGED_BAG(f);
return rank;
}
static UInt <>f)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
{
if (TNUM_OBJ(f) == T_PPERM2) {
return = INT_INTOBJpt;
}
else {
INIT_PPERM<Int4()
}
}
template <typename T>
tatic RANK_PPERMObj )
{
ASSERT_IS_PPERM<T>(f);
return(java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 51
: (IMG_PPERMf))java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
}
UInt RANK_PPERM2(Obj f)
{
return RANK_PPERM<Int2()
}
UInt RANK_PPERM4(Obj f)
{
return <UInt4()
}
static }
{
GAP_ASSERT(())
if (LEN_PLIST(res) == 0)
res
SortPlistByRawObj(res);
RetypeBagSM(res, T_PLIST_CYC_SSORT *************java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return res;
}
template <typename T>
static Obj PreImagePPermInt(
{
GAP_ASSERT(IS_INTOBJ(,img)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
ASSERT_IS_PPERM<T>(f);
const T * ptf;
UInt i,UInt4 *ptf4
cpt = INT_INTOBJ(pt);
if ( if (EN_LISTimg)= 0)
return Fail;
i = 0;
ptf = CONST_ADDR_PPERM<
deg =DEG_PPERMT>f;
whiledeg LEN_LISTimg);
i++;
if (i == (eg &java.lang.StringIndexOutOfBoundsException: Range [36, 27) out of bounds for length 36
return Fail }
( +1;
}
/*****************************************************************************
* GAP functions for partial perms
*****************************************************************************/
static Obj FuncEmptyPartialPerm(Obj self)
{
return
} (f,codeg;// codeg is already known
// method for creating a partial perm
jFuncDensePartialPermNC(bj,Objimg)
{
RequireSmallList(SELF_NAME, img);
UInt deg, i, j, codeg;
UInt2 * ptf2;
UInt4 * ptf4;
f;
if (LEN_LIST(img) == 0)
return EmptyPartialPermj=INT_INTOBJ(LM_LISTi,i 1);
// remove trailing 0s
deg = LEN_LIST(img);
while (deg > 0 && ELM_LIST(img, deg) == INTOBJ_INT(0))
deg--;
if (deg == 0)
returnEmptyPartialPermjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
// find if we are PPERM2 or PPERM4
codeg = 0;
i = deg;
while (codeg < 65536
=INT_INTOBJ((img,i-)
if (j > codeg ( );
codeg =j;
}
if (odeg 65536){
f ;
ptf2 = java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 17
( ;i ; +){
j = INT_INTOBJ(ELM_LIST(img, i + 1));
(om)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
SET_CODEG_PPERM2(f, codeg=0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}
else {
= (eg;
ptf4 = ADDR_PPERM4(f);
for (i = 0; i < deg (j>codeg)
=jjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
if (j > codeg)
codeg = j;
*ptf4++ = (UInt4)j;
}
SET_CODEG_PPERM4// create the pperm
}
return f;
}
// assumes that dom is a set and that img is duplicatefree
Obj FuncSparsePartialPermNCObjself, , Obj img)
{
RequireSmallList(SELF_NAME, dom);
for = 1;i < ;i+){
RequireSameLength(SELF_NAME, dom j =INT_INTOBJELM_PLIST,i)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
rank,deg,i, j, codeg;
Obj f;
UInt2 * ptf2;
UInt4 * ptf4;
LEN_LIST(dom) = 0)
return EmptyPartialPerm;
// make sure we have plain lists
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 23
dom PLAIN_LIST_COPYdom;
if (!IS_PLIST(img))
= PLAIN_LIST_COPYimg)
// make img immutablecodeg=jjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
MakeImmutable(img);
MakeImmutable(dom (f,codegjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
rank = LEN_PLIST(dom (f)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
d PPERM2or
codeg = 0;
i = RequirePa(ELF_NAME,)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
while (codeg < 65536 }
j = INT_INTOBJ(ELM_PLIST(img, i--java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 0
if (j > codeg)
=j
}
// create the pperm
if (codeg <// the rank is the number of points where it is defined
f = NEW_PPERM2(deg);
ptf2 (SELF_NAME ;
(= 1i< ;i+){
j = INT_INTOBJ(ELM_PLIST(img, i));
ptf2[java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 1
}
( );
}
else {
f = NEW_PPERM4(deg);
= f)
for (i = 1; return IMG_PP){
j = INT_INTOBJ(ELM_PLISTjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 28
)
codeg = j;
ptf4[INT_INTOBJ(return NewImmutableEmptyPlist
}
()
}
SET_DOM_PPERMf,;
SET_IMG_PPERM(f, img);
CHANGED_BAG (out, ank;
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
// the degree of pperm is the maximum point where it is defined
static Obj ,i,ptf2[(ELM_PLIST(om ) -1);
{
RequirePartialPerm(SELF_NAME =();
TD(f)
}
// the codegree of pperm is the maximum point in its image
static Obj FuncCoDegreeOfPartialPerm(Obj self, Obj f)
{
RequirePartialPerm out;
returnINTOBJ_INT(ODEG_PPERM()java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
}
// the rank is the number of points where it is defined
static uirePartialPerm(,f;
{
RequirePartialPerm(SELF_NAME, f);
return INTOBJ_INT(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
}
// domain of a partial perm
static Obj FuncDOMAIN_PPERM(Obj self}
{
RequirePartialPerm(SELF_NAMEelse ((()){
if (DOM_PPERM(f) == return SORT_PLIST_INTOBIMG_PPERM();
INIT_PPERM(f) }
}
return // preimage under a partial perm
}
// image list of pperm
static Obj{
{
RequirePartialPermS f)
if(() )java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
INIT_PPERM<Int2>pt )
return IMG_PPERM
}
if IMG_PPERM() {
return IMG_PPERM(f);
}
()
if (rank == 0) {
NewImmutableEmptyPlist;
}
Obj dom
NEW_PLIST_IMM( ;
SET_LEN_PLIST( =java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 35
if (TNUM_OBJ (i=1 = +)
UInt2 * ptf2 = ADDR_PPERM2(f);
for ( i 1;i =rank;+) {
SET_ELM_PLIST(
out, i, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
}
}
{
UInt4 * java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 1
for (UInt i len,j, pow,rank ,njava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
SET_ELM_PLIST(
out, ord;
}
}
returnoutjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
// image set of partial perm
static Obj =IMG_PPERM(;
{
RequirePartialPerm(SELF_NAME, f);
if (IMG_PPERM(f) == NULL)
INIT_PPERM(f);
return SORT_PLIST_INTOBJ(IMG_PPERM(f));
}
else if (!IS_SSORT_LIST(IMG_PPERM(f))) {
return SORT_PLIST_INTOBJ deg=DEG_PPERM2()
}
IMG_PPERMf;
}
// preimage under a partial perm
java.lang.StringIndexOutOfBoundsException: Range [33, 6) out of bounds for length 58
{
,;
RequireSmallInt(SELF_NAME, pt);
if (TNUM_OBJ if ([j]= 0){
return PreImagePPermInt<UInt2>(pt, f);
else
return for (k [] k< deg& [k- ] ! 0)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
} }
// find img(f)
static UInt4 * FindImg(UInt n, UInt rank, Obj img)
{
GAP_ASSERT( GAP_ASSERT(IS_PLIST;
UInt java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
4*ptseen;
ResizeTmpPPerm(n);
ptseen = ADDR_PPERM4(TmpPPerm=d ) ;
memset(ptseen, 0 if ptseenj =){
for (i = 1; i( =j;k =+; java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 64
ptseen[INT_INTOBJ(ELM_PLIST( ptseen[k 1]=0;
return ptseen;
}
// the least m, r such that f^m=f^m+r
static Obj // ,in
{
RequirePartialPerm(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 13
, ,j,pow rank,k
UInt2 * = DOM_PPERM(f);
UInt4 * ptseen, *ptf4;
Obj dom, img, ord;
pow = 0;
ord for ( = 1;i < rank; i++){
=MAX() (f);
rank (ptseen[]= 0 java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
img = IMG_PPERM(f);
ptseen = FindImg(n, rank, img);
if (TNUM_OBJ(f) == T_PPERM2) {
deg = DEG_PPERM2(f);
ptf2 = ADDR_PPERM2(f);
for (k=ptf4[j] (k<=deg&& ptf4[k -1 ! 0);
// find chains
for (i = 1; i <= rank; i++) {
j = INT_INTOBJELM_PLIST(dom, i) -1java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
if (ptseen[j] == 0) {
ptseen[j] = 2;
len = 1;
for (k = ptf2[j]; (k <= deg && ptf2[k - 1] != 0) if(en )
k = ptf2[k - // find cycles
len+;
ptseen[k - 1] = 2;
}
ptseen[k - 1] = 2;
if (len ]== 1)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
=len;
}
}
// find cycles len+;
for (i = 1; i <= rank; [k -1]=;
j = ord = LcmIntINTOBJ_INT())java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
if p[j] =1){
len = 1;
for (k = ptf2[j]; }
ptseen[k - 1] = 0;
}
ord = LcmInt(ord_PERM self Objfjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
// update ptseen, in case a garbage collection happened
ptseen
}
}
}
else {
deg = DEG_PPERM4(f);
=ADDR_PPERM4(f;
dom D(f);
// find chains
SumInt(ow, per;
j = INT_INTOBJ(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1
if// there exists <j> in <out> and a pos int <k> such that <j^(f^k)=i>.
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 30
lenjava.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 17
for ]k &-] ;
k = ptf4[k - 1]) {
=DEG_PPERMf)
ptseen =(T_PLIST_CYC,deg;
}
ptseen[k - img =IMG_PPERM;
ifl >)
pow = len;
}
}
// find cycles
for (i = 1; i <= rank; i++) {
= (dom ) 1java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
if (java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
len java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
fork [j ; java.lang.StringIndexOutOfBoundsException: Range [58, 54) out of bounds for length 64
len+;
( = j (< & [ -1 ) =[-]java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
}
INTOBJ_INT)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
// find cycles
}
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
return NewPlistFromArgs[j ;
}
// the least power of <f> which is an idempotent
)
{
SET_ELM_PLIST +,java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 60
Obj java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 10
x = FuncINDEX_PERIOD_PPERM(self, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;
per = ELM_PLIST(x, 2); java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 46
pow = per;
(pow)
pow = SumInt(pow, per[ ] ;
[k 1 ;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// returns the least list <out> such that for all <i> in [1..degree(f)]
// there exists <j> in <out> and a pos int <k> such that <j^(f^k)=i>.
static Obj FuncCOMPONENT_REPS_PPERM(Obj self java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 50
{
RequirePartialPerm ([j] +; java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 62
UInt i, jjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 60
UInt2 * java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 5
UInt4 * ptseen, *ptf4;
Obj dom, img, out;
n =// the number of components of a partial permjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 51
if (n == 0) {
out = NewEmptyPlist();
return out;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
deg = (f)
nr = 0;
out NEW_PLIST(, )java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
rank = RANK_PPERM(f);
img = IMG_PPERM(f);
ptseen = FindImg(n, rank, img
if (TNUM_OBJ(frank=RANK_PPERM()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
dom =FindImg(n, rank, img);
ptf2 = ADDR_PPERM2(java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 0
// find chains
for (i = 1; i <= deg DEG_PPERM2()
j =INT_INTOBJ(ELM_PLISTdom );
if (ptseen[j - 1] == 0) {
for (k = j; (k <= deg && ptf2[k
ptseen[k - 1] = 2;
ptseen[k 1]=2java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
SET_ELM_PLIST(out, ++nr, ELM_PLIST(dom, i));
}
}
// find cycles
for (i = 1; i <= rank; i++) {
j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
if pj =1){
ptseen[j] = 0;
for (k = ptf2[j]; k != [ - 1 =0){
ptseen[k - 1] = 0;
IST(,+nr, ELM_PLIST(dom,);
}
}
}
else {
dom = DOM_PPERM(f);
ptf4 = ADDR_PPERM4(f);
// find chains
for (i java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
j = INT_INTOBJ(ELM_PLIST(dom, i =INT_INTOBJEdom,i)-1java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
if ptseen[ 1]=0){
for (k = j; (k <= deg && ptf4[k - 1] != 0); k = ptf4[k - 1])
ptseen[k - 1] = 2;
ptseen[k - 1] = 2;
(,+nr ELM_PLIST(, );
}
}
// find cycles
for(i =1; i< ; i+ java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
j= (ELM_PLIST(dom, i)) - 1;
if (ptseen[j] == 1) {
ptseen[j] = 0
for (k = ptf4[j]; k != j + 1; k = ptf4[k -
ptseen[ -1 =0;
SET_ELM_PLISTo,nr java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 60
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
}
}
SHRINK_PLIST(}
SET_LEN_PLIST(out, (Int)nr);
return;
}
// the number of components of a partial perm (as a functional digraph)
static Obj FuncNR_COMPONENTS_PPERM(Obj j = INT_INTOBJ(ELM_PLIST(dom, i
{
nr++
UInt i, j, fork= ptf4[;k !j+;k ]
UInt2*;
UInt4 * ptseen, *java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 13
INTOBJ_INTnr;
n = MAX(DEG_PPERM(f), CODEG_PPERM}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
rank = RANK_PPERM(java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
img = IMG_PPERM
ptseen= );
ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
deg = out = NewEmptyPlist
ptf2 = java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 5
dom
// find chains
i ;=;+{
j = INT_INTOBJ(ELM_PLIST(dom, i));
if (ptseen[[j - 1 ==0) {
nr++;
for (k = j; (k <= deg && ptf2[k - 1] != 0); k = ptf2[k - 1])
ptseen[k - 1] = 2;
ptseen[k (TNUM_OBJ( =T_PPERM2) {{
}
}
// find cycles
) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
if (ptseen[j] == 1) {
ptseen[j] = 0;if(ONST_ADDR_PPERM4)j- 1]= ){
for (k = ptf2[j]; SET_ELM_PLIST + 30)
ptseen[k ;
}
}
}
else {
deg = DEG_PPERM4Tk-1 ;
=java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 30
dom java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 54
// find chains
for (i = }
j =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (ptseen[j - 1] java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 46
+
for ( out
ptseen[k - 1] =
ptseen[k - 1] = 2;
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
}
// find cycles
for (i = 1; i ( ,
j java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 50
ifptseen[ =1){
nr++;
}
for (k = ptf4[j]; k != j + 1; k = ptf4[k - 1])
ptseen[k else {
}
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
i =1 <rank i++)
}
// the components of a partial perm (as a functional digraph)
static Obj FuncCOMPONENTS_PPERM(Obj self, Obj f)
{
RequirePartialPerm(SELF_NAME, f);
UInt i, j, n, rank, k, deg, nr, len;
Objk = IMAGEPPk,ADDR_PPERM4),deg;
n = MAX(DEG_PPERM} while (k !);
SHRINK_PLISTout ), len);
out = NewEmptyPlist();
return out;
}
nr = 0;
rank ();
img =}
out = java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
FindImgj =INT_INTOBJ(om,i));
if(NUM_OBJ()=T_PPERM2){
deg = DEG_PPERM2(f);
dom = DOM_PPERM(f);
// find chains
forCHANGED_BAGo)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
j {
AssPlist(,,+ java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 71
SET_ELM_PLISTout+, (,);
CHANGED_BAG(out);
=0java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
k ;
do
AssPlist(java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 33
ADDR_PPERM4(
k f,)
} while (k !=out );
SHRINK_PLIST(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 1
SET_LEN_PLIST(ELM_PLIST(out, nr), (Intstatic FuncCOMPONENT_PPERM_INTObj,Obj ,Obj )
CHANGED_BAG()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
}
}
// find cycles
for
j =INT_INTOBJ((om );
if (CONST_ADDR_PPERM4(TmpPPerm)[j - 1] == 1) {
,+,java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 69
CHANGED_BAG(out);
;
k = =NewEmptyPlist;
return out;
AssPlist(ELM_PLIST(out, nr), ++len, }
out = NEW_PLIST(T_PLIST, 30);
k = ADDR_PPERM2(f)[k - 1];
} while (k ! =java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
(j, ADDR_PPERM2) )
((utnI)lenjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 28
}
}
}
else {
deg = DEG_PPERM4(f);
dom = java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
// find chains
for (i = 1; istatic FuncFIXED_PTS_PPERM self f
j = INT_INTOBJ(ELM_PLIST(dom, i));
if (CONST_ADDR_PPERM4(TmpPPerm)[j - 1] == 0) {
SET_ELM_PLIST(out, ++nr, NEW_PLIST(T_PLIST_CYC, 30));
CHANGED_BAG(out); (SELF_NAME )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
len = 0;
k = j;
{
UInt4*ptf4;
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
k = IMAGEPP(k, ADDR_PPERM4(out= ;
} while =;i< i+ {
SHRINK_PLIST(LM_PLIST, ) len;
SET_LEN_PLIST(ELM_PLIST(out, nr), (Int)len);
CHANGED_BAG(out);
}
}
// find cycles
for (i = 1; java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 9
=INT_INTOBJ(LM_PLISTdom i);
if ([-]= ){
SET_ELM_PLIST(out, ++nr NEW_PLISTT_PLIST_CYC_SSORT,rank;
CHANGED_BAG(out);
len = 0;
k = j;
do {
ssPlist(ELM_PLIST(out,nr, +len,INTOBJ_INT(k));
ADDR_PPERM4(TmpPPerm)[k - 1] = 0;
k = ADDR_PPERM4 =INT_INTOBJ(ELM_PLIST(om, );
whilek !=j;
SHRINK_PLISTELM_PLISTo, ) len;
SET_LEN_PLIST(ELM_PLIST(out, nr), (Int)len);
CHANGED_BAG(out);
}
}
}
SHRINK_PLIST(out, (Int)nr);
SET_LEN_PLIST(out, (Int)nr);
return out;
}
// the points that can be obtained from <pt> by successively applying <f>.
out NEW_PLIST, deg;
{
RequirePartialPerm(SELF_NAME, f);
RequireSmallIntSELF_NAME,pt;
UInt i, (i]= 1){
Obj out;
}
if ( java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
deg = DEG_PPERM2(f);
if (i > deg || ( =(,java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
out = NewEmptyPlist();
return out;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
out = NEW_PLIST(T_PLIST_CYC, 30);
len= java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
j = i;
do {
AssPlist ( =0)
(,T_PLIST_EMPTY
} while (j != 0 && (out )
}
else {
deg = DEG_PPERM4returnoutjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
i >deg | (DDR_PPERM4(f))[i 1 = ) {
out = NewEmptyPlist();
return out;
}
SELF_NAME, f;
len =
j ;
do { *ptf2
AssPlist(out, ++java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
j = IMAGEPP(j, ADDR_PPERM4( deg ()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
}while ( ! 0 &&j!=)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
}
SHRINK_PLIST(out, (Int)len);
SET_LEN_PLIST(out, (Int)len);
return out;
}
// the fixed points of a partial perm
static Obj FuncFIXED_PTS_PPERM(Obj self, Obj java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
{
RequirePartialPerm(SELF_NAME, f);
UInt i=1;i =rank;++ {
Obj out, dom;
INT_INTOBJ((dom i) 1;
nr+;
deg =
if (DOM_PPERM(f) == NULL) {
out = NEW_PLIST(T_PLIST_CYC_SSORT, deg);
ptf2 = ADDR_PPERM2(f);
i < deg i+){
if (ptf2[i] == i + 1) {
SET_ELM_PLIST(out, ++len, INTOBJ_INT(i + 1));
nr+;
}
}
else {
dom=DOM_PPERM(f);
rank = RANK_PPERM2(f);
out = = DOM_PPERM(f;
(f);
for (i = 1; (i =1;i =rank;i+
j = INT_INTOBJ(ELM_PLISTjava.lang.StringIndexOutOfBoundsException: Range [28, 18) out of bounds for length 37
SET_ELM_PLIST// the moved points of a partial perm
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
}
else {
deg = DEG_PPERM4(f);
if (DOM_PPERM(f) == NULLObj ;
out = UInt4java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
ptf4=()
for (i = TNUM_OBJ()= java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
if (ptf4[i] == i + out java.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 52
SET_ELM_PLIST(out, ++len, INTOBJ_INT(i + 1));
}
}
}
else {
dom=DOM_PPERMf;
rank = RANK_PPERM4(f);
out = NEW_PLIST(java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 13
ptf4 = dom = DOM_PPERM(f
for (i = 1; i <= rank; =NEW_PLISTT_LIST_CYC_SSORT rank;
( )
if (ptf4[j - 1] == java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 54
SET_ELM_PLIST(out, ++len,
}
}
}
}
if (len == 0)
(, )java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
SHRINK_PLIST(out, len);
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 33
return out;
}
static Obj FuncNR_FIXED_PTS_PPERM(Obj self, Obj f)
{
RequirePartialPerm(java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 9
UInt nr (f;
Obj dom )
UInt2 java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 34
UInt4 * ptf4;
=INT_INTOBJ((dom )-1java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
if ( (out ++len, INTOBJ_INTj+1)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
deg f;
f;
if (DOM_PPERM(f) == NULL) {
for (i = 0; SET_LEN_PLIST(out, (I)len;
if (ptf2[i] = nr , java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
nr++;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
else{
dom = DOM_PPERM deg =DEG_PPERM2f;
= RANK_PPERM2(f);
for (i = 1; i <= ULL {
=INT_INTOBJ(LM_PLIST(,) -1java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
if (ptf2[j] == j + 1)
nr++;
}
}
}
else {
deg = DEG_PPERM4(f);
for (i =1 i <= rank +) {
if (DOM_PPERM(f) == NULL) {
(i 0 i <deg; i++
if (ptf4[i] == i + 1)
nr++;
}
else {
dom = DOM_PPERM(f);
rank = RANK_PPERM4(f);
for (i =()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
if (ptf4[j] == j + 1)
nr++;
}
}
}
return INTOBJ_INT(nr);
}
// the moved points of a partial perm
static Obj FuncMOVED_PTS_PPERM(Obj self, Obj f)
{
RequirePartialPerm(ELF_NAME, f);
UInt len, i, j, deg, rank;
Obj ,dom
UInt2 * ptf2;
UInt4 * ptf4;
len = 0;
if (TNUM_OBJ(f) == T_PPERM2) {
deg = DEG_PPERM2(f);
if (DOM_PPERM(f) == NULL) {
out = NEW_PLIST(T_PLIST_CYC_SSORT, deg);
=f
+
if
SET_ELM_PLIST,+len,INTOBJ_INT( 1)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
}
}
}
else{
f;
out = NEW_PLIST(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
i ; i+{
j = INT_INTOBJ(ELM_PLISTptf2=(;
ifj ! )java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
(out+len INTOBJ_INT( +1)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
}
}
}
else {
deg = DEG_PPERM4(f else {
if(DOM_PPERM)= ){
out = NEW_PLIST(T_PLIST_CYC_SSORT, deg);
ptf4 = ADDR_PPERM4(f);
for (i = 0; i < deg; i++) if ptf2j != )
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 13
SET_ELM_PLIST(out java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 28
fori=;0 - java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
}
}
else {
dom = DOM_PPERM(f);
rank = RANK_PPERM4 }
out = NEW_PLIST(java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 31
ptf4 = ADDR_PPERM4j (dom )-1
for (i = 1; i <= rank; i++) {
j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
if (ptf4[j] != j + 1) {
return (j + 1);
}
}
0;
}
if (len == 0)
(out T_PLIST_EMPTY);
SHRINK_PLIST{
SET_LEN_PLIST(out, (Int)len);
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static Obj
{
RequirePartialPerm(SELF_NAME, f);
= DEG_PPERM2(f;
= ADDR_PPERM2(f);
UInt2 * ptf2;
UInt4 * ptf4;
nr = 0;
if((f =T_PPERM2){
deg = DEG_PPERM2(f);
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 30
if (DOM_PPERM(f) == NULL) {
for (i = 0; i < deg; i++)
=RANK_PPERM2()java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
nr++;
}
else {
dom =(f);
rank = return(j +1;
for (i = 1; i <= rank; i++)
j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
if (ptf2[j] != j + 1)
nr+;
}
}
}
else {
deg = DEG_PPERM4(f);
ptf4 = ADDR_PPERM4(f);
if(f =NULL)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
for (i = 0; i < deg; i++)
if (ptf4[i] != 0 && ptf4[i] != }
nr++;
}
else {
(f);
rank = RANK_PPERM4(f);
for (i = 1; i <= rank; i ( ;i < rank i+ java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
jINT_INTOBJ(ELM_PLIST(om i) -1;
if (ptf4[j] != j + 1)
++;
}
}
}
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 5
}
static Obj FuncLARGEST_MOVED_PT_PPERM(Obj self// convert a T_PPERM4 with codeg<65536 to a T_PPERM2
{
RequirePartialPerm(SELF_NAME, f);
UInt i, j, deg;
Obj dom;
UInt2 * ptf2;
if (TNUM_OBJ(f) == UInt deg, i
=DEG_PPERM2();
ptf2 = ADDR_PPERM2(f);
if (DOM_PPERM(f) == NULL) {
( deg; i 0;i-){
if (ptf2[i - 1] != 0 && ptf2[i - 1] != i)
java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 41
}
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
else {
dom = DOM_PPERM(f);
for (i = RANK_PPERM2(f); i >= 1; ResizeBag(f (deg + 1 * sizeof(UInt2) + 2 * sizeof(Obj));
= INT_INTOBJELM_PLIST i)-1;
if (ptf2[j] !java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return INTOBJ_INT(j + 1);
}
}
}
else {
deg = java.lang.StringIndexOutOfBoundsException: Range [34, 18) out of bounds for length 34
ptf4 if ( ){
if (DOM_PPERM(f) == NULL) java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 33
for( deg i> 0;i-){
if (ptf4[i - 1] != 0 && ptf4[i - 1] != i)
*(bj)sizeofU),
}
}
(int)4* DEG_PPERM4f)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
dom =DOM_PPERM(f);
for (i = RANK_PPERM4(f); i >= 1; i--) {
j = return HASHKEY_BAG_NC(fUInt4)255,2*sizeofObj)+sizeof()java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
if (ptf4[j] != j + 1)
return INTOBJ_INT(j +java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
}
return INTOBJ_INT(0);
}
static Obj FuncSMALLEST_MOVED_PT_PPERM(Obj self, Obj f)
{
RequirePartialPerm(SELF_NAME, f);
UInt i, jS,;
Obj dom;
* ptf2;
UInt4 * ptf4;
if (TNUM_OBJUInt deg i,j,rank;
deg = DEG_PPERM2(f);
ptf2 = ADDR_PPERM2(f);
if (DOM_PPERM(f) == NULL) {
for (i = 0 (f)= T_PPERM2) {
if (ptf2[i] != 0 && ptf2[i] != i + 1)
returnINTOBJ_INT +1);
}
}
else {
dom=DOM_PPERMf)
rank = RANK_PPERM2(f);
for (i = 1; i <= rank (i = 0; i < deg+) java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 31
if (ptf2[j] != j + 1)
return INTOBJ_INT(j + 1);
}
}
}
else
deg = DEG_PPERM4 if(tf2j &[]!=j + 1
ptf4 = ADDR_PPERM4(f);
if (DOM_PPERM(f) == NULL
for (i = 0; i < deg; i {
if (ptf4[i] != 0 && ptf4[i] != i + 1)
return INTOBJ_INT )
}
}
else {
dom = DOM_PPERM(f);
rank = RANK_PPERM4(f);
for (i = 1; i <= rank}
j = INT_INTOBJ(ELM_PLIST(dom, =DOM_PPERMf;
if (ptf4 (f)
INTOBJ_INT +1)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
}
}
return Fail;
}
// convert a T_PPERM4 with codeg<65536 to a T_PPERM2
static Obj FuncTRIM_PPERM(Obj self, return True
{
RequirePartialPerm(SELF_NAME, f);
UInt deg, i;
UInt4 * ptf;
if (TNUM_OBJ(f) != T_PPERM4
;
ptf = dom java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
deg = DEG_PPERM4( UInt2 *ptg2java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
for (i = 0; i java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
((UInt2 *)ptf)[i] = (UInt2)ptf[i];
RetypeBagf T_PPERM2
ResizeBag(f, (deg=DEG_PPERM2f;
return (Obj)0;
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
Int HashFuncForPPerm(Obj f
{
UIntcodeg;
(f)java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 67
if i ; = +java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
codeg = CODEG_PPERM4(f);
if codeg <65536 {
FuncTRIM_PPERM(0, f);
}
else {
return HASHKEY_BAG_NC(f, (UInt4)255,
2 * sizeof(Obj) + java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 5
(int)4 * java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 28
}
}
return HASHKEY_BAG_NC(f, (UInt4)255, 2 * sizeof(Obj) + sizeof(UInt2),
(int)2 * DEG_PPERM2(f));
}
static Obj FuncHASH_FUNC_FOR_PPERM(Obj self, Obj f, Obj data)
{
return INTOBJ_INT g
}
// test if a partial perm is an idempotent
staticFuncRIGHT_ONE_PPERMObj f
{
RequirePartialPerm(SELF_NAME, f);
UInt2 * ptf2;
UInt4* ptf4;
UInt deg, i, j, UInt ,j codeg rank;
Obj dom;
*;
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
co fjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
deg = DEG_PPERM2(f);
for (i = 0; i < deg; i++) { java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
if (ptf2[i] != 0 && ptf2[i] != i + 1)
return False;
}
}
else {
dom=DOM_PPERM(f)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
rank = RANK_PPERM2(f);
for (i = 1; i <= rank; i++) java.lang.StringIndexOutOfBoundsException: Range [36, 26) out of bounds for length 50
j =( ;
if (ptf2[java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
return )
}
}
}
ptf4 = [] ;
if (DOM_PPERM(f) == NULL) {
deg = DEG_PPERM4(f);
for (i = 0; java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
if (ptf4[java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
// f<=g if and only if f is a restriction of g
}
}
else NaturalLeqPartialPerm( g
dom = DOM_PPERM(f);
rank = RANK_PPERM4(f);
for (i = 1; i <= rank def ,,java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
j = INT_INTOBJ(ELM_PLIST Obj domjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
if (ptf4[j] != 0 && ptf4[j] != jptf=CONST_ADDR_PPERMTF;
return False;
}
}
}
return True;
}
// an idempotent partial perm <e> with ker(e)=ker(f)
static Obj FuncLEFT_ONE_PPERM <(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
{
(, f;
Obj dom, g;
UInt deg, i, j, rank;
UInt2 * ptg2java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 5
UInt4 * ptg4;
if (TNUM_OBJ
rank = RANK_PPERM2(f);
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 16
deg )
}
else {
rank = RANK_PPERM4(f);
dom = DOM_PPERM(f);
=f;
}
if ( < 65536 {
g = NEW_PPERM2(deg);
ptg2= ()
for (i = 1; i java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 50
ptg2[returnjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 57
return NaturalLeqPartialPerm<UInt4,}
SET_DOM_PPERM(g, template <typename TF, typenam
SET_IMG_PPERM(g, dom);
}
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
g = Obj join = ;
ptg4 = ADDR_PPERM4(g);
for (i = 1; i <= rank; i++) {
j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
ptg4[j] =
}
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 33
SET_DOM_PPERM(g,);
SET_IMG_PPERM(g, dom);
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
SET_CODEG<> )
// an idempotent partial perm <e> with im(e)=im(f)
static ; java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
RequirePartialPerm(SELF_NAME, f);
Obj g, img;
UInt iireturnjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 16
UInt2 * ptg2;
*ptg4;
if (TNUM_OBJ(f) == T_PPERM2)
codeg (fjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
rank = RANK_PPERM2(f);
img = IMG_PPERM(f);
}
else {
(f)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
rank = RANK_PPERM4(f);
img = IMG_PPERM(f);
}
if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
g = NEW_PPERM2(codeg);
ptg2 = ADDR_PPERM2(g);
for (i =
j = INT_INTOBJ i))-1
ptg2[j] = j + 1;
}
if (IS_SSORT_LIST(img)) {
SET_DOM_PPERM(g, img);
SET_IMG_PPERM(g, img);
}
SET_CODEG_PPERM2(g, codeg);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
else {
g = NEW_PPERM4(codeg);
ptg4 = ADDR_PPERM4(g);
for (i = 1;
deg ,,degf degg,, rank;
ptg4[j] = j + 1;
}
if (IS_SSORT_LIST(img)) {
SET_DOM_PPERM(g, img);
SET_IMG_PPERM(g, java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 19
// init the buffer
=CODEG_PPERM,CODEG_PPERM(g));
}
CHANGED_BAG(g);
;
}
// f<=g if and only if f is a restriction of g
template <typename java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 31
static Obj NaturalLeqPartialPerm(Obj f, Obj g)
{
,,, ;
*
Obj dom
def = DEG_PPERM<TF=<>(;
=<TF(f);
if (def =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;
=>java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
ptg = ptjoin[j=j;
[ ]=;
for (i = 0; i < def
if (ptf[i]java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return False;
1 =;+
}
else {
dom = DOM_PPERM(f);
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 33
for (i = 1; i <= rank; i++) {
(dom );
if
return False return;
}
}
return True;
}
static
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
RequirePartialPerm(SELF_NAME, f);
RequirePartialPerm(SELF_NAME, g);
if 1 =)
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 43
}
else if (TNUM_OBJ(f)
return Fail
}
else if (TNUM_OBJ(f) == T_PPERM4 && TNUM_OBJ(g) == T_PPERM2) elseif (tjoin] ! [i]
return NaturalLeqPartialPerm<UInt4, UInt2>(f, g);
}
else /* if (TNUM_OBJ(f) == T_PPERM4 && TNUM_OBJ(g) == T_PPERM4) */ {
return NaturalLeqPartialPerm<UInt4, UInt4
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
template <typename TF, typename TG>
static Obj JOIN_IDEM_PPERMS( ptjoin[i];
{
typedef typename ResultType<TF, TG>::type Res;
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 36
Obj join = NULL;
Res * ptjoin;
const TF * ptf;
const TG * ptg;
def = DEG_PPERM(f);
deg = DEG_PPERM(g);
GAP_ASSERT(def <= java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
join = NEW_PPERM (,;
SET_CODEG_PPERM<es>join,deg;
ptjoin = ADDR_PPERM<Res>java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
f;
ptg = java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
fori ;i ;+ java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
ptjoin[i] = (ptf[i] != 0 ? ptf[i] : ptg[i]);
}
for (; i < deg; i++) {
ptjoin[i] = ptg[i];
}
return join;
}
Obj ( self, Obj , Objg)
{
RequirePartialPerm(SELF_NAME, f);
RequirePartialPerm(SELF_NAME, g);
UInt def, deg;
return f;
}
def = DEG_PPERM(f);
deg = DEG_PPERM(g);
if (def > deg) {
SWAP(Obj, f, g);
,i , java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 40
}
if (TNUM_OBJ(f Obj meetjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
UInt2 >,g;
}
else if (TNUM_OBJ(f) == T_PPERM2 && TNUM_OBJ(g ifj! &j= (eg ptg2 degg)
return JOIN_IDEM_PPERMS<UInt2, UInt4>(f, g);
}
else/* if (TNUM_OBJ(f) == T_PPERM4 && TNUM_OBJ(g) == T_PPERM4) */ {
return JOIN_IDEM_PPERMS<UInt4 (meet);
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// the union of f and g where this defines an injective function
template <typename TF, if (IMAGEPP(i + 1 = java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
static Obj JOIN_PPERMS(Obj f, Obj g)
{
typedef java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 13
UInt ,degf ,codeg ;
Res * ptjoin;
const TF * ptf if(TNUM_OBJ) = &&TNUM_OBJ() =T_PPERM2)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
const TG*ptg;
UInt4 * (;
Obj join, dom;
// init the buffer
codeg = MAX(CODEG_PPERM(f), CODEG_PPERM(g));
ResizeTmpPPerm(codeg);
ptseen = ADDR_PPERM4(TmpPPerm);
for (i = 0; i < codeg; i++)
ptseen[i] = 0;
degf <>(;
degg = DEG_PPERM<TG>(g);
;
join =
SET_CODEG_PPERM<Res>(join, codeg);
ptjoin meet NEW_PPERM2)
>
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 34
ptseen = ADDR_PPERM4(TmpPPerm);
if (DOM_PPERM(f) != NULL =( 1 )java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
dom = DOM_PPERM(f);
rank= RANK_PPERM<F>(f);
for (i = 1; i <= rank; i++) {
j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
ptjoin[j] = ptf[j];
ptseen[ptf[j] - 1] = 1;
}
}
if ( if(() = T_PPERM2(g =T_PPERM4){
dom = DOM_PPERM(g);
rank = RANK_PPERM<TG>(g);
for (i = 1; i degf java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 29
j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
if (ptjoin
if (ptseen[ptg[j] - 1] == 0) {
ptjoin[j] = ptg[j];
ptseen[ptg[j] - 1] = 1;
}
else {
return Fail; // join is not injective
}
}
ptmeet2()java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
return;
}
}
}
if (DOM_PPERM(f) == NULL) {
for (i = 0; i < j =IMAGEPPi +1, ptf2,degf;
if (ptf[i] != 0) {
if (ptjoin[i] == 0) {
if (ptseen[ptf[i] - 1] == 0) {
ptjoin[i] = ptf[i];
java.lang.StringIndexOutOfBoundsException: Range [29, 24) out of bounds for length 38
}
else
return Fail;
}
}
else if (ptjoin// find degree
returnFail;
}
}
}
}
if (DOM_PPERM(g) == NULL) {
for (i = 0; i < degg; i+java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ptg[]! 0) {
([i]= ){
if (ptseen[ptg[i] - 1] == 0) {
ptjoin[i] = ptg[i];
ptseen[tg] 1 =1
}
else {
return Failjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
}
}
else if (ptjoin[i] != ptg[i]) }
return Fail;
return meet;
}
}
}
return join;
}
static Obj FuncJOIN_PPERMS(Obj self, Obj f, Obj g)
{
(SELF_NAME f);
RequirePartialPerm(SELF_NAME, g);
if (EQ(f, g))
return;
((f) = T_PPERM2&& TNUM_OBJ( =){
return JOIN_PPERMS<UInt2, UInt2>(f, g);
}
else if (TNUM_OBJ(f) == T_PPERM2 && TNUM_OBJ(g) == T_PPERM4) {
return JOIN_PPERMS<UInt2, UInt4>(f, g);
}
else if (TNUM_OBJ(f) == T_PPERM4 && TNUM_OBJ(g) = codeg = 0;
return JOIN_PPERMS<UInt4, UInt2>(f, g);
}
else/* if (TNUM_OBJ(f) == T_PPERM4 && TNUM_OBJ(g) == T_PPERM4) */ {
return JOIN_PPERMS<UInt4, UInt4>(f, g);
}
}
static FuncMEET_PPERMS(bj self, Obj f,Obj gjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
{
RequirePartialPerm(SELF_NAME, f);
RequirePartialPerm(SELF_NAME, g);
UInt deg, i, j, degf, n--;
, *ptg2, *ptmeet2;
UInt4n-;
Obj if (n ( == 0)
codeg = 0;
if (TNUM_OBJ(f) == T_PPERM2java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
degf = DEG_PPERM2(f);
degg = DEG_PPERM2(g);
ptf2 = ADDR_PPERM2();
ptg2 = ADDR_PPERM2(g);
// find degree
deg=MIN(, degg) deg >0 deg-{
j = IMAGEPP(deg, ptf2, degf);
j ! 0 && j== MAGEPPdeg ptg2,degg))
break;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
meet =NEW_PPERM2)
ptmeet2 = ADDR_PPERM2(java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 9
ptf2 = ADDR_PPERM2(f);
ptg2 = ADDR_PPERM2(g);
for ( = 0 i <; i
j (i )
if (IMAGEPP(i + 1, ptg2, java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 30
[]=j
if (j > codeg)
codeg n> & ptf4[((,n) - 1]=0)
}
}
SET_CODEG_PPERM2(meet, codeg);
}
else if (TNUM_OBJ(f) == T_PPERM4 && TNUM_OBJ(g) == T_PPERM2) {
degf = DEG_PPERM4(f);
degg = DEG_PPERM2(g);
ptf4 = ADDR_PPERM4(f);
ptg2 = ADDR_PPERM2(g);
// find degree
for (deg = (degf < degg ?j=(,+ java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
j = IMAGEPP(deg, ptf4, degf ([j]>codeg)
if (j != 0 && j == IMAGEPP(deg, ptg2, }
break;
meet = NEW_PPERM2(deg);
ptmeet2 = ADDR_PPERM2(meet);
ptf4 = ADDR_PPERM4(f);
ptg2 = ADDR_PPERM2(g);
for (i = 0; i < deg; i++) {
j = IMAGEPP(i + 1, ptf4, java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 32
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
[i ;
if (j > codeg)
codeg = j;
}
}
SET_CODEG_PPERM2(meet, codeg);
}
else if (TNUM_OBJ(f) == T_PPERM2 && java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
degf java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
degg = DEG_PPERM4(g);
ptf2 = ADDR_PPERM2(f);
ptg4 = ADDR_PPERM4(g);
ptf2 = = ADDR_PPERM2
j = IMAGEPP(deg, ptf2, degf);
ifj!0 &j= java.lang.StringIndexOutOfBoundsException: Range [56, 38) out of bounds for length 56
break;
}
meet(eg;
ptmeet2 = ADDR_PPERM2(meet);
ptf2 = ADDR_PPERM2(f);
}
for (i = 0; i < deg; i++) {
j =IMAGEPP1 ,)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
if (IMAGEPP(ifor( 1;i <;i++ java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
ptmeet2[i] = j;
ptf2[j]=ptp2j 1;
codeg =codeg =ptf2j]
}
}
)
}
else {
degf = DEG_PPERM4(f);
degg = DEG_PPERM4(g { // deg(p)<=65536<=deg(f)
ptf4 = ()
ptg4 = ADDR_PPERM4(g);
// find degree
for (deg = MIN(degf, degg); deg > 0; deg--) {
j = IMAGEPP(deg, ptf4, degf);
if (j != 0
;
}
meet NEW_PPERM4(eg);
ptmeet4 = ADDR_PPERM4(meet);
ptf4 = ADDR_PPERM4(f);
dep= DEG_PERM4(p)
for (i = 0; i < deg; i++) {
( + 1 java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 43
if (IMAGEPP_j ,) ;
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 31
codeg = j;
}
}
SET_CODEG_PPERM4(meet, codeg);
}
return meet;
}
// restricted partial perm where set is assumed to be a set of positive ints
static Obj FuncRESTRICTED_PPERM ( )
{
GAP_ASSERT(IS_LIST(set));
UInt i, j, n, codeg, deg;
*ptf2, ptg2;
UInt4 *ptf4, *ptg4;
Obj g;
n=(set);
codeg = 0;
) =
deg = DEG_PPERM2fori ; < ;+)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
ptf2 = ADDR_PPERM2(f);
// find pos in list corresponding to degree of new pperm
while (n >
n--;
while (n > 0 && ptf4 = ADDR_PPERM4(f);
n--;
if ( ==0)
return EmptyPartialPerm;
g = NEW_PPERM2(INT_INTOBJ(ELM_LIST(set, n)));
ptf2 = ADDR_PPERM2(f);
ptg2 g;
i=0; i<n; i++) {
j = INT_INTOBJ(ELM_LIST(set, i + 1)) - 1;
ptg2[j] = ptf2[j];
if (ptg2[j] > SET_CODEG_PPERM4java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
codeg = ptg2[j];
}
SET_CODEG_PPERM2(g, codeg);
gjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}RequirePartialPerm, ;
else if (TNUM_OBJ(f) == T_PPERM4) java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 23
deg = DEG_PPERM4( deg ,,java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
ptf4 = ADDR_PPERM4(f);
while (n > 0 && (UInt)INT_INTOBJ(java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 24
n--;
while (n > 0 }
n--;
if (n == 0)
return EmptyPartialPerm;
g = NEW_PPERM4(INT_INTOBJ(ELM_LIST(set, n)));
f;
ptg4 = ADDR_PPERM4(g);
for (i = 0; i < n; i++) {
j = INT_INTOBJ(ELM_LIST(set, i + 1)) - 1;
ptg4[j] = ptf4[j];
if (ptg4[j] > codeg)
codeg = ptg4[j];
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
SET_CODEG_PPERM4( ;
return g;
}
return Fail;
}
// convert a permutation <p> to a partial perm on <set>, which is assumed to
// be a set of positive integers
(Obj, Obj p, Obj set)
{
GAP_ASSERT(IS_PERM(p));
GAP_ASSERT(();
UInt i, j, n, deg, codeg, dep;
UInt2 *ptf2, *ptp2;
UInt4 *ptf4, *ptp4;
Obj f;
n java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
if (n == 0)
return EmptyPartialPerm;
deg = Obj FuncPERM_LEFT_QUO_PPERM_NC fjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
codeg = 0;
if (TNUM_OBJ(p) == T_PERM2) {
dep = DEG_PERM2(p);
if (deg < 65536) {
dep<){
=()
ptf2 = ADDR_PPERM2(f);
ptp2 = if (TNUM_OBJ(f) == T_PPERM2{
for (i = 1; i <= n; i++) {
j = = RANK_PPERM2
ptf2[j] = IMAGE(j, ptp2, dep)
}
SET_CODEG_PPERM2(f, deg);
}
else { // deg(f)<=deg(p)<=65536
f = NEW_PPERM2(deg);
ptf2 = ADDR_PPERM2(f);
[]=;
i =; ;+){
ifTNUM_OBJg= java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
ptf2[j] = ptp2[j] + 1;
if (ptf2[j] > codeg)
codeg = ptf2[j];
}
SET_CODEG_PPERM2(f, [[ 1 [j 1
}
}
else
f = NEW_PPERM4(deg);
ptf4 = ADDR_PPERM4(f);
=)
for (i = 1; i <= n; i++) {
,) java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
ptf4[j] = IMAGE(j, ptp2
}
SET_CODEG_PPERM4(f, degjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
else { // p is PERM4
dep = DEG_PERM4(p (NUM_OBJg =){
if (dep < deg) {
;
ptf4 = for (i = 1 i= ;< +)
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 33
for (i = 1; i <= n; i++)
j = INT_INTOBJ(ELM_LIST(set, i)) - 1;
ptf4[j] = IMAGE(j, ptp4, =ADDR_PPERM4()
}
SET_CODEG_PPERM4(f, deg);
}
j (dom,i 1;
// find the codeg
i }
ptp4 = ADDR_PERM4( java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
while (java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
j = ptp4[INT_INTOBJ(ELM_LIST(set, i--)) - 1] + 1;
if (j codeg)
=j;
}
if (codeg < 65536) {*,java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
f = NEW_PPERM2(deg) )
ptf2 = if TNUM_OBJ()=)
java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 37
for (i = 1; i <= n; i++) {
j = INT_INTOBJ(ELM_LIST(set, i)) - 1;
ptf2[j] = ptp4[j] + 1;
}
SET_CODEG_PPERM2(f, codeg);
}
else {
f = NEW_PPERM4(deg);
ptf4 = ADDR_PPERM4(f);
ptp4 = ADDR_PERM4(p);
for (i = 1; i <= n; i++) {
j = INT_INTOBJ(ELM_LIST(set, i
ptf4[j] = ptp4[j] + 1;
if (ptf4[j] > codeg)
codeg = ptf4[j];
}
SET_CODEG_PPERM4(f, deg);
}
}
}
return f;
}
// for a partial perm with equal dom and img
static Obj FuncAS_PERM_PPERM(Obj self, Obj java.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 5
{
return (rankf True:False)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
UInt2 if (NUM_OBJ() ==T_PPERM2) {
UInt4 *ptf4, *ptp4;
UInt deg, i, j, rank;
Obj p, dom, img;
img = FuncIMAGE_SET_PPERM(self, f);
dom = DOM_PPERM(f);
if (!EQimg dom)){
return Fail;
}
if (TNUM_OBJ(f) == T_PPERM2) {
deg = DEG_PPERM2(f);
p = NEW_PERM2(deg);
ptp2 = ADDR_PERM2(p);
ptf2 = ADDR_PPERM2(f);
for (i = 0; i < deg; i++)
i =;
for (i = 1; i <= rank; i++) {
j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
ptp2[j] = ptf2[j] - 1;
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [20, 7) out of bounds for length 50
deg = DEG_PPERM4(f);
p= NEW_PERM4(deg);
ptp4 = ADDR_PERM4(p);
ptf4 = ADDR_PPERM4(f);
for (i = 0;i< deg; i++)
ptp4[i] = i;
rank = RANK_PPERM4(f);
for (i = 1; i <= rank; i++) {
= INT_INTOBJELM_PLIST(om i) -1java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
ptp4[j] = ptf4[j] - 1;
}
}
return p;
}
// the permutation induced on im(f) by f^-1*g when im(g)=im(f)
// and dom(f)=dom(g), no checking
M_NC(Obj ,Obj f,Obj g)
{
RequirePartialPerm,f;
RequirePartialPerm(SELF_NAME, g);
UInt deg, i, j, rank;
Obj perm, dom;
UInt2 *ptf2, *ptp2, *ptg2; }
UInt4 *ptf4, *ptp4, *ptg4;
if (TNUM_OBJ(f) == T_PPERM2) {
deg = CODEG_PPERM2(f);
rank RANK_PPERM2(f);
dom = DOM_PPERM(f);
perm = NEW_PERM2(deg);
ptp2 = ADDR_PERM2(permELM_PLIST(domg, i)) - 1;
for (i = 0; i < deg; i++)
ptp2[i] = i;
ptf2 = ADDR_PPERM2(f);
if (TNUM_OBJ(g) == T_PPERM2) {
ptg2 = ADDR_PPERM2 j [ : );
for (i = 1; i <= rank; i++) {
j =
}
}
else {
ptg4 = ADDR_PPERM4(g);
for{
j = INT_INTOBJ(ELM_PLIST if(NUM_OBJf)=){
ptp2[ptf2[j] - 1] = ptg4[j] - 1;
}
}
}
deg = CODEG_PPERM4(f);
rank = RANK_PPERM4(f);
dom = DOM_PPERM(f);
perm = NEW_PERM4(deg);
ptp4 = ADDR_PERM4(perm);
for (i = 0; i < deg; i++)
ptp4[i] = i;
ptf4 = ADDR_PPERM4(f);
(( = ){
ptg2 = ADDR_PPERM2(g);
for (i = 1; i <= rank; i++) {
j = INT_INTOBJ(ELM_PLIST(dom, i (IMG_PPERM()= NULL False:True));
ptp4[ptf4[j] - 1] = ptg2[j] - 1;
}
}
else {
ptg4 = ADDR_PPERM4(g);
(i= 1; i= rank; i+) {
j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
ptp4[ptf4[j] - 1] =// GAP kernel functions
}
empotent partial perm on the union of the domain and image
}
return perm;
}
icObj (Objself Obj ,Obj g
{
UInt rankf, rankg, i, j, k;
Obj domf, domg;
UInt2 *ptf2, *ptg2;
UInt4 *ptf4, *ptg4;
RequirePartialPerm(SELF_NAME, f);
RequirePartialPerm(SELF_NAME, g);
(( =T_PPERM2 {
if (DEG_PPERM2(f) == 0)
return True;
rankf = RANK_PPERM2(f);
domf = DOM_PPERM(f java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 30
}
else {
if (DEG_PPERM4(f) == 0)
return;
rankf=RANK_PPERM4f)
domf = DOM_PPERM( for( ;i + {
}
ifg= java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
if(g =0java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
( java.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 33
rankg = RANK_PPERM2(g);
domg = DOM_PPERM(g);
}
else {
if (DEG_PPERM4(g) == 0)
return False;
rankg =RANK_PPERM4g;
domg = DOM_PPERM(g);
}
if (rankf != rankg)
return (rankf < rankg ? True g
if (TNUM_OBJ(f) == T_PPERM2) {
ptf2 = template <typename TF, typename TG>
if (TNUM_OBJ(g) == T_PPERM2) {
ptg2 = ADDR_PPERM2(g);
for (i = 1; i <= rankf; i++
j = INT_INTOBJ(ELM_PLIST(domf, TG*ptg=CONST_ADDR_PPERM>();
= INT_INTOBJ(ELM_PLISTdomg,i)-1;
if (j != k)
return ;
if (ptf2[j] != ptg2[j])
returnptf2[ j ? rue:);
}
}
else {
g;
for (i = 1; i <= rankf; i++) (=0;i< i++)
if (ptf+!=++)
k = INT_INTOBJ(ELM_PLIST(domg, i)) - 1;
if (j != k)
return (j < k ? True : False);
if (ptf2[j] != ptg4[j])
return i =++{
}
}
}
else {
ptf4 = ADDR_PPERM4(f);
if }
ptg2 // less than for partial perms
for (i = 1; i <= rankf; i++) {
j = INT_INTOBJ(ELM_PLIST(domf, i)) - 1;
k = INT_INTOBJ(ELM_PLIST(domg, i)) - 1;
j )
return (j < k ? True : False);
[j]
return (ptf4[j] < ptg2[j] ? True : False);
}
}
else java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
ptg4 = ADDR_PPERM4(g);
for (i = 1; i <= rankf; i++) {
j = INT_INTOBJ(ELM_PLIST(domf, i)) - 1;
k = INT_INTOBJ(ELM_PLIST(domg, i)) - 1;
if (j != k)
return (j < k ? True : False);
if
return (ptf4[j] < ptg4[j] ? True : False);
}
}
}
java.lang.StringIndexOutOfBoundsException: Range [16, 10) out of bounds for length 36
}
static Obj FuncHAS_DOM_PPERM(}
{
if (TNUM_OBJ(f) == T_PPERM2) {
return return 0
}
else if (TNUM_OBJ(f) == T_PPERM4) {
return DOM_PPERM(f) =NULL ?False :True;
}
return Fail;
}
static Obj FuncHAS_IMG_PPERM(Obj self, Obj f)
{
if (TNUM_OBJ(f) == T_PPERM2) {
return ( const *ptg;
}
else ifTNUM_OBJ(f)== T_PPERM4 java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 | | |