Blame gsl_mode.h

Packit 67cb25
/* gsl_mode.h
Packit 67cb25
 * 
Packit 67cb25
 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2004 Gerard Jungman
Packit 67cb25
 * 
Packit 67cb25
 * This program is free software; you can redistribute it and/or modify
Packit 67cb25
 * it under the terms of the GNU General Public License as published by
Packit 67cb25
 * the Free Software Foundation; either version 3 of the License, or (at
Packit 67cb25
 * your option) any later version.
Packit 67cb25
 * 
Packit 67cb25
 * This program is distributed in the hope that it will be useful, but
Packit 67cb25
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 67cb25
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 67cb25
 * General Public License for more details.
Packit 67cb25
 * 
Packit 67cb25
 * You should have received a copy of the GNU General Public License
Packit 67cb25
 * along with this program; if not, write to the Free Software
Packit 67cb25
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit 67cb25
 */
Packit 67cb25
Packit 67cb25
/* Author:  B. Gough and G. Jungman */
Packit 67cb25
Packit 67cb25
#ifndef __GSL_MODE_H__
Packit 67cb25
#define __GSL_MODE_H__
Packit 67cb25
#include <gsl/gsl_inline.h>
Packit 67cb25
Packit 67cb25
#undef __BEGIN_DECLS
Packit 67cb25
#undef __END_DECLS
Packit 67cb25
#ifdef __cplusplus
Packit 67cb25
# define __BEGIN_DECLS extern "C" {
Packit 67cb25
# define __END_DECLS }
Packit 67cb25
#else
Packit 67cb25
# define __BEGIN_DECLS /* empty */
Packit 67cb25
# define __END_DECLS /* empty */
Packit 67cb25
#endif
Packit 67cb25
Packit 67cb25
__BEGIN_DECLS
Packit 67cb25
Packit 67cb25
Packit 67cb25
/* Some functions can take a mode argument. This
Packit 67cb25
 * is a rough method to do things like control
Packit 67cb25
 * the precision of the algorithm. This mainly
Packit 67cb25
 * occurs in special functions, but we figured
Packit 67cb25
 * it was ok to have a general facility.
Packit 67cb25
 *
Packit 67cb25
 * The mode type is 32-bit field. Most of
Packit 67cb25
 * the fields are currently unused. Users
Packit 67cb25
 * '|' various predefined constants to get
Packit 67cb25
 * a desired mode.
Packit 67cb25
 */
Packit 67cb25
typedef unsigned int gsl_mode_t;
Packit 67cb25
Packit 67cb25
Packit 67cb25
/* Here are the predefined constants.
Packit 67cb25
 * Note that the precision constants
Packit 67cb25
 * are special because they are used
Packit 67cb25
 * to index arrays, so do not change
Packit 67cb25
 * them. The precision information is
Packit 67cb25
 * in the low order 3 bits of gsl_mode_t
Packit 67cb25
 * (the third bit is currently unused).
Packit 67cb25
 */
Packit 67cb25
Packit 67cb25
/* Note that "0" is double precision,
Packit 67cb25
 * so that you get that by default if
Packit 67cb25
 * you forget a flag.
Packit 67cb25
 */
Packit 67cb25
#define GSL_PREC_DOUBLE  0
Packit 67cb25
#define GSL_PREC_SINGLE  1
Packit 67cb25
#define GSL_PREC_APPROX  2
Packit 67cb25
Packit 67cb25
#ifdef HAVE_INLINE
Packit 67cb25
INLINE_FUN unsigned int GSL_MODE_PREC(gsl_mode_t mt);
Packit 67cb25
Packit 67cb25
INLINE_FUN unsigned int
Packit 67cb25
GSL_MODE_PREC(gsl_mode_t mt)
Packit 67cb25
{ return  (mt & (unsigned int)7); }
Packit 67cb25
#else  /* HAVE_INLINE */
Packit 67cb25
#define GSL_MODE_PREC(mt) ((mt) & (unsigned int)7)
Packit 67cb25
#endif /* HAVE_INLINE */
Packit 67cb25
Packit 67cb25
Packit 67cb25
/* Here are some predefined generic modes.
Packit 67cb25
 */
Packit 67cb25
#define GSL_MODE_DEFAULT  0
Packit 67cb25
Packit 67cb25
Packit 67cb25
__END_DECLS
Packit 67cb25
Packit 67cb25
#endif /* __GSL_MODE_H__ */