File indexing completed on 2025-01-18 10:00:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef __GSL_MINMAX_H__
0021 #define __GSL_MINMAX_H__
0022 #include <gsl/gsl_inline.h>
0023
0024 #undef __BEGIN_DECLS
0025 #undef __END_DECLS
0026 #ifdef __cplusplus
0027 # define __BEGIN_DECLS extern "C" {
0028 # define __END_DECLS }
0029 #else
0030 # define __BEGIN_DECLS
0031 # define __END_DECLS
0032 #endif
0033
0034 __BEGIN_DECLS
0035
0036
0037
0038
0039 #define GSL_MAX(a,b) ((a) > (b) ? (a) : (b))
0040 #define GSL_MIN(a,b) ((a) < (b) ? (a) : (b))
0041
0042
0043 double gsl_max (double a, double b);
0044 double gsl_min (double a, double b);
0045
0046
0047 #ifdef HAVE_INLINE
0048
0049 INLINE_FUN int GSL_MAX_INT (int a, int b);
0050 INLINE_FUN int GSL_MIN_INT (int a, int b);
0051 INLINE_FUN double GSL_MAX_DBL (double a, double b);
0052 INLINE_FUN double GSL_MIN_DBL (double a, double b);
0053 INLINE_FUN long double GSL_MAX_LDBL (long double a, long double b);
0054 INLINE_FUN long double GSL_MIN_LDBL (long double a, long double b);
0055
0056 INLINE_FUN int
0057 GSL_MAX_INT (int a, int b)
0058 {
0059 return GSL_MAX (a, b);
0060 }
0061
0062 INLINE_FUN int
0063 GSL_MIN_INT (int a, int b)
0064 {
0065 return GSL_MIN (a, b);
0066 }
0067
0068 INLINE_FUN double
0069 GSL_MAX_DBL (double a, double b)
0070 {
0071 return GSL_MAX (a, b);
0072 }
0073
0074 INLINE_FUN double
0075 GSL_MIN_DBL (double a, double b)
0076 {
0077 return GSL_MIN (a, b);
0078 }
0079
0080 INLINE_FUN long double
0081 GSL_MAX_LDBL (long double a, long double b)
0082 {
0083 return GSL_MAX (a, b);
0084 }
0085
0086 INLINE_FUN long double
0087 GSL_MIN_LDBL (long double a, long double b)
0088 {
0089 return GSL_MIN (a, b);
0090 }
0091 #else
0092 #define GSL_MAX_INT(a,b) GSL_MAX(a,b)
0093 #define GSL_MIN_INT(a,b) GSL_MIN(a,b)
0094 #define GSL_MAX_DBL(a,b) GSL_MAX(a,b)
0095 #define GSL_MIN_DBL(a,b) GSL_MIN(a,b)
0096 #define GSL_MAX_LDBL(a,b) GSL_MAX(a,b)
0097 #define GSL_MIN_LDBL(a,b) GSL_MIN(a,b)
0098 #endif
0099
0100 __END_DECLS
0101
0102 #endif