static Obj FuncLEN_LIST(Obj self, Obj list)
{ // special case for plain lists (avoid conversion back and forth) if ( IS_PLIST(list) ) { return INTOBJ_INT( LEN_PLIST( list ) );
}
// generic case (will signal an error if <list> is not a list) else { return AttrLENGTH( LengthAttr, list );
}
}
staticInt LenListError(Obj list)
{
RequireArgument("Length", list, "must be a list");
}
staticInt LenListObject(Obj obj)
{
Obj len;
len = AttrLENGTH( LengthAttr, obj ); if (!IS_NONNEG_INTOBJ(len)) {
RequireArgumentEx("Length", len, 0, "method must return a non-negative small integer");
} return INT_INTOBJ( len );
}
Obj ELM_MAT(Obj mat, Obj row, Obj col)
{
Obj elm; if (IS_POS_INTOBJ(row) && IS_POS_INTOBJ(col) && IS_PLIST(mat)) { Int r = INT_INTOBJ(row); if (r <= LEN_PLIST(mat)) {
Obj rowlist = ELM_PLIST(mat, r); Int c = INT_INTOBJ(col);
if (!rowlist)
ErrorMayQuit("Matrix Element: <mat>[%d] must have an assigned value",
(Int)r, (Int)c); if (IS_PLIST(rowlist) && c <= LEN_PLIST(rowlist)) {
elm = ELM_PLIST(rowlist, c); if (!elm)
ErrorMayQuit("Matrix Element: <mat>[%d,%d] must have an assigned value",
(Int)r, (Int)c); return elm;
}
// fallback to generic list access code (also triggers error if // row isn't a list) return ELM_LIST(rowlist, c);
}
}
elm = DoOperation3Args(ElmMatOper, mat, row, col); if (elm == 0) {
ErrorMayQuit("Matrix access method must return a value", 0, 0);
} return elm;
}
/**************************************************************************** ** *FElmsListDefault(<list>,<poss>)...defaultfunctionfor`ELMS_LIST' ** **Createanewplainlistasresult.<list>mustbesmall.
*/
Obj ElmsListDefault (
Obj list,
Obj poss )
{
Obj elms; // selected sublist, result
Obj elm; // one element from <list> Int lenPoss; // length of <positions> Int pos; // <position> as integer Int inc; // increment in a range Int i; // loop variable
// select no element if ( LEN_LIST(poss) == 0 ) {
elms = NewEmptyPlist();
}
// general code elseif ( ! IS_RANGE(poss) ) {
// get the length of <positions> // OK because all positions lists are small
lenPoss = LEN_LIST( poss );
// make the result list
elms = NEW_PLIST( T_PLIST, lenPoss );
SET_LEN_PLIST( elms, lenPoss );
// loop over the entries of <positions> and select for ( i = 1; i <= lenPoss; i++ ) {
// get <position>
Obj p = ELMW_LIST(poss, i); if (!IS_INTOBJ(p)) {
ErrorMayQuit("List Elements: position is too large for " "this type of list", 0, 0);
}
pos = INT_INTOBJ(p);
// select the element
elm = ELM0_LIST( list, pos ); if ( elm == 0 ) {
ErrorMayQuit( "List Elements: <list>[%d] must have an assigned value",
(Int)pos, 0);
}
// assign the element into <elms>
SET_ELM_PLIST( elms, i, elm );
// notify Gasman
CHANGED_BAG( elms );
}
}
// special code for ranges else {
// get the length of <list> Int lenList = LEN_LIST( list );
// get the length of <positions>, the first elements, and the inc.
lenPoss = GET_LEN_RANGE( poss );
pos = GET_LOW_RANGE( poss );
inc = GET_INC_RANGE( poss );
// check that no <position> is larger than 'LEN_LIST(<list>)' if ( lenList < pos ) {
ErrorMayQuit( "List Elements: <list>[%d] must have an assigned value",
(Int)pos, 0);
} if ( lenList < pos + (lenPoss-1) * inc ) {
ErrorMayQuit( "List Elements: <list>[%d] must have an assigned value",
(Int)pos + (lenPoss - 1) * inc, 0);
}
// make the result list
elms = NEW_PLIST( T_PLIST, lenPoss );
SET_LEN_PLIST( elms, lenPoss );
// loop over the entries of <positions> and select for ( i = 1; i <= lenPoss; i++, pos += inc ) {
// select the element
elm = ELMV0_LIST( list, pos ); if ( elm == 0 ) {
ErrorMayQuit( "List Elements: <list>[%d] must have an assigned value",
(Int)pos, 0);
}
// assign the element to <elms>
SET_ELM_PLIST( elms, i, elm );
staticvoid AsssListError(Obj list, Obj poss, Obj objs)
{
RequireArgument("List Assignments", list, "must be a list");
}
void AsssListDefault (
Obj list,
Obj poss,
Obj objs )
{ Int lenPoss; // length of <positions>
Obj p; // <position> Int pos; // <position> as integer Int inc; // increment in a range
Obj obj; // one element from <objs> Int i; // loop variable
// get the length of <positions>
lenPoss = LEN_LIST( poss );
// loop over the entries of <positions> and select for ( i = 1; i <= lenPoss; i++ ) {
// get <position>
p = ELMW_LIST( poss, i );
// select the element
obj = ELMW_LIST( objs, i ); if (IS_INTOBJ(p) )
{ // assign the element into <elms>
ASS_LIST( list, INT_INTOBJ(p), obj );
} else
ASSB_LIST(list, p, obj);
}
}
// special code for ranges else {
// get the length of <positions>
lenPoss = GET_LEN_RANGE( poss );
pos = GET_LOW_RANGE( poss );
inc = GET_INC_RANGE( poss );
// loop over the entries of <positions> and select for ( i = 1; i <= lenPoss; i++, pos += inc ) {
// select the element
obj = ELMW_LIST( objs, i );
// assign the element to <elms>
ASS_LIST( list, pos, obj );
staticBOOL IsSSortListDefault(Obj list)
{ Int lenList;
Obj elm1;
Obj elm2; Int i;
// get the length of the list
lenList = LEN_LIST( list );
// special case for the empty list if ( lenList == 0 ) { returnTRUE;
}
// get the first element
elm1 = ELM0_LIST(list, 1);
if (!elm1) { returnFALSE;
}
// compare each element with its precursor for ( i = 2; i <= lenList; i++ ) {
elm2 = ELM0_LIST(list, i); if (!elm2) { returnFALSE;
} if ( ! LT( elm1, elm2 ) ) { returnFALSE;
}
elm1 = elm2;
}
staticBOOL IsPossListDefault(Obj list)
{ Int lenList; // length of <list>
Obj elm; // one element of <list> Int i; // loop variable
// get the length of the variable
lenList = LEN_LIST( list );
// loop over the entries of the list for ( i = 1; i <= lenList; i++ ) {
elm = ELMV0_LIST( list, i );
// if it has a hole then it isn't a poss list if ( elm == 0) returnFALSE;
/* if it's a small integer and non-positive then
it's not a poss list */ if ( IS_INTOBJ(elm)) { if (INT_INTOBJ(elm) <= 0) returnFALSE;
} /* or if it's not a small integer or a positive large integer then it's
not a poss list */ elseif (TNUM_OBJ(elm) != T_INTPOS) returnFALSE;
}
static Obj PosListError(Obj list, Obj obj, Obj start)
{
RequireArgument("Position", list, "must be a list");
}
static Obj PosListDefault (
Obj list,
Obj obj,
Obj start )
{ Int lenList;
Obj elm; Int i;
/* if the starting position is too big to be a small int
then there can't be anything to find */ if (!IS_INTOBJ(start)) return Fail;
// get the length of the list
lenList = LEN_LIST( list );
// loop over all bound entries of the list, and compare against <obj> for ( i = INT_INTOBJ(start)+1; i <= lenList; i++ ) {
elm = ELMV0_LIST( list, i ); if ( elm != 0 && EQ( elm, obj ) ) { break;
}
}
// return the position if found, and 0 otherwise if ( i <= lenList ) { return INTOBJ_INT(i);
} else { return Fail;
}
}
/**************************************************************************** ** *FElmListLevel(<lists>,<pos>,<level>)................... *F.............selectanelementofseverallistsinparallel ** **'ElmListLevel'eitherselectsanelementfromalllistsinparallelif **<level>is1,orrecursesif<level>isgreaterthan1.
*/ void ElmListLevel (
Obj lists,
Obj ixs, Int level )
{ Int len; // length of <lists>
Obj list; // one list from <lists>
Obj elm; // selected element from <list> Int i; // loop variable
Obj pos;
Obj row;
Obj col;
RequirePlainList("List Elements", lists);
// if <level> is one, perform the replacements if ( level == 1 ) {
// loop over the elements of <lists> (which must be a plain list)
len = LEN_PLIST( lists ); for ( i = 1; i <= len; i++ ) {
// get the list
list = ELM_PLIST( lists, i );
// select the element switch(LEN_PLIST(ixs)) { case1:
pos = ELM_PLIST(ixs,1); if (IS_INTOBJ(pos))
elm = ELM_LIST( list, INT_INTOBJ(pos) ); else
elm = ELMB_LIST(list, pos); break;
case2:
row = ELM_PLIST(ixs, 1);
col = ELM_PLIST(ixs, 2);
elm = ELM_MAT(list, row, col); break;
default:
elm = ELMB_LIST(list, ixs);
}
// replace the list with the element
SET_ELM_PLIST( lists, i, elm );
// notify Gasman
CHANGED_BAG( lists );
}
RetypeBag(lists, T_PLIST_DENSE);
}
// otherwise recurse else {
// loop over the elements of <lists> (which must be a plain list)
len = LEN_PLIST( lists ); for ( i = 1; i <= len; i++ ) {
// get the list
list = ELM_PLIST( lists, i );
// recurse
ElmListLevel( list, ixs, level-1 );
}
}
}
/**************************************************************************** ** *FElmsListLevel(<lists>,<poss>,<level>).................. *F..........selectseveralelementsofseverallistsinparallel ** **'ElmsListLevel'eitherselectselementsfromalllistsinparallelif **<level>is1,orrecursesif<level>isgreaterthan1.
*/ void ElmsListLevel (
Obj lists,
Obj poss, Int level )
{ Int len; // length of <lists>
Obj list; // one list from <lists>
Obj elm; // selected elements from <list> Int i; // loop variable
RequirePlainList("List Elements", lists);
// if <level> is one, perform the replacements if ( level == 1 ) {
// loop over the elements of <lists> (which must be a plain list)
len = LEN_PLIST( lists ); for ( i = 1; i <= len; i++ ) {
// get the list
list = ELM_PLIST( lists, i );
// select the elements
elm = ELMS_LIST( list, poss );
// replace the list with the elements
SET_ELM_PLIST( lists, i, elm );
// notify Gasman
CHANGED_BAG( lists );
}
/* Since the elements of lists are now mutable lists (madebyELMS_LISTinthelistabove),wecannotremembertoomuch
about them */
RetypeBag(lists, T_PLIST_DENSE);
}
// otherwise recurse else {
// loop over the elements of <lists> (which must be a plain list)
len = LEN_PLIST( lists ); for ( i = 1; i <= len; i++ ) {
// get the list
list = ELM_PLIST( lists, i );
// recurse
ElmsListLevel( list, poss, level-1 );
}
RetypeBag(lists, T_PLIST_DENSE);
}
}
/**************************************************************************** ** *FAssListLevel(<lists>,<ixs>,<objs>,<level>)............... *F.............assignanelementtoseverallistsinparallel ** **'AssListLevel'eitherassignsanelementtoalllistsinparallelif **<level>is1,orrecursesif<level>isgreaterthan1.
*/ void AssListLevel (
Obj lists,
Obj ixs,
Obj objs, Int level )
{ Int len; // length of <lists> and <objs>
Obj list; // one list of <lists>
Obj obj; // one value from <objs> Int i; // loop variable
Obj pos;
Obj row;
Obj col;
/**************************************************************************** ** *FAsssListLevel(<lists>,<poss>,<objs>,<level>).............. *F..........assignseveralelementstoseverallistsinparallel ** **'AsssListLevel'eitherassignselementstoalllistsinparallelif **<level>is1,orrecursesif<level>isgreaterthan1.
*/ void AsssListLevel (
Obj lists,
Obj poss,
Obj objs, Int lev )
{ Int len; // length of <lists> and <objs>
Obj list; // one list of <lists>
Obj obj; // one value from <objs> Int i; // loop variable
flags = FLAGS_FILT(filter); if (IS_SUBSET_FLAGS(flags, FLAGS_FILT(IsSSortListProp))) { new = SetFiltListTNums[TNUM_OBJ(list)][FN_IS_DENSE]; if ( new < 0 ) goto error; new = SetFiltListTNums[TNUM_OBJ(list)][FN_IS_SSORT]; if ( new > 0 ) RetypeBag( list, new ); elsegoto error;
} return0;
// setting of filter failed
error:
ErrorMayQuit("filter not possible for %s", (Int)TNAM_OBJ(list), 0); return0;
}
// POS_LIST can take 2 or 3 arguments; since NewOperation ignores the // handler for variadic operations, use DoOperation0Args as a placeholder.
{ "POS_LIST", -1, "list, obj[, start]", &PosListOper, DoOperation0Args, "src/lists.c:POS_LIST" },
// make and install the 'POS_LIST' operation
InitHandlerFunc( PosListHandler2, "src/lists.c:PosListHandler2" );
InitHandlerFunc( PosListHandler3, "src/lists.c:PosListHandler3" );
// import small list machinery from the library
ImportFuncFromLibrary("IsSmallList", &IsSmallListFilt);
ImportFuncFromLibrary("HasIsSmallList", &HasIsSmallListFilt);
ImportFuncFromLibrary("SetIsSmallList", &SetIsSmallList);
// make and install the 'IS_LIST' filter for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(IsListFuncs[ type ] == 0);
IsListFuncs[ type ] = AlwaysNo;
} for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
IsListFuncs[ type ] = AlwaysYes;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
IsListFuncs[ type ] = IsListObject;
}
// make and install the 'IS_SMALL_LIST' filter // non-lists are not small lists for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(IsSmallListFuncs[ type ] == 0);
IsSmallListFuncs[ type ] = AlwaysNo;
} // internal lists ARE small lists for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
IsSmallListFuncs[ type ] = AlwaysYes;
} // external lists need to be asked for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
IsSmallListFuncs[ type ] = IsSmallListObject;
}
// make and install the 'LEN_LIST' function for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(LenListFuncs[ type ] == 0);
LenListFuncs[ type ] = LenListError;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
LenListFuncs[ type ] = LenListObject;
}
// make and install the 'LENGTH' function for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(LengthFuncs[ type ] == 0);
LengthFuncs[ type ] = LengthError;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
LengthFuncs[ type ] = LengthObject;
} for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
LengthFuncs[ type ] = LengthInternal;
}
// make and install the 'ISB_LIST' operation for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
IsbListFuncs[ type ] = IsbListError;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
IsbListFuncs[ type ] = IsbListObject;
}
// make and install the 'ELM0_LIST' operation for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(Elm0ListFuncs[ type ] == 0);
Elm0ListFuncs[ type ] = Elm0ListError;
assert(Elm0vListFuncs[ type ] == 0);
Elm0vListFuncs[ type ] = Elm0ListError;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
Elm0ListFuncs[ type ] = Elm0ListObject;
Elm0vListFuncs[ type ] = Elm0ListObject;
}
// make and install ELM_DEFAULT_LIST operation // we install this for all TNUMs, as the default implementation delegates // to other list operations, we can error if appropriate for (type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++) {
ElmDefListFuncs[type] = ElmDefListDefault;
} for (type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++) {
ElmDefListFuncs[type] = ElmDefListObject;
}
// make and install the 'ELM_LIST' operation for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(ElmListFuncs[ type ] == 0);
ElmListFuncs[ type ] = ElmListError;
assert(ElmvListFuncs[ type ] == 0);
ElmvListFuncs[ type ] = ElmListError;
assert(ElmwListFuncs[ type ] == 0);
ElmwListFuncs[ type ] = ElmListError;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
ElmListFuncs[ type ] = ElmListObject;
ElmvListFuncs[ type ] = ElmListObject;
ElmwListFuncs[ type ] = ElmListObject;
}
// make and install the 'ELMS_LIST' operation for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(ElmsListFuncs[ type ] == 0);
ElmsListFuncs[ type ] = ElmsListError;
} for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
ElmsListFuncs[ type ] = ElmsListDefault;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
ElmsListFuncs[ type ] = ElmsListObject;
}
// make and install the 'UNB_LIST' operation for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(UnbListFuncs[ type ] == 0);
UnbListFuncs[ type ] = UnbListError;
} for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
UnbListFuncs[ type ] = 0;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
UnbListFuncs[ type ] = UnbListObject;
}
// make and install the 'ASS_LIST' operation for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(AssListFuncs[ type ] == 0);
AssListFuncs[ type ] = AssListError;
} for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
AssListFuncs[ type ] = 0;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
AssListFuncs[ type ] = AssListObject;
}
// make and install the 'ASSS_LIST' operation for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(AsssListFuncs[ type ] == 0);
AsssListFuncs[ type ] = AsssListError;
} for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
AsssListFuncs[ type ] = AsssListDefault;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
AsssListFuncs[ type ] = AsssListObject;
}
// make and install the 'IS_DENSE_LIST' filter for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(IsDenseListFuncs[ type ] == 0);
IsDenseListFuncs[ type ] = AlwaysNo;
} for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
IsDenseListFuncs[ type ] = 0;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
IsDenseListFuncs[ type ] = IsDenseListObject;
}
// make and install the 'IS_HOMOG_LIST' filter for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(IsHomogListFuncs[ type ] == 0);
IsHomogListFuncs[ type ] = AlwaysNo;
} for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
IsHomogListFuncs[ type ] = 0;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
IsHomogListFuncs[ type ] = IsHomogListObject;
}
// make and install the 'IS_TABLE_LIST' filter for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(IsTableListFuncs[ type ] == 0);
IsTableListFuncs[ type ] = AlwaysNo;
} for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
IsTableListFuncs[ type ] = 0;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
IsTableListFuncs[ type ] = IsTableListObject;
}
// make and install the 'IS_SSORT_LIST' property for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(IsSSortListFuncs[ type ] == 0);
IsSSortListFuncs[ type ] = AlwaysNo;
} for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
IsSSortListFuncs[ type ] = 0;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
IsSSortListFuncs[ type ] = IsSSortListObject;
}
// make and install the 'IS_POSS_LIST' property for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(IsPossListFuncs[ type ] == 0);
IsPossListFuncs[ type ] = AlwaysNo;
} for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
IsPossListFuncs[ type ] = 0;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
IsPossListFuncs[ type ] = IsPossListObject;
}
// make and install the 'POS_LIST' operation for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(PosListFuncs[ type ] == 0);
PosListFuncs[ type ] = PosListError;
} for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
PosListFuncs[ type ] = 0;
} for ( type = FIRST_EXTERNAL_TNUM; type <= LAST_EXTERNAL_TNUM; type++ ) {
PosListFuncs[ type ] = PosListObject;
}
// install the error functions into the other tables for ( type = FIRST_REAL_TNUM; type <= LAST_REAL_TNUM; type++ ) {
assert(PlainListFuncs [ type ] == 0);
PlainListFuncs [ type ] = PlainListError;
}
// install tests for being copyable for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type += 2 ) {
IsCopyableObjFuncs[ type ] = AlwaysYes;
IsCopyableObjFuncs[ type+IMMUTABLE ] = AlwaysYes;
}
// install the default printers for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type++ ) {
PrintObjFuncs [ type ] = PrintListDefault;
}
// initialise filter table for ( type = FIRST_LIST_TNUM; type <= LAST_LIST_TNUM; type +=2 ) {
ClearFiltsTNums [ type ] = 0;
ClearFiltsTNums [ type +IMMUTABLE ] = 0; for ( i = 0; i <= LAST_FN; i++ ) {
SetFiltListTNums [ type ][i] = 0;
SetFiltListTNums [ type +IMMUTABLE ][i] = 0;
ResetFiltListTNums[ type ][i] = 0;
ResetFiltListTNums[ type +IMMUTABLE ][i] = 0;
HasFiltListTNums [ type ][i] = -1;
HasFiltListTNums [ type +IMMUTABLE ][i] = -1;
}
}
// fix unknown list types for ( i = FIRST_LIST_TNUM; i <= LAST_LIST_TNUM; i +=2 ) {
GAP_ASSERT( TNAM_TNUM(i) );
GAP_ASSERT( TNAM_TNUM(i + IMMUTABLE) );
}
for (i = FIRST_LIST_TNUM; i <= LAST_LIST_TNUM; i += 2) {
GAP_ASSERT(UnbListFuncs[i]);
GAP_ASSERT(AssListFuncs[i]);
} for (i = FIRST_LIST_TNUM; i <= LAST_LIST_TNUM; i++) {
GAP_ASSERT(IsDenseListFuncs[i]);
GAP_ASSERT(IsHomogListFuncs[i]);
GAP_ASSERT(IsTableListFuncs[i]);
GAP_ASSERT(IsSSortListFuncs[i]);
GAP_ASSERT(IsPossListFuncs[i]);
GAP_ASSERT(PosListFuncs[i]);
GAP_ASSERT(IsSSortListFuncs[i]);
GAP_ASSERT(IsSSortListFuncs[i]);
}
// check that all relevant `ClearFiltListTNums' are installed for ( i = FIRST_LIST_TNUM; i <= LAST_LIST_TNUM; i++ ) { if ( ClearFiltsTNums[i] == 0 ) {
Pr( "#W ClearFiltsListTNums [%s] missing\n",
(Int)TNAM_TNUM(i), 0);
success = 0;
}
}
// check that all relevant `HasFiltListTNums' are installed for ( i = FIRST_LIST_TNUM; i <= LAST_LIST_TNUM; i++ ) { for ( j = 0; j < ARRAY_SIZE(fnums); j++ ) { if ( HasFiltListTNums[i][fnums[j]] == -1 ) {
Pr( "#W HasFiltListTNums [%s] [%s] missing\n",
(Int)TNAM_TNUM(i), (Int)fnams[j] );
success = 0;
HasFiltListTNums[i][fnums[j]] = 0;
}
}
}
// check that all relevant `SetFiltListTNums' are installed for ( i = FIRST_LIST_TNUM; i <= LAST_LIST_TNUM; i++ ) { for ( j = 0; j < ARRAY_SIZE(fnums); j++ ) { if ( SetFiltListTNums[i][fnums[j]] == 0 ) {
Pr( "#W SetFiltListTNums [%s] [%s] missing\n",
(Int)TNAM_TNUM(i), (Int)fnams[j] );
success = 0;
}
}
}
// check that all relevant `ResetFiltListTNums' are installed for ( i = FIRST_LIST_TNUM; i <= LAST_LIST_TNUM; i++ ) { for ( j = 0; j < ARRAY_SIZE(fnums); j++ ) { if ( ResetFiltListTNums[i][fnums[j]] == 0 ) {
Pr( "#W ResetFiltListTNums [%s] [%s] missing\n",
(Int)TNAM_TNUM(i), (Int)fnams[j] );
success = 0;
}
}
}
// if a tnum has a filter, reset must change the tnum for ( i = FIRST_LIST_TNUM; i <= LAST_LIST_TNUM; i++ ) { for ( j = 0; j < ARRAY_SIZE(fnums); j++ ) { if ( HasFiltListTNums[i][fnums[j]] ) { Intnew; new = ResetFiltListTNums[i][fnums[j]]; if ( new == i ) { continue; // filter coded into the representation
// if a tnum has a filter, set must not change the tnum for ( i = FIRST_LIST_TNUM; i <= LAST_LIST_TNUM; i++ ) { for ( j = 0; j < ARRAY_SIZE(fnums); j++ ) { if ( HasFiltListTNums[i][fnums[j]] ) { Intnew; new = SetFiltListTNums[i][fnums[j]]; if ( new != -1 && new != i ) {
Pr( "#W SetFiltListTNums [%s] [%s] must not change\n",
(Int)TNAM_TNUM(i), (Int)fnams[j] );
success = 0;
}
}
}
}
// check implications for ( i = FIRST_LIST_TNUM; i <= LAST_LIST_TNUM; i++ ) {
if ( (i & IMMUTABLE) == 0 ) { if ( ClearFiltsTNums[i]+IMMUTABLE != ClearFiltsTNums[i+IMMUTABLE]) {
Pr( "#W ClearFiltsTNums [%s] mismatch between mutable and immutable\n",
(Int)TNAM_TNUM(i), 0 );
success = 0;
} for ( j = 0; j < ARRAY_SIZE(fnums); j++ ) {
if ( HasFiltListTNums[i][fnums[j]] !=
HasFiltListTNums[i+IMMUTABLE][fnums[j]]) {
Pr( "#W HasFiltListTNums [%s] [%s] mismatch between mutable and immutable\n",
(Int)TNAM_TNUM(i), (Int)fnams[j] );
success = 0;
}
if ( (SetFiltListTNums[i][fnums[j]] | IMMUTABLE) !=
SetFiltListTNums[i+IMMUTABLE][fnums[j]]) {
Pr( "#W SetFiltListTNums [%s] [%s] mismatch between mutable and immutable\n",
(Int)TNAM_TNUM(i), (Int)fnams[j] );
success = 0;
}
if ( (ResetFiltListTNums[i][fnums[j]] | IMMUTABLE) !=
ResetFiltListTNums[i+IMMUTABLE][fnums[j]]) {
Pr( "#W ResetFiltListTNums [%s] [%s] mismatch between mutable and immutable\n",
(Int)TNAM_TNUM(i), (Int)fnams[j] );
success = 0;
}
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.183Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-27)
¤
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.