Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:00:57

0001 /* gsl_mode.h
0002  * 
0003  * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2004 Gerard Jungman
0004  * 
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation; either version 3 of the License, or (at
0008  * your option) any later version.
0009  * 
0010  * This program is distributed in the hope that it will be useful, but
0011  * WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * General Public License for more details.
0014  * 
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program; if not, write to the Free Software
0017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018  */
0019 
0020 /* Author:  B. Gough and G. Jungman */
0021 
0022 #ifndef __GSL_MODE_H__
0023 #define __GSL_MODE_H__
0024 #include <gsl/gsl_inline.h>
0025 
0026 #undef __BEGIN_DECLS
0027 #undef __END_DECLS
0028 #ifdef __cplusplus
0029 # define __BEGIN_DECLS extern "C" {
0030 # define __END_DECLS }
0031 #else
0032 # define __BEGIN_DECLS /* empty */
0033 # define __END_DECLS /* empty */
0034 #endif
0035 
0036 __BEGIN_DECLS
0037 
0038 
0039 /* Some functions can take a mode argument. This
0040  * is a rough method to do things like control
0041  * the precision of the algorithm. This mainly
0042  * occurs in special functions, but we figured
0043  * it was ok to have a general facility.
0044  *
0045  * The mode type is 32-bit field. Most of
0046  * the fields are currently unused. Users
0047  * '|' various predefined constants to get
0048  * a desired mode.
0049  */
0050 typedef unsigned int gsl_mode_t;
0051 
0052 
0053 /* Here are the predefined constants.
0054  * Note that the precision constants
0055  * are special because they are used
0056  * to index arrays, so do not change
0057  * them. The precision information is
0058  * in the low order 3 bits of gsl_mode_t
0059  * (the third bit is currently unused).
0060  */
0061 
0062 /* Note that "0" is double precision,
0063  * so that you get that by default if
0064  * you forget a flag.
0065  */
0066 #define GSL_PREC_DOUBLE  0
0067 #define GSL_PREC_SINGLE  1
0068 #define GSL_PREC_APPROX  2
0069 
0070 #ifdef HAVE_INLINE
0071 INLINE_FUN unsigned int GSL_MODE_PREC(gsl_mode_t mt);
0072 
0073 INLINE_FUN unsigned int
0074 GSL_MODE_PREC(gsl_mode_t mt)
0075 { return  (mt & (unsigned int)7); }
0076 #else  /* HAVE_INLINE */
0077 #define GSL_MODE_PREC(mt) ((mt) & (unsigned int)7)
0078 #endif /* HAVE_INLINE */
0079 
0080 
0081 /* Here are some predefined generic modes.
0082  */
0083 #define GSL_MODE_DEFAULT  0
0084 
0085 
0086 __END_DECLS
0087 
0088 #endif /* __GSL_MODE_H__ */