3 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2004 Gerard Jungman
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.
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.
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.
20 /* Author: B. Gough and G. Jungman */
22 #ifndef __GSL_MODE_H__
23 #define __GSL_MODE_H__
28 # define __BEGIN_DECLS extern "C" {
29 # define __END_DECLS }
31 # define __BEGIN_DECLS /* empty */
32 # define __END_DECLS /* empty */
38 /* Some functions can take a mode argument. This
39 * is a rough method to do things like control
40 * the precision of the algorithm. This mainly
41 * occurs in special functions, but we figured
42 * it was ok to have a general facility.
44 * The mode type is 32-bit field. Most of
45 * the fields are currently unused. Users
46 * '|' various predefined constants to get
49 typedef unsigned int gsl_mode_t;
52 /* Here are the predefined constants.
53 * Note that the precision constants
54 * are special because they are used
55 * to index arrays, so do not change
56 * them. The precision information is
57 * in the low order 3 bits of gsl_mode_t
58 * (the third bit is currently unused).
61 /* Note that "0" is double precision,
62 * so that you get that by default if
65 #define GSL_PREC_DOUBLE 0
66 #define GSL_PREC_SINGLE 1
67 #define GSL_PREC_APPROX 2
70 extern inline unsigned int GSL_MODE_PREC(gsl_mode_t mt);
72 extern inline unsigned int
73 GSL_MODE_PREC(gsl_mode_t mt)
74 { return (mt & (unsigned int)7); }
75 #else /* HAVE_INLINE */
76 #define GSL_MODE_PREC(mt) ((mt) & (unsigned int)7)
77 #endif /* HAVE_INLINE */
80 /* Here are some predefined generic modes.
82 #define GSL_MODE_DEFAULT 0
87 #endif /* __GSL_MODE_H__ */