summaryrefslogtreecommitdiff
path: root/lib/Numeric
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric')
-rw-r--r--lib/Numeric/GSL/Special/auto.hs2
-rw-r--r--lib/Numeric/GSL/Special/autoall.sh53
-rw-r--r--lib/Numeric/GSL/Special/replace.hs14
3 files changed, 45 insertions, 24 deletions
diff --git a/lib/Numeric/GSL/Special/auto.hs b/lib/Numeric/GSL/Special/auto.hs
index 732fdc9..9785fe7 100644
--- a/lib/Numeric/GSL/Special/auto.hs
+++ b/lib/Numeric/GSL/Special/auto.hs
@@ -1,3 +1,5 @@
1#!/usr/bin/env runhaskell
2
1-- automatic generation of wrappers for simple GSL special functions 3-- automatic generation of wrappers for simple GSL special functions
2 4
3import Text.ParserCombinators.Parsec 5import Text.ParserCombinators.Parsec
diff --git a/lib/Numeric/GSL/Special/autoall.sh b/lib/Numeric/GSL/Special/autoall.sh
index d5f07e8..387b8e2 100644
--- a/lib/Numeric/GSL/Special/autoall.sh
+++ b/lib/Numeric/GSL/Special/autoall.sh
@@ -1,7 +1,10 @@
1#!/bin/bash 1#!/bin/bash
2 2
3#Airy.hs 3function rep {
4# include Precision (..) in the export list 4 ./replace.hs "$1" "$2" < $3 > /tmp/tmp-rep
5 cp /tmp/tmp-rep $3
6}
7
5#Exp.hs 8#Exp.hs
6# remove extern inline definition, qualify name 9# remove extern inline definition, qualify name
7#Coupling 10#Coupling
@@ -13,29 +16,31 @@
13#Log.hs 16#Log.hs
14# remove extern inline, qualify name 17# remove extern inline, qualify name
15 18
16#runhaskell auto airy 19./auto.hs airy
17runhaskell auto bessel 20rep ') where' ', Precision(..)\n) where' Airy.hs
18runhaskell auto clausen 21./auto.hs bessel
19runhaskell auto coulomb 22./auto.hs clausen
20#runhaskell auto coupling 23./auto.hs coulomb
21runhaskell auto dawson 24runhaskell auto coupling
22runhaskell auto debye 25rep ', coupling_6j_INCORRECT_e\n, coupling_6j_INCORRECT\n' '' Coupling.hs
23runhaskell auto dilog 26./auto.hs dawson
24runhaskell auto elementary 27./auto.hs debye
25runhaskell auto ellint 28./auto.hs dilog
26runhaskell auto erf 29./auto.hs elementary
30./auto.hs ellint
31./auto.hs erf
27#runhaskell auto exp 32#runhaskell auto exp
28runhaskell auto expint 33./auto.hs expint
29runhaskell auto fermi_dirac 34./auto.hs fermi_dirac
30runhaskell auto gamma 35./auto.hs gamma
31runhaskell auto gegenbauer 36./auto.hs gegenbauer
32runhaskell auto hyperg 37./auto.hs hyperg
33runhaskell auto laguerre 38./auto.hs laguerre
34runhaskell auto lambert 39./auto.hs lambert
35#runhaskell auto legendre legendre.h 40#runhaskell auto legendre legendre.h
36#runhaskell auto log 41#runhaskell auto log
37runhaskell auto pow_int 42./auto.hs pow_int
38runhaskell auto psi 43./auto.hs psi
39runhaskell auto synchrotron 44./auto.hs synchrotron
40#runhaskell auto trig 45#runhaskell auto trig
41runhaskell auto zeta \ No newline at end of file 46./auto.hs zeta \ No newline at end of file
diff --git a/lib/Numeric/GSL/Special/replace.hs b/lib/Numeric/GSL/Special/replace.hs
new file mode 100644
index 0000000..f20a6b8
--- /dev/null
+++ b/lib/Numeric/GSL/Special/replace.hs
@@ -0,0 +1,14 @@
1#!/usr/bin/env runhaskell
2
3import Data.List(isPrefixOf)
4import System(getArgs)
5
6rep (c,r) [] = []
7rep (c,r) f@(x:xs)
8 | c `isPrefixOf` f = r ++ rep (c,r) (drop (length c) f)
9 | otherwise = x:(rep (c,r) xs)
10
11main = do
12 args <- getArgs
13 let [p',r'] = map (rep ("\\n","\n")) args
14 interact $ rep (p',r')