GetFEM++  5.3
bgeot_config.h
Go to the documentation of this file.
1 /* -*- c++ -*- (enables emacs c++ mode) */
2 /*===========================================================================
3 
4  Copyright (C) 1999-2017 Yves Renard
5 
6  This file is a part of GetFEM++
7 
8  GetFEM++ is free software; you can redistribute it and/or modify it
9  under the terms of the GNU Lesser General Public License as published
10  by the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version along with the GCC Runtime Library
12  Exception either version 3.1 or (at your option) any later version.
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  License and GCC Runtime Library Exception for more details.
17  You should have received a copy of the GNU Lesser General Public License
18  along with this program; if not, write to the Free Software Foundation,
19  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  As a special exception, you may use this file as it is a part of a free
22  software library without restriction. Specifically, if other files
23  instantiate templates or use macros or inline functions from this file,
24  or you compile this file and link it with other files to produce an
25  executable, this file does not by itself cause the resulting executable
26  to be covered by the GNU Lesser General Public License. This exception
27  does not however invalidate any other reasons why the executable file
28  might be covered by the GNU Lesser General Public License.
29 
30 ===========================================================================*/
31 
32 /**@file bgeot_config.h
33  @brief defines and typedefs for namespace bgeot
34  @date December 20, 1999
35  @author Yves Renard
36 */
37 #ifndef BGEOT_CONFIG_H__
38 #define BGEOT_CONFIG_H__
39 
40 #include "getfem/getfem_arch_config.h"
41 
42 #ifdef GETFEM_HAVE_FEENABLEEXCEPT
43 # include <fenv.h>
44 # define FE_ENABLE_EXCEPT { feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); }
45 #else
46 # define FE_ENABLE_EXCEPT {}
47 #endif
48 
49 #include "dal_config.h"
50 #include "gmm/gmm_kernel.h"
51 #include "gmm/gmm_dense_lu.h"
52 
53 #ifdef GETFEM_HAVE_BOOST
54 # include <boost/version.hpp>
55 # include <boost/noncopyable.hpp>
56 #else
57 # include <getfem_boost/noncopyable.hpp>
58 #endif
59 
60 #ifdef GETFEM_HAVE_QDLIB
61 // # define NO_INLINE
62 # ifdef GETFEM_QDLIB_USE_QUAD
63 # include <qd/qd_real.h>
64 # else
65 # include <qd/dd_real.h>
66 # endif
67 # include <qd/fpu.h>
68 #endif
69 
70 /// Basic Geometric Tools
71 namespace bgeot {
72 
73  using std::endl; using std::cout; using std::cerr;
74  using std::ends; using std::cin;
75  using gmm::vref;
76 
77  static const size_t ST_NIL = size_t(-1);
78  typedef gmm::uint16_type dim_type;
79  typedef gmm::uint16_type short_type;
80  using gmm::size_type;
81  typedef double scalar_type;
82  typedef std::complex<double> complex_type;
83  inline double to_double(double &a) { return a; }
84  inline scalar_type to_scalar(const scalar_type &a) { return a; }
85 
86 #ifndef GETFEM_HAVE_QDLIB
87  typedef double long_scalar_type;
88  typedef double opt_long_scalar_type;
89 # define LONG_SCALAR_ATOF(st) (atof(st))
90 # define LONG_SCALAR_EPS 1E-16
91 # define LONG_SCAL(xx) long_scalar_type(xx)
92 #else
93 # ifdef GETFEM_QDLIB_USE_QUAD
94  typedef qd_real long_scalar_type;
95  typedef qd_real opt_long_scalar_type;
96  inline scalar_type to_scalar(const qd_real &a) { return to_double(a); }
97 # define LONG_SCALAR_ATOF(st) (long_scalar_type(st))
98 # define LONG_SCALAR_EPS 1E-64
99 # else
100  typedef dd_real long_scalar_type;
101  typedef dd_real opt_long_scalar_type;
102  inline scalar_type to_scalar(const dd_real &a) { return to_double(a); }
103 # define LONG_SCALAR_ATOF(st) (long_scalar_type(st))
104 # define LONG_SCALAR_EPS 1E-32
105 # endif
106 # define LONG_SCAL(xx) long_scalar_type(#xx) /* string assignment to preserve the precision */
107 #endif
108 
109  typedef std::vector<scalar_type> base_vector;
110  typedef std::vector<complex_type> base_complex_vector;
111  typedef gmm::dense_matrix<scalar_type> base_matrix;
112  typedef gmm::dense_matrix<complex_type> base_complex_matrix;
113 
114 } /* end of namespace bgeot. */
115 
116 
117 #endif /* BGEOT_CONFIG_H__ */
defines and typedefs for namespace dal
size_t size_type
used as the common size type in the library
Definition: bgeot_poly.h:49
Include the base gmm files.
gmm::uint16_type short_type
used as the common short type integer in the library
Definition: bgeot_config.h:79
LU factorizations and determinant computation for dense matrices.
Basic Geometric Tools.