|
| 1 | +.. python-flint documentation master file, created by |
| 2 | + sphinx-quickstart on Wed Jul 18 11:49:46 2012. |
| 3 | + You can adapt this file completely to your liking, but it should at least |
| 4 | + contain the root `toctree` directive. |
| 5 | + |
| 6 | +Python bindings for FLINT |
| 7 | +========================================================== |
| 8 | + |
| 9 | +Introduction |
| 10 | +:::::::::::: |
| 11 | + |
| 12 | +The python-flint Python extension module provides |
| 13 | +bindings to FLINT (http://flintlib.org/). |
| 14 | +FLINT (Fast Library for Number Theory) is a C library that implements |
| 15 | +highly optimised exact scalar, polynomial and matrix arithmetic as |
| 16 | +well as many number-theoretic special functions. |
| 17 | + |
| 18 | +As of the current version, only a subset of the FLINT types |
| 19 | +are wrapped, and only a very limited selection of methods are provided. |
| 20 | +There are known and unknown bugs, and the interface is subject to |
| 21 | +change drastically in the future. Any feedback is welcome |
| 22 | +and can be sent to fredrik.johansson@gmail.com or flint-devel@googlegroups.com. |
| 23 | +Of particular note: |
| 24 | + |
| 25 | +* Most functionality in FLINT is not yet wrapped! |
| 26 | +* Coercions are not supported in all directions. |
| 27 | +* Conversion between Python longs and fmpzs is not done efficiently. |
| 28 | +* Types don't yet provide hash methods. |
| 29 | +* Interaction with gmpy (http://gmpy.org/) types (and types from many other libraries) is not supported. |
| 30 | + |
| 31 | +Setup |
| 32 | +:::::::::::: |
| 33 | + |
| 34 | +To build this module, you first need to install the latest |
| 35 | +version of FLINT (follow the instructions in the FLINT documentation). You |
| 36 | +also need to install Cython (http://cython.org/). |
| 37 | + |
| 38 | +Next, extract the python-flint archive and run:: |
| 39 | + |
| 40 | + python ./setup.py build_ext |
| 41 | + sudo python ./setup.py install |
| 42 | + python ./test.py |
| 43 | + |
| 44 | +Note: if FLINT is not installed globally, you can do something like the following (the second |
| 45 | +line is required for loading FLINT from Python):: |
| 46 | + |
| 47 | + python ./setup.py build_ext --include-dirs=/home/fredrik/src/flint2 --library-dirs=/home/fredrik/src/flint2 |
| 48 | + export LD_LIBRARY_PATH=/home/fredrik/src/flint2/:$LD_LIBRARY_PATH |
| 49 | + |
| 50 | +If everything worked, you will be able to import the ``flint`` module |
| 51 | +in Python:: |
| 52 | + |
| 53 | + Python 2.7.3 (default, Apr 20 2012, 22:39:59) |
| 54 | + [GCC 4.6.3] on linux2 |
| 55 | + Type "help", "copyright", "credits" or "license" for more information. |
| 56 | + >>> import flint |
| 57 | + >>> flint.fmpz(33) ** 33 |
| 58 | + fmpz(129110040087761027839616029934664535539337183380513) |
| 59 | + |
| 60 | +Reference |
| 61 | +:::::::::::: |
| 62 | + |
| 63 | +Scalar types |
| 64 | +............ |
| 65 | + |
| 66 | +fmpz |
| 67 | +------------------------------------------------------------ |
| 68 | + |
| 69 | +.. autoclass :: flint.fmpz |
| 70 | + :members: |
| 71 | + :undoc-members: |
| 72 | + |
| 73 | +fmpq |
| 74 | +------------------------------------------------------------ |
| 75 | + |
| 76 | +.. autoclass :: flint.fmpq |
| 77 | + :members: |
| 78 | + :undoc-members: |
| 79 | + |
| 80 | +nmod |
| 81 | +------------------------------------------------------------ |
| 82 | + |
| 83 | +.. autoclass :: flint.nmod |
| 84 | + :members: |
| 85 | + :undoc-members: |
| 86 | + |
| 87 | +Polynomial types |
| 88 | +................ |
| 89 | + |
| 90 | +fmpz_poly |
| 91 | +------------------------------------------------------------ |
| 92 | + |
| 93 | +.. autoclass :: flint.fmpz_poly |
| 94 | + :members: |
| 95 | + :undoc-members: |
| 96 | + |
| 97 | +fmpq_poly |
| 98 | +------------------------------------------------------------ |
| 99 | + |
| 100 | +.. autoclass :: flint.fmpq_poly |
| 101 | + :members: |
| 102 | + :undoc-members: |
| 103 | + |
| 104 | +nmod_poly |
| 105 | +------------------------------------------------------------ |
| 106 | + |
| 107 | +.. autoclass :: flint.nmod_poly |
| 108 | + :members: |
| 109 | + :undoc-members: |
| 110 | + |
| 111 | +Matrix types |
| 112 | +............ |
| 113 | + |
| 114 | +fmpz_mat |
| 115 | +------------------------------------------------------------ |
| 116 | + |
| 117 | +.. autoclass :: flint.fmpz_mat |
| 118 | + :members: |
| 119 | + :undoc-members: |
| 120 | + |
| 121 | +fmpq_mat |
| 122 | +------------------------------------------------------------ |
| 123 | + |
| 124 | +.. autoclass :: flint.fmpq_mat |
| 125 | + :members: |
| 126 | + :undoc-members: |
| 127 | + |
| 128 | +nmod_mat |
| 129 | +------------------------------------------------------------ |
| 130 | + |
| 131 | +.. autoclass :: flint.nmod_mat |
| 132 | + :members: |
| 133 | + :undoc-members: |
| 134 | + |
| 135 | +Special functions |
| 136 | +................. |
| 137 | + |
| 138 | +.. autofunction :: flint.number_of_partitions |
0 commit comments