diff options
author | Alberto Ruiz <aruiz@um.es> | 2007-10-01 15:04:16 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2007-10-01 15:04:16 +0000 |
commit | c99b8fd6e3f8a2fb365ec12baf838f864b118ece (patch) | |
tree | 11b5b8515861fe88d547253ae10c2182d5fadaf2 /lib/Numeric/GSL/Special/Trig.hs | |
parent | 768f08d4134a066d773d56a9c03ae688e3850352 (diff) |
LinearAlgebra and GSL moved to Numeric
Diffstat (limited to 'lib/Numeric/GSL/Special/Trig.hs')
-rw-r--r-- | lib/Numeric/GSL/Special/Trig.hs | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/lib/Numeric/GSL/Special/Trig.hs b/lib/Numeric/GSL/Special/Trig.hs new file mode 100644 index 0000000..b846c1d --- /dev/null +++ b/lib/Numeric/GSL/Special/Trig.hs | |||
@@ -0,0 +1,164 @@ | |||
1 | ------------------------------------------------------------ | ||
2 | {- | | ||
3 | Module : Numeric.GSL.Special.Trig | ||
4 | Copyright : (c) Alberto Ruiz 2006 | ||
5 | License : GPL-style | ||
6 | Maintainer : Alberto Ruiz (aruiz at um dot es) | ||
7 | Stability : provisional | ||
8 | Portability : uses ffi | ||
9 | |||
10 | Wrappers for selected functions described at: | ||
11 | |||
12 | <http://www.gnu.org/software/gsl/manual/html_node/Trigonometric-Functions.html> | ||
13 | |||
14 | -} | ||
15 | ------------------------------------------------------------ | ||
16 | |||
17 | module Numeric.GSL.Special.Trig( | ||
18 | sin_e | ||
19 | , Numeric.GSL.Special.Trig.sin | ||
20 | , cos_e | ||
21 | , Numeric.GSL.Special.Trig.cos | ||
22 | , hypot_e | ||
23 | , hypot | ||
24 | , sinc_e | ||
25 | , sinc | ||
26 | , lnsinh_e | ||
27 | , lnsinh | ||
28 | , lncosh_e | ||
29 | , lncosh | ||
30 | , sin_err_e | ||
31 | , cos_err_e | ||
32 | , angle_restrict_symm | ||
33 | , angle_restrict_pos | ||
34 | , angle_restrict_symm_err_e | ||
35 | , angle_restrict_pos_err_e | ||
36 | ) where | ||
37 | |||
38 | import Foreign(Ptr) | ||
39 | import Numeric.GSL.Special.Internal | ||
40 | |||
41 | -- | wrapper for int gsl_sf_sin_e(double x,gsl_sf_result* result); | ||
42 | sin_e :: Double -> (Double,Double) | ||
43 | sin_e x = createSFR "sin_e" $ gsl_sf_sin_e x | ||
44 | foreign import ccall "trig.h gsl_sf_sin_e" gsl_sf_sin_e :: Double -> Ptr Double -> IO(Int) | ||
45 | |||
46 | -- | wrapper for double gsl_sf_sin(double x); | ||
47 | sin :: Double -> Double | ||
48 | sin = gsl_sf_sin | ||
49 | foreign import ccall "trig.h gsl_sf_sin" gsl_sf_sin :: Double -> Double | ||
50 | |||
51 | -- | wrapper for int gsl_sf_cos_e(double x,gsl_sf_result* result); | ||
52 | cos_e :: Double -> (Double,Double) | ||
53 | cos_e x = createSFR "cos_e" $ gsl_sf_cos_e x | ||
54 | foreign import ccall "trig.h gsl_sf_cos_e" gsl_sf_cos_e :: Double -> Ptr Double -> IO(Int) | ||
55 | |||
56 | -- | wrapper for double gsl_sf_cos(double x); | ||
57 | cos :: Double -> Double | ||
58 | cos = gsl_sf_cos | ||
59 | foreign import ccall "trig.h gsl_sf_cos" gsl_sf_cos :: Double -> Double | ||
60 | |||
61 | -- | wrapper for int gsl_sf_hypot_e(double x,double y,gsl_sf_result* result); | ||
62 | hypot_e :: Double -> Double -> (Double,Double) | ||
63 | hypot_e x y = createSFR "hypot_e" $ gsl_sf_hypot_e x y | ||
64 | foreign import ccall "trig.h gsl_sf_hypot_e" gsl_sf_hypot_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
65 | |||
66 | -- | wrapper for double gsl_sf_hypot(double x,double y); | ||
67 | hypot :: Double -> Double -> Double | ||
68 | hypot = gsl_sf_hypot | ||
69 | foreign import ccall "trig.h gsl_sf_hypot" gsl_sf_hypot :: Double -> Double -> Double | ||
70 | |||
71 | -- | wrapper for int gsl_sf_complex_sin_e(double zr,double zi,gsl_sf_result* szr,gsl_sf_result* szi); | ||
72 | complex_sin_e :: Double -> Double -> Ptr Double -> (Double,Double) | ||
73 | complex_sin_e zr zi szr = createSFR "complex_sin_e" $ gsl_sf_complex_sin_e zr zi szr | ||
74 | foreign import ccall "trig.h gsl_sf_complex_sin_e" gsl_sf_complex_sin_e :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int) | ||
75 | |||
76 | -- | wrapper for int gsl_sf_complex_cos_e(double zr,double zi,gsl_sf_result* czr,gsl_sf_result* czi); | ||
77 | complex_cos_e :: Double -> Double -> Ptr Double -> (Double,Double) | ||
78 | complex_cos_e zr zi czr = createSFR "complex_cos_e" $ gsl_sf_complex_cos_e zr zi czr | ||
79 | foreign import ccall "trig.h gsl_sf_complex_cos_e" gsl_sf_complex_cos_e :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int) | ||
80 | |||
81 | -- | wrapper for int gsl_sf_complex_logsin_e(double zr,double zi,gsl_sf_result* lszr,gsl_sf_result* lszi); | ||
82 | complex_logsin_e :: Double -> Double -> Ptr Double -> (Double,Double) | ||
83 | complex_logsin_e zr zi lszr = createSFR "complex_logsin_e" $ gsl_sf_complex_logsin_e zr zi lszr | ||
84 | foreign import ccall "trig.h gsl_sf_complex_logsin_e" gsl_sf_complex_logsin_e :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int) | ||
85 | |||
86 | -- | wrapper for int gsl_sf_sinc_e(double x,gsl_sf_result* result); | ||
87 | sinc_e :: Double -> (Double,Double) | ||
88 | sinc_e x = createSFR "sinc_e" $ gsl_sf_sinc_e x | ||
89 | foreign import ccall "trig.h gsl_sf_sinc_e" gsl_sf_sinc_e :: Double -> Ptr Double -> IO(Int) | ||
90 | |||
91 | -- | wrapper for double gsl_sf_sinc(double x); | ||
92 | sinc :: Double -> Double | ||
93 | sinc = gsl_sf_sinc | ||
94 | foreign import ccall "trig.h gsl_sf_sinc" gsl_sf_sinc :: Double -> Double | ||
95 | |||
96 | -- | wrapper for int gsl_sf_lnsinh_e(double x,gsl_sf_result* result); | ||
97 | lnsinh_e :: Double -> (Double,Double) | ||
98 | lnsinh_e x = createSFR "lnsinh_e" $ gsl_sf_lnsinh_e x | ||
99 | foreign import ccall "trig.h gsl_sf_lnsinh_e" gsl_sf_lnsinh_e :: Double -> Ptr Double -> IO(Int) | ||
100 | |||
101 | -- | wrapper for double gsl_sf_lnsinh(double x); | ||
102 | lnsinh :: Double -> Double | ||
103 | lnsinh = gsl_sf_lnsinh | ||
104 | foreign import ccall "trig.h gsl_sf_lnsinh" gsl_sf_lnsinh :: Double -> Double | ||
105 | |||
106 | -- | wrapper for int gsl_sf_lncosh_e(double x,gsl_sf_result* result); | ||
107 | lncosh_e :: Double -> (Double,Double) | ||
108 | lncosh_e x = createSFR "lncosh_e" $ gsl_sf_lncosh_e x | ||
109 | foreign import ccall "trig.h gsl_sf_lncosh_e" gsl_sf_lncosh_e :: Double -> Ptr Double -> IO(Int) | ||
110 | |||
111 | -- | wrapper for double gsl_sf_lncosh(double x); | ||
112 | lncosh :: Double -> Double | ||
113 | lncosh = gsl_sf_lncosh | ||
114 | foreign import ccall "trig.h gsl_sf_lncosh" gsl_sf_lncosh :: Double -> Double | ||
115 | |||
116 | -- | wrapper for int gsl_sf_polar_to_rect(double r,double theta,gsl_sf_result* x,gsl_sf_result* y); | ||
117 | polar_to_rect :: Double -> Double -> Ptr Double -> (Double,Double) | ||
118 | polar_to_rect r theta x = createSFR "polar_to_rect" $ gsl_sf_polar_to_rect r theta x | ||
119 | foreign import ccall "trig.h gsl_sf_polar_to_rect" gsl_sf_polar_to_rect :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int) | ||
120 | |||
121 | -- | wrapper for int gsl_sf_rect_to_polar(double x,double y,gsl_sf_result* r,gsl_sf_result* theta); | ||
122 | rect_to_polar :: Double -> Double -> Ptr Double -> (Double,Double) | ||
123 | rect_to_polar x y r = createSFR "rect_to_polar" $ gsl_sf_rect_to_polar x y r | ||
124 | foreign import ccall "trig.h gsl_sf_rect_to_polar" gsl_sf_rect_to_polar :: Double -> Double -> Ptr Double -> Ptr Double -> IO(Int) | ||
125 | |||
126 | -- | wrapper for int gsl_sf_sin_err_e(double x,double dx,gsl_sf_result* result); | ||
127 | sin_err_e :: Double -> Double -> (Double,Double) | ||
128 | sin_err_e x dx = createSFR "sin_err_e" $ gsl_sf_sin_err_e x dx | ||
129 | foreign import ccall "trig.h gsl_sf_sin_err_e" gsl_sf_sin_err_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
130 | |||
131 | -- | wrapper for int gsl_sf_cos_err_e(double x,double dx,gsl_sf_result* result); | ||
132 | cos_err_e :: Double -> Double -> (Double,Double) | ||
133 | cos_err_e x dx = createSFR "cos_err_e" $ gsl_sf_cos_err_e x dx | ||
134 | foreign import ccall "trig.h gsl_sf_cos_err_e" gsl_sf_cos_err_e :: Double -> Double -> Ptr Double -> IO(Int) | ||
135 | |||
136 | -- | wrapper for int gsl_sf_angle_restrict_symm_e(double* theta); | ||
137 | angle_restrict_symm_e :: Ptr Double -> Int | ||
138 | angle_restrict_symm_e = gsl_sf_angle_restrict_symm_e | ||
139 | foreign import ccall "trig.h gsl_sf_angle_restrict_symm_e" gsl_sf_angle_restrict_symm_e :: Ptr Double -> Int | ||
140 | |||
141 | -- | wrapper for double gsl_sf_angle_restrict_symm(double theta); | ||
142 | angle_restrict_symm :: Double -> Double | ||
143 | angle_restrict_symm = gsl_sf_angle_restrict_symm | ||
144 | foreign import ccall "trig.h gsl_sf_angle_restrict_symm" gsl_sf_angle_restrict_symm :: Double -> Double | ||
145 | |||
146 | -- | wrapper for int gsl_sf_angle_restrict_pos_e(double* theta); | ||
147 | angle_restrict_pos_e :: Ptr Double -> Int | ||
148 | angle_restrict_pos_e = gsl_sf_angle_restrict_pos_e | ||
149 | foreign import ccall "trig.h gsl_sf_angle_restrict_pos_e" gsl_sf_angle_restrict_pos_e :: Ptr Double -> Int | ||
150 | |||
151 | -- | wrapper for double gsl_sf_angle_restrict_pos(double theta); | ||
152 | angle_restrict_pos :: Double -> Double | ||
153 | angle_restrict_pos = gsl_sf_angle_restrict_pos | ||
154 | foreign import ccall "trig.h gsl_sf_angle_restrict_pos" gsl_sf_angle_restrict_pos :: Double -> Double | ||
155 | |||
156 | -- | wrapper for int gsl_sf_angle_restrict_symm_err_e(double theta,gsl_sf_result* result); | ||
157 | angle_restrict_symm_err_e :: Double -> (Double,Double) | ||
158 | angle_restrict_symm_err_e theta = createSFR "angle_restrict_symm_err_e" $ gsl_sf_angle_restrict_symm_err_e theta | ||
159 | foreign import ccall "trig.h gsl_sf_angle_restrict_symm_err_e" gsl_sf_angle_restrict_symm_err_e :: Double -> Ptr Double -> IO(Int) | ||
160 | |||
161 | -- | wrapper for int gsl_sf_angle_restrict_pos_err_e(double theta,gsl_sf_result* result); | ||
162 | angle_restrict_pos_err_e :: Double -> (Double,Double) | ||
163 | angle_restrict_pos_err_e theta = createSFR "angle_restrict_pos_err_e" $ gsl_sf_angle_restrict_pos_err_e theta | ||
164 | foreign import ccall "trig.h gsl_sf_angle_restrict_pos_err_e" gsl_sf_angle_restrict_pos_err_e :: Double -> Ptr Double -> IO(Int) | ||