Debian Codegraph @

external/gsl/gsl_math.h

raw symbols SCIP
1 /* gsl_math.h
2 *
3 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2004, 2007 Gerard Jungman, Brian Gough
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef __GSL_MATH_H__
21 #define __GSL_MATH_H__cxx . . $ `external/gsl/gsl_math.h:21:9`!
22 #include <math.h>
23 #include "gsl_sys.h"cxx . . $ `<file>/external/gsl/gsl_sys.h`/
24 #include "gsl_machine.h"cxx . . $ `<file>/external/gsl/gsl_machine.h`/
25 #include "gsl_precision.h"cxx . . $ `<file>/external/gsl/gsl_precision.h`/
26 #include "gsl_nan.h"cxx . . $ `<file>/external/gsl/gsl_nan.h`/
27 #include "gsl_pow_int.h"cxx . . $ `<file>/external/gsl/gsl_pow_int.h`/
28
29 #ifndef M_Ecxx . . $ `<external>/11263917310783833665/math.h:1116:10`!
30 #define M_E 2.71828182845904523536028747135 /* e */
31 #endif
32
33 #ifndef M_LOG2Ecxx . . $ `<external>/11263917310783833665/math.h:1117:10`!
34 #define M_LOG2E 1.44269504088896340735992468100 /* log_2 (e) */
35 #endif
36
37 #ifndef M_LOG10Ecxx . . $ `<external>/11263917310783833665/math.h:1118:10`!
38 #define M_LOG10E 0.43429448190325182765112891892 /* log_10 (e) */
39 #endif
40
41 #ifndef M_SQRT2cxx . . $ `<external>/11263917310783833665/math.h:1127:10`!
42 #define M_SQRT2 1.41421356237309504880168872421 /* sqrt(2) */
43 #endif
44
45 #ifndef M_SQRT1_2cxx . . $ `<external>/11263917310783833665/math.h:1128:10`!
46 #define M_SQRT1_2 0.70710678118654752440084436210 /* sqrt(1/2) */
47 #endif
48
49
50 #ifndef M_SQRT3
51 #define M_SQRT3cxx . . $ `external/gsl/gsl_math.h:51:9`! 1.73205080756887729352744634151 /* sqrt(3) */
52 #endif
53
54 #ifndef M_PIcxx . . $ `<external>/11263917310783833665/math.h:1121:10`!
55 #define M_PI 3.14159265358979323846264338328 /* pi */
56 #endif
57
58 #ifndef M_PI_2cxx . . $ `<external>/11263917310783833665/math.h:1122:10`!
59 #define M_PI_2 1.57079632679489661923132169164 /* pi/2 */
60 #endif
61
62 #ifndef M_PI_4cxx . . $ `<external>/11263917310783833665/math.h:1123:10`!
63 #define M_PI_4 0.78539816339744830961566084582 /* pi/4 */
64 #endif
65
66 #ifndef M_SQRTPI
67 #define M_SQRTPIcxx . . $ `external/gsl/gsl_math.h:67:9`! 1.77245385090551602729816748334 /* sqrt(pi) */
68 #endif
69
70 #ifndef M_2_SQRTPIcxx . . $ `<external>/11263917310783833665/math.h:1126:10`!
71 #define M_2_SQRTPI 1.12837916709551257389615890312 /* 2/sqrt(pi) */
72 #endif
73
74 #ifndef M_1_PIcxx . . $ `<external>/11263917310783833665/math.h:1124:10`!
75 #define M_1_PI 0.31830988618379067153776752675 /* 1/pi */
76 #endif
77
78 #ifndef M_2_PIcxx . . $ `<external>/11263917310783833665/math.h:1125:10`!
79 #define M_2_PI 0.63661977236758134307553505349 /* 2/pi */
80 #endif
81
82 #ifndef M_LN10cxx . . $ `<external>/11263917310783833665/math.h:1120:10`!
83 #define M_LN10 2.30258509299404568401799145468 /* ln(10) */
84 #endif
85
86 #ifndef M_LN2cxx . . $ `<external>/11263917310783833665/math.h:1119:10`!
87 #define M_LN2 0.69314718055994530941723212146 /* ln(2) */
88 #endif
89
90 #ifndef M_LNPI
91 #define M_LNPIcxx . . $ `external/gsl/gsl_math.h:91:9`! 1.14472988584940017414342735135 /* ln(pi) */
92 #endif
93
94 #ifndef M_EULER
95 #define M_EULERcxx . . $ `external/gsl/gsl_math.h:95:9`! 0.57721566490153286060651209008 /* Euler constant */
96 #endif
97
98 #undef __BEGIN_DECLScxx . . $ `external/gsl/gsl_pow_int.h:29:10`!
99 #undef __END_DECLScxx . . $ `external/gsl/gsl_pow_int.h:30:10`!
100 #ifdef __cplusplus
101 # define __BEGIN_DECLS extern "C" {
102 # define __END_DECLS }
103 #else
104 # define __BEGIN_DECLScxx . . $ `external/gsl/gsl_math.h:104:10`! /* empty */
105 # define __END_DECLScxx . . $ `external/gsl/gsl_math.h:105:10`! /* empty */
106 #endif
107
108 __BEGIN_DECLScxx . . $ `external/gsl/gsl_math.h:104:10`!
109
110 /* other needlessly compulsive abstractions */
111
112 #define GSL_IS_ODDcxx . . $ `external/gsl/gsl_math.h:112:9`!(n) ((n) & 1)
113 #define GSL_IS_EVENcxx . . $ `external/gsl/gsl_math.h:113:9`!(n) (!(GSL_IS_ODD(n)))
114 #define GSL_SIGNcxx . . $ `external/gsl/gsl_math.h:114:9`!(x) ((x) >= 0.0 ? 1 : -1)
115
116 /* Return nonzero if x is a real number, i.e. non NaN or infinite. */
117 #define GSL_IS_REALcxx . . $ `external/gsl/gsl_math.h:117:9`!(x) (gsl_finite(x))
118
119 /* Define MAX and MIN macros/functions if they don't exist. */
120
121 /* plain old macros for general use */
122 #define GSL_MAXcxx . . $ `external/gsl/gsl_math.h:122:9`!(a,b) ((a) > (b) ? (a) : (b))
123 #define GSL_MINcxx . . $ `external/gsl/gsl_math.h:123:9`!(a,b) ((a) < (b) ? (a) : (b))
124
125 /* function versions of the above, in case they are needed */
126 double gsl_maxcxx . . $ gsl_max(d8e7e0733fa41c87). (double a, double b);
127 double gsl_mincxx . . $ gsl_min(d8e7e0733fa41c87). (double a, double b);
128
129 /* inline-friendly strongly typed versions */
130 #ifdef HAVE_INLINE
131
132 extern inline int GSL_MAX_INT (int a, int b);
133 extern inline int GSL_MIN_INT (int a, int b);
134 extern inline double GSL_MAX_DBL (double a, double b);
135 extern inline double GSL_MIN_DBL (double a, double b);
136 extern inline long double GSL_MAX_LDBL (long double a, long double b);
137 extern inline long double GSL_MIN_LDBL (long double a, long double b);
138
139 extern inline int
140 GSL_MAX_INT (int a, int b)
141 {
142 return GSL_MAX (a, b);
143 }
144
145 extern inline int
146 GSL_MIN_INT (int a, int b)
147 {
148 return GSL_MIN (a, b);
149 }
150
151 extern inline double
152 GSL_MAX_DBL (double a, double b)
153 {
154 return GSL_MAX (a, b);
155 }
156
157 extern inline double
158 GSL_MIN_DBL (double a, double b)
159 {
160 return GSL_MIN (a, b);
161 }
162
163 extern inline long double
164 GSL_MAX_LDBL (long double a, long double b)
165 {
166 return GSL_MAX (a, b);
167 }
168
169 extern inline long double
170 GSL_MIN_LDBL (long double a, long double b)
171 {
172 return GSL_MIN (a, b);
173 }
174 #else
175 #define GSL_MAX_INTcxx . . $ `external/gsl/gsl_math.h:175:9`!(a,b) GSL_MAX(a,b)
176 #define GSL_MIN_INTcxx . . $ `external/gsl/gsl_math.h:176:9`!(a,b) GSL_MIN(a,b)
177 #define GSL_MAX_DBLcxx . . $ `external/gsl/gsl_math.h:177:9`!(a,b) GSL_MAXcxx . . $ `external/gsl/gsl_math.h:122:9`!(a,b)
178 #define GSL_MIN_DBLcxx . . $ `external/gsl/gsl_math.h:178:9`!(a,b) GSL_MIN(a,b)
179 #define GSL_MAX_LDBLcxx . . $ `external/gsl/gsl_math.h:179:9`!(a,b) GSL_MAX(a,b)
180 #define GSL_MIN_LDBLcxx . . $ `external/gsl/gsl_math.h:180:9`!(a,b) GSL_MIN(a,b)
181 #endif /* HAVE_INLINE */
182
183 /* Definition of an arbitrary function with parameters */
184
185 struct gsl_function_structcxx . . $ gsl_function_struct#
186 {
187 double (* functioncxx . . $ gsl_function_struct#function.) (double x, void * params);
188 void * paramscxx . . $ gsl_function_struct#params.;
189 };
190
191 typedef struct gsl_function_structcxx . . $ gsl_function_struct# gsl_functioncxx . . $ gsl_function# ;
192
193 #define GSL_FN_EVALcxx . . $ `external/gsl/gsl_math.h:193:9`!(F,x) (*((F)->function))(x,(F)->params)
194
195 /* Definition of an arbitrary function returning two values, r1, r2 */
196
197 struct gsl_function_fdf_structcxx . . $ gsl_function_fdf_struct#
198 {
199 double (* fcxx . . $ gsl_function_fdf_struct#f.) (double x, void * params);
200 double (* dfcxx . . $ gsl_function_fdf_struct#df.) (double x, void * params);
201 void (* fdfcxx . . $ gsl_function_fdf_struct#fdf.) (double x, void * params, double * f, double * df);
202 void * paramscxx . . $ gsl_function_fdf_struct#params.;
203 };
204
205 typedef struct gsl_function_fdf_structcxx . . $ gsl_function_fdf_struct# gsl_function_fdfcxx . . $ gsl_function_fdf# ;
206
207 #define GSL_FN_FDF_EVAL_Fcxx . . $ `external/gsl/gsl_math.h:207:9`!(FDF,x) (*((FDF)->f))(x,(FDF)->params)
208 #define GSL_FN_FDF_EVAL_DFcxx . . $ `external/gsl/gsl_math.h:208:9`!(FDF,x) (*((FDF)->df))(x,(FDF)->params)
209 #define GSL_FN_FDF_EVAL_F_DFcxx . . $ `external/gsl/gsl_math.h:209:9`!(FDF,x,y,dy) (*((FDF)->fdf))(x,(FDF)->params,(y),(dy))
210
211
212 /* Definition of an arbitrary vector-valued function with parameters */
213
214 struct gsl_function_vec_structcxx . . $ gsl_function_vec_struct#
215 {
216 int (* functioncxx . . $ gsl_function_vec_struct#function.) (double x, double y[], void * params);
217 void * paramscxx . . $ gsl_function_vec_struct#params.;
218 };
219
220 typedef struct gsl_function_vec_structcxx . . $ gsl_function_vec_struct# gsl_function_veccxx . . $ gsl_function_vec# ;
221
222 #define GSL_FN_VEC_EVALcxx . . $ `external/gsl/gsl_math.h:222:9`!(F,x,y) (*((F)->function))(x,y,(F)->params)
223
224 __END_DECLScxx . . $ `external/gsl/gsl_math.h:105:10`!
225
226 #endif /* __GSL_MATH_H__ */