/usr/include/gap/gmpints.h is in gap-dev 4r6p5-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | /****************************************************************************
**
*W gmpints.h GAP source John McDermott
**
**
**
**
*Y Copyright (C) 1996, Lehrstuhl D für Mathematik, RWTH Aachen, Germany
*Y (C) 1998 School Math and Comp. Sci., University of St Andrews, Scotland
*Y Copyright (C) 2002 The GAP Group
**
** This file declares the functions handling gmp integers.
*/
#ifndef GAP_GMPINTS_H
#define GAP_GMPINTS_H
#ifdef USE_GMP
#include <gmp.h>
/****************************************************************************
**
*T TypLimb . . . . . . . . . . . . . . . . . . . . . . . type of a GMP Limb
**
**
**
*/
typedef mp_limb_t TypLimb;
typedef mp_size_t TypGMPSize;
#ifdef SYS_IS_64_BIT
typedef UInt4 TypDigit;
#define NR_HEX_DIGITS 8
#define SaveLimb SaveUInt8
#define LoadLimb LoadUInt8
#define INTEGER_UNIT_SIZE 8
#define INTEGER_ALLOCATION_SIZE 8
#else
typedef UInt2 TypDigit;
#define NR_HEX_DIGITS 4
#define SaveLimb SaveUInt4
#define LoadLimb LoadUInt4
#define INTEGER_UNIT_SIZE 4
#define INTEGER_ALLOCATION_SIZE 4
#endif
#if GMP_LIMB_BITS != NR_HEX_DIGITS * 8
#error Aborting compile: unexpected GMP limb size
#endif
#if GMP_NAIL_BITS != 0
#error Aborting compile: GAP does not support non-zero GMP nail size
#endif
#ifndef __GNU_MP_RELEASE
#if __GMP_MP_RELEASE < 50002
#error Aborting compile: GAP requires GMP 5.0.2 or newer
#endif
#endif
#define NR_DIGIT_BITS (8 * sizeof(TypDigit))
#define INTBASE (1L << NR_DIGIT_BITS)
#define NR_SMALL_INT_BITS (2*NR_DIGIT_BITS - 4)
#define ADDR_INT(obj) ( (TypLimb *)ADDR_OBJ(obj) )
#define SIZE_INT(obj) ( (TypGMPSize)SIZE_OBJ(obj)/sizeof(TypLimb) )
/* SIZE_INT gives a result in limbs */
/**************************************************************************
** The following two functions convert a C Int or UInt respectively into
** a GAP integer, either an immediate, small integer if possible or
** otherwise a new GAP bag with TNUM T_INTPOS or T_INTNEG.
**
*F ObjInt_Int(Int i)
*F ObjInt_UInt(UInt i)
**
****************************************************************************/
Obj ObjInt_Int(Int i);
Obj ObjInt_UInt(UInt i);
/****************************************************************************
**
*/
extern Obj GMP_REDUCE (
Obj gmp );
extern Obj GMP_NORMALIZE (
Obj gmp );
/****************************************************************************
**
*F PrintInt( <int> ) . . . . . . . . . . . . . . . print an integer constant
**
** 'PrintInt' prints the integer <int> in the usual decimal notation.
** 'PrintInt' handles objects of type 'T_INT', 'T_INTPOS' and 'T_INTNEG'.
*/
extern void PrintInt (
Obj op );
/****************************************************************************
**
*F EqInt( <gmpL>, <gmpR> ) . . . . . test if two integers are equal
**
** 'EqInt' returns 1 if the two GMP integer arguments <gmpL> and
** <gmpR> are equal and 0 otherwise.
*/
extern Int EqInt (
Obj opL,
Obj opR );
/****************************************************************************
**
*F LtInt( <gmpL>, <gmpR> ) test if an integer is less than another
**
** 'LtInt' returns 1 if the integer <gmpL> is strictly less than the
** integer <gmpR> and 0 otherwise.
*/
extern Int LtInt (
Obj opL,
Obj opR );
/****************************************************************************
**
*F SumInt( <gmpL>, <gmpR> ) . . . . . . . . . sum of two integers
**
** 'SumInt' returns the sum of the two integer arguments <gmpL> and
** <gmpR>.
**
*/
extern Obj SumInt (
Obj opL,
Obj opR );
/****************************************************************************
**
*F SumOrDiffInt( <gmpL>, <gmpR>, <sign> ) . . . . . . . sum of two integers
**
** 'SumOrDiffInt' returns the sum or difference of the two GMP arguments
** <gmpL> and <gmpR>, depending whether sign is +1 or -1.
**
*/
extern Obj SumOrDiffInt (
Obj opL,
Obj opR,
Int sign );
/****************************************************************************
**
*F DiffInt( <gmpL>, <gmpR> ) . . . . difference of two GMP integers
**
** 'DiffInt' returns the difference of the two integer arguments <gmpL>
** and <gmpR>.
**
*/
extern Obj DiffInt (
Obj opL,
Obj opR );
/****************************************************************************
**
*F ProdInt( <gmpL>, <gmpR> ) . . . . . product of two GMP integers
**
** 'ProdInt' returns the product of the two integer arguments <gmpL>
** and <gmpR>.
**
*/
extern Obj ProdInt (
Obj opL,
Obj opR );
/****************************************************************************
**
*F ModInt( <gmpL>, <gmpR> ) representant of res cl of a GMP integer
**
** 'ModInt' returns the smallest positive representant of the residue
** class of the integer <gmpL> modulo the integer <gmpR>.
**
*/
extern Obj ModInt (
Obj opL,
Obj opR );
/****************************************************************************
**
*F PowInt( <gmpL>, <gmpR> ) . . . . . . . . power of a GMP integer
**
** 'PowInt' returns the <gmpR>-th (a GMP int) power of the GMP integer
** <gmpL>.
**
*/
extern Obj PowInt (
Obj opL,
Obj opR );
/****************************************************************************
**
*F QuoInt( <gmpL>, <gmpR> ) . . . . . quotient of two GMP integers
**
** 'QuoInt' returns the integer part of the two integers <gmpL> and
** <gmpR>.
**
*/
extern Obj QuoInt (
Obj opL,
Obj opR );
/****************************************************************************
**
*F RemInt( <gmpL>, <gmpR> ) . . . . remainder of two GMP integers
**
** 'RemInt' returns the remainder of the quotient of the GMP ints
** <gmpL> and <gmpR>.
**
*/
extern Obj RemInt (
Obj opL,
Obj opR );
/****************************************************************************
**
*F GcdInt( <gmpL>, <gmpR> ) . . . . . . . gcd of two GMP integers
**
** 'GcdInt' returns the gcd of the two integers <gmpL> and <gmpR>.
*/
extern Obj GcdInt (
Obj opL,
Obj opR );
extern Obj FuncLog2Int( Obj self, Obj intnum);
extern Obj AInvInt ( Obj gmp );
/****************************************************************************
**
*F * * * * * * * * * * * * * initialize package * * * * * * * * * * * * * * *
*/
/****************************************************************************
**
*F InitInfoInt() . . . . . . . . . . . . . . . . table of init functions
*/
StructInitInfo * InitInfoInt ( void );
#endif // USE_GMP
#endif // GAP_GMPINTS_H
/****************************************************************************
**
*E gmpints.h . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here
*/
|