/**************************************************************************** ** ** This file is part of GAP, a system for computational discrete algebra. ** ** Copyright of GAP belongs to its developers, whose names are too numerous ** to list here. Please refer to the COPYRIGHT file for details. ** ** SPDX-License-Identifier: GPL-2.0-or-later
*/
/**************************************************************************** ** *F LEN_GF2VEC( <vec> ) . . . . . . . . . . . . . . . . length of a GF vector ** ** 'LEN_GF2VEC' returns the logical length of the GF2 vector <list>, as a C ** integer. ** ** Note that 'LEN_GF2VEC' is a macro, so do not call it with arguments that ** have side effects.
*/ #define LEN_GF2VEC(list) ((Int)(CONST_ADDR_OBJ(list)[1]))
/**************************************************************************** ** *F NUMBER_BLOCKS_GF2VEC( <vec> ) . . . . . . . number of UInt blocks in list
*/ #define NUMBER_BLOCKS_GF2VEC(list) ((LEN_GF2VEC((list)) + BIPEB - 1) / BIPEB)
/**************************************************************************** ** *F BLOCKS_GF2VEC( <list> ) . . . . . . . . . . . first block of a GF2 vector ** ** returns a pointer to the start of the data of the GF2 vector
*/ #define BLOCKS_GF2VEC(list) ((UInt *)(ADDR_OBJ(list) + 2)) #define CONST_BLOCKS_GF2VEC(list) ((const UInt *)(CONST_ADDR_OBJ(list) + 2))
/**************************************************************************** ** *F BLOCK_ELM_GF2VEC( <list>, <pos> ) . . . . . . . . . block of a GF2 vector ** ** 'BLOCK_ELM_GF2VEC' return the block containing the <pos>-th element of ** the GF2 vector <list> as a UInt value, which is also a valid left hand ** side. <pos> must be a positive integer less than or equal to the length ** of <list>. ** ** Note that 'BLOCK_ELM_GF2VEC' is a macro, so do not call it with arguments ** that have side effects.
*/ #define BLOCK_ELM_GF2VEC(list, pos) (BLOCKS_GF2VEC(list)[((pos)-1) / BIPEB]) #define CONST_BLOCK_ELM_GF2VEC(list, pos) \
(CONST_BLOCKS_GF2VEC(list)[((pos)-1) / BIPEB])
/**************************************************************************** ** *F SET_LEN_GF2VEC( <list>, <len> ) . set the logical length of a GF2 vector ** ** 'SET_LEN_GF2VEC' sets the length of the boolean list <list> to the value ** <len>, which must be a positive C integer. ** ** Note that 'SET_LEN_GF2VEC' is a macro, so do not call it with arguments ** that have side effects.
*/ #define SET_LEN_GF2VEC(list, len) (ADDR_OBJ(list)[1] = (Obj)(len))
/**************************************************************************** ** *F MASK_POS_GF2VEC( <pos> ) . . . . bit mask for position of a Boolean list ** ** MASK_POS_GF2VEC(<pos>) returns a UInt with a single set bit in position ** '(<pos>-1) % BIPEB', ** useful for accessing the <pos>-th element of a blist. ** ** Note that 'MASK_POS_GF2VEC' is a macro, so do not call it with arguments ** that have side effects.
*/ #define MASK_POS_GF2VEC(pos) (((UInt)1) << ((pos)-1) % BIPEB)
/**************************************************************************** ** *F ELM_GF2VEC( <list>, <pos> ) . . . . . . . . . . . element of a GF2 vector ** ** 'ELM_GF2VEC' return the <pos>-th element of the GF2 vector <list>, which ** is either 'Z(2)' or '0*Z(2)'. <pos> must be a positive integer less than ** or equal to the length of <list>. ** ** Note that 'ELM_GF2VEC' is a macro, so do not call it with arguments that ** have side effects.
*/ #define ELM_GF2VEC(list, pos) \
((CONST_BLOCK_ELM_GF2VEC(list, pos) & MASK_POS_GF2VEC(pos)) ? GF2One \
: GF2Zero)
/**************************************************************************** ** *F LEN_GF2MAT( <list> ) . . . . . . . . . . . . . . . length of a GF matrix ** ** 'LEN_GF2MAT' returns the logical length of the GF2 matrix <list>, as a C ** integer. ** ** Note that 'LEN_GF2MAT' is a macro, so do not call it with arguments that ** have side effects.
*/ #define LEN_GF2MAT(list) (INT_INTOBJ(CONST_ADDR_OBJ(list)[1]))
/**************************************************************************** ** *F SET_LEN_GF2MAT( <list>, <len> ) . . . . . . set the length of a GF matrix ** ** 'SET_LEN_GF2MAT' sets the logical length of the GF2 matrix <list>, as a C ** integer. ** ** Note that 'SET_LEN_GF2MAT' is a macro, so do not call it with arguments ** that have side effects.
*/ #define SET_LEN_GF2MAT(list, len) (ADDR_OBJ(list)[1] = INTOBJ_INT(len))
/**************************************************************************** ** *F ELM_GF2MAT( <list>, <pos> ) . . . . . . . . . . . element of a GF2 matrix ** ** 'ELM_GF2MAT' returns the <pos>-th element of the GF2 matrix <list>, which ** is a GF2 vector. <pos> must be a positive integer less than or equal to ** the length of <list>. ** ** Note that 'ELM_GF2MAT' is a macro, so do not call it with arguments that ** have side effects.
*/ #define ELM_GF2MAT(list, pos) (CONST_ADDR_OBJ(list)[pos + 1])
/**************************************************************************** ** *F SET_ELM_GF2MAT( <list>, <pos>, <elm> ) . . . set element of a GF2 matrix ** ** 'SET_ELM_GF2MAT' sets the <pos>-th element of the GF2 matrix <list>, ** which must be a GF2 vector. <pos> must be a positive integer less than ** or equal to the length of <list>. ** ** Note that 'ELM_GF2MAT' is a macro, so do not call it with arguments that ** have side effects.
*/ #define SET_ELM_GF2MAT(list, pos, elm) (ADDR_OBJ(list)[pos + 1] = elm)
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.