File indexing completed on 2025-01-18 10:00:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef __GSL_MATH_H__
0021 #define __GSL_MATH_H__
0022 #include <math.h>
0023 #include <gsl/gsl_sys.h>
0024 #include <gsl/gsl_inline.h>
0025 #include <gsl/gsl_machine.h>
0026 #include <gsl/gsl_precision.h>
0027 #include <gsl/gsl_nan.h>
0028 #include <gsl/gsl_pow_int.h>
0029 #include <gsl/gsl_minmax.h>
0030
0031 #ifndef M_E
0032 #define M_E 2.71828182845904523536028747135
0033 #endif
0034
0035 #ifndef M_LOG2E
0036 #define M_LOG2E 1.44269504088896340735992468100
0037 #endif
0038
0039 #ifndef M_LOG10E
0040 #define M_LOG10E 0.43429448190325182765112891892
0041 #endif
0042
0043 #ifndef M_SQRT2
0044 #define M_SQRT2 1.41421356237309504880168872421
0045 #endif
0046
0047 #ifndef M_SQRT1_2
0048 #define M_SQRT1_2 0.70710678118654752440084436210
0049 #endif
0050
0051
0052 #ifndef M_SQRT3
0053 #define M_SQRT3 1.73205080756887729352744634151
0054 #endif
0055
0056 #ifndef M_PI
0057 #define M_PI 3.14159265358979323846264338328
0058 #endif
0059
0060 #ifndef M_PI_2
0061 #define M_PI_2 1.57079632679489661923132169164
0062 #endif
0063
0064 #ifndef M_PI_4
0065 #define M_PI_4 0.78539816339744830961566084582
0066 #endif
0067
0068 #ifndef M_SQRTPI
0069 #define M_SQRTPI 1.77245385090551602729816748334
0070 #endif
0071
0072 #ifndef M_2_SQRTPI
0073 #define M_2_SQRTPI 1.12837916709551257389615890312
0074 #endif
0075
0076 #ifndef M_1_PI
0077 #define M_1_PI 0.31830988618379067153776752675
0078 #endif
0079
0080 #ifndef M_2_PI
0081 #define M_2_PI 0.63661977236758134307553505349
0082 #endif
0083
0084 #ifndef M_LN10
0085 #define M_LN10 2.30258509299404568401799145468
0086 #endif
0087
0088 #ifndef M_LN2
0089 #define M_LN2 0.69314718055994530941723212146
0090 #endif
0091
0092 #ifndef M_LNPI
0093 #define M_LNPI 1.14472988584940017414342735135
0094 #endif
0095
0096 #ifndef M_EULER
0097 #define M_EULER 0.57721566490153286060651209008
0098 #endif
0099
0100 #undef __BEGIN_DECLS
0101 #undef __END_DECLS
0102 #ifdef __cplusplus
0103 # define __BEGIN_DECLS extern "C" {
0104 # define __END_DECLS }
0105 #else
0106 # define __BEGIN_DECLS
0107 # define __END_DECLS
0108 #endif
0109
0110 __BEGIN_DECLS
0111
0112
0113
0114 #define GSL_IS_ODD(n) ((n) & 1)
0115 #define GSL_IS_EVEN(n) (!(GSL_IS_ODD(n)))
0116 #define GSL_SIGN(x) ((x) >= 0.0 ? 1 : -1)
0117
0118
0119 #define GSL_IS_REAL(x) (gsl_finite(x))
0120
0121
0122
0123 struct gsl_function_struct
0124 {
0125 double (* function) (double x, void * params);
0126 void * params;
0127 };
0128
0129 typedef struct gsl_function_struct gsl_function ;
0130
0131 #define GSL_FN_EVAL(F,x) (*((F)->function))(x,(F)->params)
0132
0133
0134
0135 struct gsl_function_fdf_struct
0136 {
0137 double (* f) (double x, void * params);
0138 double (* df) (double x, void * params);
0139 void (* fdf) (double x, void * params, double * f, double * df);
0140 void * params;
0141 };
0142
0143 typedef struct gsl_function_fdf_struct gsl_function_fdf ;
0144
0145 #define GSL_FN_FDF_EVAL_F(FDF,x) (*((FDF)->f))(x,(FDF)->params)
0146 #define GSL_FN_FDF_EVAL_DF(FDF,x) (*((FDF)->df))(x,(FDF)->params)
0147 #define GSL_FN_FDF_EVAL_F_DF(FDF,x,y,dy) (*((FDF)->fdf))(x,(FDF)->params,(y),(dy))
0148
0149
0150
0151
0152 struct gsl_function_vec_struct
0153 {
0154 int (* function) (double x, double y[], void * params);
0155 void * params;
0156 };
0157
0158 typedef struct gsl_function_vec_struct gsl_function_vec ;
0159
0160 #define GSL_FN_VEC_EVAL(F,x,y) (*((F)->function))(x,y,(F)->params)
0161
0162 __END_DECLS
0163
0164 #endif