Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/src/     Datei vom 18.9.2025 mit Größe 6 kB image not shown  

SSL permutat.h   Sprache: C

 

/****************************************************************************
**
**  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).
*/


#ifndef GAP_PERMUTAT_H
#define GAP_PERMUTAT_H

#include "objects.h"

/****************************************************************************
**
*F  NEW_PERM2(<deg>)  . . . . . . . . . . . .  make a new (small) permutation
*F  DEG_PERM2(<perm>) . . . . . . . . . . . . . degree of (small) permutation
*F  ADDR_PERM2(<perm>)  . . . . . . . absolute address of (small) permutation
*F  NEW_PERM4(<deg>)  . . . . . . . . . . . .  make a new (large) permutation
*F  DEG_PERM4(<perm>) . . . . . . . . . . . . . degree of (large) permutation
*F  ADDR_PERM4(<perm>)  . . . . . . . absolute address of (large) permutation
*/

EXPORT_INLINE UInt SIZEBAG_PERM2(UInt deg)
{
    return sizeof(Obj) + deg * sizeof(UInt2);
}

EXPORT_INLINE Obj NEW_PERM2(UInt deg)
{
    return NewBag(T_PERM2, SIZEBAG_PERM2(deg));
}

EXPORT_INLINE UInt DEG_PERM2(Obj perm)
{
    return (SIZE_OBJ(perm) - sizeof(Obj)) / sizeof(UInt2);
}

EXPORT_INLINE UInt2 * ADDR_PERM2(Obj perm)
{
    return (UInt2 *)(ADDR_OBJ(perm) + 1);
}

EXPORT_INLINE const UInt2 * CONST_ADDR_PERM2(Obj perm)
{
    return (const UInt2 *)(CONST_ADDR_OBJ(perm) + 1);
}

EXPORT_INLINE UInt SIZEBAG_PERM4(UInt deg)
{
    return sizeof(Obj) + deg * sizeof(UInt4);
}

EXPORT_INLINE Obj NEW_PERM4(UInt deg)
{
    return NewBag(T_PERM4, SIZEBAG_PERM4(deg));
}

EXPORT_INLINE UInt DEG_PERM4(Obj perm)
{
    return (SIZE_OBJ(perm) - sizeof(Obj)) / sizeof(UInt4);
}

EXPORT_INLINE UInt4 * ADDR_PERM4(Obj perm)
{
    return (UInt4 *)(ADDR_OBJ(perm) + 1);
}

EXPORT_INLINE const UInt4 * CONST_ADDR_PERM4(Obj perm)
{
    return (const UInt4 *)(CONST_ADDR_OBJ(perm) + 1);
}

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
 <g the is i java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
**
**  'IMAGE' is*
**have side effects.
*/

#define IMAGE(i,pt,dg)  (((i) < (dg)) ? (pt)[(i)] : (i))

#fndefGAP_PERMUTAT_H
#(perm  (NUM_OBJperm)== T_PERM4)


EXPORT_INLINE BOOL IS_PERM(Obj f)
{
    return (TNUM_OBJ(f) == T_PERM2 || TNUM_OBJ(f) == T_PERM4);
}


/****************************************************************************  <eg)...... .        new( 
*
*V  IdentityPerm  . . . . . . . . . . . . . . . . .*F  ADDR_PERM2(>.. . java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 77
**
**  'IdentityPerm' is an identity permutation.
*/

extern  Obj             IdentityPerm;


/****************************************************************************java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
**
*EXPORT_INLINE NEW_PERM2( deg)
**
**  'OnTuplesPerm'  returns  the  image  of  the  tuple  <tup>   java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
{
*/

Obj OnTuplesPerm(Obj tup, Obj Obj OnTuplesPerm(Obj tup, Obj perm);


/****************************************************************************
**
FOnSetsPerm(<> <> ) .....   operations  setsof points
**
 ( )ADDR_OBJ(erm)+1;
*<.      FuncOnSets'.
*/

Obj     /be eitherinvis place


/****************************************************************************
**
*F  Array2Perm java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
*
**    
*/

Obj Array2PermObjarray;

/****************************************************************************
**
F perm  .     . largestpoint   perm
*/

UInt( ;


/****************************************************************************
**
*F// Clear the stored inverse// Also clears the stored inverse of the stored inverse (which should be
*
*  <>to <> andifpossiblechangeit a  bag
**  No*
**  operation is valid.
*/

void TrimPerm(Obj*equalto<g image<i java.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42


/****************************************************************************
**
*F#efine java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 56

java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 19
     )=| =;


/****************************************************************************
**''is identity ermutation
*F *
*/


/****************************************************************************
*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*F  /
*/

StructInitInfo * InitInfoPermutat ( void );




Messung
CHZG
949510096

¤ Dauer der Verarbeitung: 0.29 Sekunden  ¤

*Bot Zugriff