
FLINT Fast Library for Number Theory Version 2.4.4 17 June 2014 William Hart∗, Fredrik Johanssony, Sebastian Pancratzz ∗ EPSRC Grant EP/G004870/1, DFG Priority Program SPP1489 y Supported by Austrian Science Foundation (FWF) Grant Y464-N18 z Supported by European Research Council Grant 204083 Contents 1 Introduction1 2 Configuring FLINT3 3 TLS, reentrancy and single mode5 4 ABI and architecture support7 5 C++ wrapper9 6 Garbage collection 11 7 Building, testing, installing and using FLINT 13 8 FLINT extension modules 15 9 Test code 17 10 Reporting bugs 19 11 Contributors 21 12 Tuning FLINT 23 13 Example programs 25 14 FLINT macros 27 15 Memory management 29 16 Temporary allocation 31 17 Platform-safe types, format specifiers and constants 33 18 fmpz 35 18.1 Introduction.................................. 35 18.2 Simple example................................ 36 18.3 Memory management ............................ 36 18.4 Random generation.............................. 36 18.5 Conversion .................................. 37 18.6 Input and output............................... 39 18.7 Basic properties and manipulation ..................... 40 18.8 Comparison.................................. 42 18.9 Basic arithmetic ............................... 42 18.10 Greatest common divisor .......................... 47 18.11 Modular arithmetic.............................. 48 18.12 Bit packing and unpacking ......................... 48 Contents iii 18.13 Logic Operations............................... 49 18.14 Chinese remaindering ............................ 50 18.15 Primality testing............................... 51 19 fmpz vec 53 19.1 Memory management ............................ 53 19.2 Randomisation ................................ 53 19.3 Bit sizes and norms.............................. 53 19.4 Input and output............................... 54 19.5 Conversions.................................. 54 19.6 Assignment and basic manipulation .................... 55 19.7 Comparison.................................. 55 19.8 Sorting..................................... 55 19.9 Addition and subtraction .......................... 56 19.10 Scalar multiplication and division...................... 56 19.11 Sums and products.............................. 58 19.12 Reduction mod p ............................... 58 19.13 Gaussian content............................... 58 20 fmpz factor 59 20.1 Factoring integers .............................. 59 21 fmpz mat 61 21.1 Introduction.................................. 61 21.2 Simple example................................ 61 21.3 Memory management ............................ 62 21.4 Basic assignment and manipulation..................... 62 21.5 Random matrix generation ......................... 62 21.6 Input and output............................... 64 21.7 Comparison.................................. 65 21.8 Transpose................................... 65 21.9 Modular reduction and reconstruction ................... 65 21.10 Addition and subtraction .......................... 66 21.11 Matrix-scalar arithmetic........................... 67 21.12 Matrix multiplication ............................ 68 21.13 Inverse..................................... 68 21.14 Trace ..................................... 69 21.15 Determinant ................................. 69 21.16 Charactersitic polynomial.......................... 70 21.17 Rank...................................... 70 21.18 Nonsingular solving ............................. 70 21.19 Row reduction ................................ 71 21.20 Modular gaussian elimination........................ 72 21.21 Nullspace ................................... 72 21.22 Echelon form ................................. 72 22 fmpz poly 75 22.1 Introduction.................................. 75 22.2 Simple example................................ 75 22.3 Definition of the fmpz poly t type ..................... 76 22.4 Memory management ............................ 76 22.5 Polynomial parameters............................ 77 22.6 Assignment and basic manipulation .................... 77 22.7 Randomisation ................................ 78 22.8 Getting and setting coefficients....................... 79 iv Contents 22.9 Comparison.................................. 80 22.10 Addition and subtraction .......................... 80 22.11 Scalar multiplication and division...................... 81 22.12 Bit packing.................................. 82 22.13 Multiplication................................. 83 22.14 Squaring.................................... 86 22.15 Powering ................................... 88 22.16 Shifting .................................... 89 22.17 Bit sizes and norms.............................. 90 22.18 Greatest common divisor .......................... 90 22.19 Gaussian content............................... 93 22.20 Square-free .................................. 94 22.21 Euclidean division .............................. 94 22.22 Division with precomputed inverse..................... 97 22.23 Divisibility testing .............................. 98 22.24 Power series division............................. 99 22.25 Pseudo division................................ 99 22.26 Derivative...................................101 22.27 Evaluation...................................102 22.28 Newton basis .................................103 22.29 Interpolation .................................103 22.30 Composition .................................104 22.31 Taylor shift..................................105 22.32 Power series composition...........................105 22.33 Power series reversion ............................106 22.34 Square root..................................107 22.35 Signature ...................................108 22.36 Hensel lifting .................................108 22.37 Input and output...............................111 22.38 Modular reduction and reconstruction ...................113 22.39 Products....................................114 22.40 Newton basis conversion...........................114 22.41 Roots .....................................115 23 fmpz poly factor 117 23.1 Memory management ............................117 23.2 Manipulating factors.............................117 23.3 Input and output...............................118 23.4 Factoring algorithms.............................118 24 fmpq 121 24.1 Introduction..................................121 24.2 Memory management ............................121 24.3 Canonicalisation ...............................122 24.4 Basic assignment...............................122 24.5 Comparison..................................122 24.6 Conversion ..................................123 24.7 Input and output...............................124 24.8 Random number generation.........................125 24.9 Arithmetic ..................................125 24.10 Modular reduction and rational reconstruction . 127 24.11 Rational enumeration ............................128 24.12 Continued fractions..............................129 Contents v 25 fmpq mat 131 25.1 Introduction..................................131 25.2 Memory management ............................131 25.3 Entry access..................................131 25.4 Basic assignment...............................132 25.5 Addition, scalar multiplication .......................132 25.6 Input and output...............................132 25.7 Random matrix generation .........................133 25.8 Special matrices ...............................133 25.9 Basic comparison and properties ......................133 25.10 Integer matrix conversion ..........................133 25.11 Modular reduction and rational reconstruction . 134 25.12 Matrix multiplication ............................134 25.13 Trace .....................................135 25.14 Determinant .................................135 25.15 Nonsingular solving .............................135 25.16 Inverse.....................................136 25.17 Echelon form .................................136 26 fmpq poly 137 26.1 Introduction..................................137 26.2 Memory management ............................137 26.3 Polynomial parameters............................139 26.4 Accessing the numerator and denominator . 139 26.5 Random testing................................139 26.6 Assignment, swap, negation.........................140 26.7 Getting and setting coefficients.......................141 26.8 Comparison..................................142 26.9 Addition and subtraction ..........................143 26.10 Scalar multiplication and division......................144 26.11 Multiplication.................................146 26.12 Powering ...................................146 26.13 Shifting ....................................147 26.14 Euclidean division ..............................147 26.15 Euclidean division ..............................148 26.16 Power series division.............................149 26.17 Greatest common divisor ..........................149 26.18 Derivative and integral............................151 26.19 Square roots .................................151 26.20 Transcendental functions...........................151 26.21 Evaluation...................................154 26.22 Interpolation .................................155 26.23 Composition .................................155 26.24 Power series composition...........................156 26.25 Power series reversion ............................157 26.26 Gaussian content...............................158 26.27
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages624 Page
-
File Size-