1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages algebra)
21 #:use-module (gnu packages)
22 #:use-module (gnu packages multiprecision)
23 #:use-module (gnu packages perl)
24 #:use-module (gnu packages readline)
25 #:use-module (gnu packages flex)
26 #:use-module (guix licenses)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build-system gnu))
39 "http://www.multiprecision.org/mpfrcx/download/mpfrcx-"
43 "0grw66b255r574lvll1bqccm5myj2m8ajzsjaygcyq9zjnnbnhhy"))))
44 (build-system gnu-build-system)
45 (inputs `(("gmp" ,gmp)
48 (synopsis "mpfrcx, a library for the arithmetic of univariate polynomials
49 over arbitrary precision real or complex numbers")
51 "mpfrcx is a library for the arithmetic of univariate polynomials over
52 arbitrary precision real (mpfr) or complex (mpc) numbers, without control
53 on the rounding. For the time being, only the few functions needed to
54 implement the floating point approach to complex multiplication are
55 implemented. On the other hand, these comprise asymptotically fast
56 multiplication routines such as Toom–Cook and the FFT. ")
58 (home-page "http://mpfrcx.multiprecision.org/")))
67 "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-"
70 "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b"))))
71 (build-system gnu-build-system)
72 (inputs `(("gmp" ,gmp)
74 (synopsis "fplll, a library for LLL-reduction of euclidean lattices")
76 "fplll LLL-reduces euclidean lattices. Since version 3, it can also
77 solve the shortest vector problem.")
79 (home-page "http://perso.ens-lyon.fr/damien.stehle/fplll/")))
81 (define-public pari-gp
88 "http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
91 "058nw1fhggy7idii4f124ami521lv3izvngs9idfz964aks8cvvn"))))
92 (build-system gnu-build-system)
93 (inputs `(("gmp" ,gmp)
95 ("readline" ,readline)))
97 '(#:make-flags '("gp")
98 ;; FIXME: building the documentation requires tex; once this is available,
99 ;; replace "gp" by "all"
100 #:test-target "dobench"
104 (lambda* (#:key inputs outputs #:allow-other-keys)
105 (let ((out (assoc-ref outputs "out"))
106 (readline (assoc-ref inputs "readline"))
107 (gmp (assoc-ref inputs "gmp")))
109 (system* "./Configure"
110 (string-append "--prefix=" out)
111 (string-append "--with-readline=" readline)
112 (string-append "--with-gmp=" gmp)))))
113 ;; FIXME: readline and gmp will be detected automatically in the next
116 (synopsis "PARI/GP, a computer algebra system for number theory")
118 "PARI/GP is a widely used computer algebra system designed for fast
119 computations in number theory (factorisations, algebraic number theory,
120 elliptic curves...), but it also contains a large number of other useful
121 functions to compute with mathematical entities such as matrices,
122 polynomials, power series, algebraic numbers, etc., and a lot of
123 transcendental functions.
124 PARI is also available as a C library to allow for faster computations.")
126 (home-page "http://pari.math.u-bordeaux.fr/")))
135 "http://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-"
138 "03fgiwy2si264g3zfgw2yi6i2l8szl5m106zgwk77sddshk20b34"))))
139 (build-system gnu-build-system)
140 (inputs `(("pari-gp" ,pari-gp)))
143 (list (string-append "--with-paricfg="
144 (assoc-ref %build-inputs "pari-gp")
145 "/lib/pari/pari.cfg"))))
146 (synopsis "PARI/GP, a computer algebra system for number theory")
148 "PARI/GP is a widely used computer algebra system designed for fast
149 computations in number theory (factorisations, algebraic number theory,
150 elliptic curves...), but it also contains a large number of other useful
151 functions to compute with mathematical entities such as matrices,
152 polynomials, power series, algebraic numbers, etc., and a lot of
153 transcendental functions.
154 PARI is also available as a C library to allow for faster computations.
156 GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
158 (home-page "http://pari.math.u-bordeaux.fr/")))
166 (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
169 "0cqf5jkwx6awgd2xc2a0mkpxilzcfmhncdcfg7c9439wgkqxkxjf"))))
170 (build-system gnu-build-system)
171 (inputs `(("readline" ,readline)))
172 (native-inputs `(("flex" ,flex)))
175 (alist-replace 'configure
176 (lambda* (#:key outputs #:allow-other-keys)
177 ;; This old `configure' script doesn't support
178 ;; variables passed as arguments.
179 (let ((out (assoc-ref outputs "out")))
180 (setenv "CONFIG_SHELL" (which "bash"))
182 (system* "./configure"
183 (string-append "--prefix=" out)))))
185 (home-page "http://www.gnu.org/software/bc/")
186 (synopsis "Arbitrary precision numeric processing language")
188 "bc is an arbitrary precision numeric processing language. It includes
189 an interactive environment for evaluating mathematical statements. Its
190 syntax is similar to that of C, so basic usage is familiar. It also includes
191 \"dc\", a reverse-polish calculator.")
200 (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
204 "1wwp9b2va7vkq3ay7a9jk22nr4x5q6m37rzqy2j8y3d11c5grkc5"))))
205 (build-system gnu-build-system)
207 '(#:configure-flags '("--enable-shared" "--enable-openmp")
208 #:phases (alist-cons-before
211 ;; By default '-mtune=native' is used. However, that may
212 ;; cause the use of ISA extensions (SSE2, etc.) that are
213 ;; not necessarily available on the user's machine when
214 ;; that package is built on a different machine.
215 (substitute* (find-files "." "Makefile$")
216 (("-mtune=native") "")))
218 (native-inputs `(("perl" ,perl)))
219 (home-page "http://fftw.org")
220 (synopsis "Computing the discrete Fourier transform")
222 "FFTW is a C subroutine library for computing the discrete Fourier
223 transform (DFT) in one or more dimensions, of arbitrary input size, and of
224 both real and complex data (as well as of even/odd data---i.e. the discrete
225 cosine/ sine transforms or DCT/DST).")