/**************************************************************************** ** ** 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 ** ** This file defines the functions for permutations (small and large).
*/
EXPORT_INLINE Obj STOREDINV_PERM(Obj perm)
{
Obj inv = ADDR_OBJ(perm)[0]; // Check inv has the same TNAM as perm. // This is checked below in SET_STOREDINV_PERM, but could // be invalidated if either perm or inv is changed in-place
GAP_ASSERT(!inv || (TNUM_OBJ(perm) == TNUM_OBJ(inv))); return inv;
}
// SET_STOREDINV_PERM should only be used in neither perm, nor inv has // a stored inverse already. It's OK (although inefficient) if perm and inv // are identical
EXPORT_INLINE void SET_STOREDINV_PERM(Obj perm, Obj inv)
{ // check for the possibility that inv is in a different representation to // perm. It could be that perm actually acts on < 2^16 points but is in // PERM4 representation and some clever code has represented the inverse // as PERM2. It could be that someone introduces a new representation // altogether if (TNUM_OBJ(inv) == TNUM_OBJ(perm)) {
GAP_ASSERT(STOREDINV_PERM(perm) == 0 && STOREDINV_PERM(inv) == 0);
ADDR_OBJ(perm)[0] = inv;
CHANGED_BAG(perm);
ADDR_OBJ(inv)[0] = perm;
CHANGED_BAG(inv);
}
}
// Clear the stored inverse. This is required if 'perm' changes TNUM. // Also clears the stored inverse of the stored inverse (which should be // perm).
EXPORT_INLINE void CLEAR_STOREDINV_PERM(Obj perm)
{
Obj inv = ADDR_OBJ(perm)[0]; if (inv) {
ADDR_OBJ(inv)[0] = 0;
ADDR_OBJ(perm)[0] = 0;
}
}
/**************************************************************************** ** *F IMAGE(<i>,<pt>,<dg>) . . . . . . image of <i> under <pt> of degree <dg> ** ** 'IMAGE' returns the image of the point <i> under the permutation of ** degree <dg> pointed to by <pt>. If the point <i> is greater than or ** equal to <dg> the image is <i> itself. ** ** 'IMAGE' is implemented as a macro so do not use it with arguments that ** have side effects.
*/ #define IMAGE(i,pt,dg) (((i) < (dg)) ? (pt)[(i)] : (i))
/**************************************************************************** ** *F OnTuplesPerm( <tup>, <perm> ) . . . . operations on tuples of points ** ** 'OnTuplesPerm' returns the image of the tuple <tup> under the ** permutation <perm>. It is called from 'FuncOnTuples'.
*/
Obj OnTuplesPerm(Obj tup, Obj perm);
/**************************************************************************** ** *F OnSetsPerm( <set>, <perm> ) . . . . . . . . operations on sets of points ** ** 'OnSetsPerm' returns the image of the tuple <set> under the permutation ** <perm>. It is called from 'FuncOnSets'.
*/
Obj OnSetsPerm(Obj set, Obj perm);
/**************************************************************************** ** *F Array2Perm( <array> ) . . . . . . . . . convert array of cycles into perm ** ** This function may be used by C code generated by the GAP compiler.
*/
Obj Array2Perm(Obj array);
/**************************************************************************** ** *F LargestMovedPointPerm(perm) . . . . . . . . largest point moved by a perm
*/
UInt LargestMovedPointPerm(Obj perm);
/**************************************************************************** ** *F TrimPerm( <perm>, <m> ) . . . . . . . trim the permutation to degree <m> ** ** Trim <perm> to degree <m> and if possible change it to a T_PERM2 bag. ** No checks are performed, the caller is responsible for ensuring that this ** operation is valid.
*/ void TrimPerm(Obj perm, UInt m);
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.