comparison DEPENDENCIES/generic/include/boost/numeric/ublas/detail/config.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 //
2 // Copyright (c) 2000-2002
3 // Joerg Walter, Mathias Koch
4 //
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //
9 // The authors gratefully acknowledge the support of
10 // GeNeSys mbH & Co. KG in producing this work.
11 //
12
13 #ifndef _BOOST_UBLAS_CONFIG_
14 #define _BOOST_UBLAS_CONFIG_
15
16 #include <cassert>
17 #include <cstddef>
18 #include <algorithm>
19 #include <limits>
20
21 #include <boost/config.hpp>
22 #include <boost/static_assert.hpp>
23 #include <boost/noncopyable.hpp>
24 #include <boost/mpl/if.hpp>
25 #include <boost/mpl/and.hpp>
26 #include <boost/type_traits/is_same.hpp>
27 #include <boost/type_traits/is_convertible.hpp>
28 #include <boost/type_traits/is_const.hpp>
29 #include <boost/type_traits/remove_reference.hpp>
30
31
32 // Microsoft Visual C++
33 #if defined (BOOST_MSVC) && ! defined (BOOST_STRICT_CONFIG)
34
35 // Version 6.0 and 7.0
36 #if BOOST_MSVC <= 1300
37 #define BOOST_UBLAS_UNSUPPORTED_COMPILER 1
38 #endif
39
40 // Version 7.1
41 #if BOOST_MSVC == 1310
42 // One of these workarounds is needed for MSVC 7.1 AFAIK
43 // (thanks to John Maddock and Martin Lauer).
44 #if !(defined(BOOST_UBLAS_NO_NESTED_CLASS_RELATION) || defined(BOOST_UBLAS_MSVC_NESTED_CLASS_RELATION))
45 #define BOOST_UBLAS_NO_NESTED_CLASS_RELATION
46 #endif
47
48 #endif
49
50 #endif
51
52
53 // GNU Compiler Collection
54 #if defined (__GNUC__) && ! defined (BOOST_STRICT_CONFIG)
55
56 #if __GNUC__ >= 4 || (__GNUC__ >= 3 && __GNUC_MINOR__ >= 4)
57 // Specified by ABI definition see GCC bug id 9982
58 #define BOOST_UBLAS_USEFUL_ARRAY_PLACEMENT_NEW
59 #endif
60
61 #if __GNUC__ < 3
62 #define BOOST_UBLAS_UNSUPPORTED_COMPILER 1
63 #endif
64
65 #endif
66
67
68 // Intel Compiler
69 #if defined (BOOST_INTEL) && ! defined (BOOST_STRICT_CONFIG)
70
71 #if defined (BOOST_INTEL_LINUX) && (BOOST_INTEL_LINUX >= 800)
72 // By inspection of compiler results
73 #define BOOST_UBLAS_USEFUL_ARRAY_PLACEMENT_NEW
74 #endif
75
76 #if (BOOST_INTEL < 700)
77 #define BOOST_UBLAS_UNSUPPORTED_COMPILER 1
78 #endif
79
80 // Define swap for index_pair and triple.
81 #if (BOOST_INTEL <= 800)
82 namespace boost { namespace numeric { namespace ublas {
83 template<class C, class IC>
84 class indexed_iterator;
85
86 template<class V>
87 class index_pair;
88 template<class M>
89 class index_triple;
90 }}}
91
92 namespace std {
93 template<class V>
94 inline
95 void swap (boost::numeric::ublas::index_pair<V> i1, boost::numeric::ublas::index_pair<V> i2) {
96 i1.swap (i2);
97 }
98 template<class M>
99 inline
100 void swap (boost::numeric::ublas::index_triple<M> i1, boost::numeric::ublas::index_triple<M> i2) {
101 i1.swap (i2);
102 }
103 // iter_swap also needed for ICC on Itanium?
104 template<class C, class IC>
105 inline
106 void iter_swap (boost::numeric::ublas::indexed_iterator<C, IC> it1,
107 boost::numeric::ublas::indexed_iterator<C, IC> it2) {
108 swap (*it1, *it2);
109 }
110 }
111 #endif
112
113 #endif
114
115
116 // Comeau compiler - thanks to Kresimir Fresl
117 #if defined (__COMO__) && ! defined (BOOST_STRICT_CONFIG)
118
119 // Missing std::abs overloads for float types in <cmath> are in <cstdlib>
120 #if defined(__LIBCOMO__) && (__LIBCOMO_VERSION__ <= 31)
121 #include <cstdlib>
122 #endif
123
124 #endif
125
126 // PGI compiler
127 #ifdef __PGIC__
128 #define BOOST_UBLAS_UNSUPPORTED_COMPILER 0
129 #endif
130
131 // HP aCC C++ compiler
132 #if defined (__HP_aCC) && ! defined (BOOST_STRICT_CONFIG)
133 # if (__HP_aCC >= 60000 )
134 # define BOOST_UBLAS_USEFUL_ARRAY_PLACEMENT_NEW
135 #endif
136 #endif
137
138
139 // SGI MIPSpro C++ compiler
140 #if defined (__sgi) && ! defined (BOOST_STRICT_CONFIG)
141
142 // Missing std::abs overloads for float types in <cmath> are in <cstdlib>
143 // This test should be library version specific.
144 #include <cstdlib>
145
146 #if __COMPILER_VERSION >=650
147 // By inspection of compiler results - thanks to Peter Schmitteckert
148 #define BOOST_UBLAS_USEFUL_ARRAY_PLACEMENT_NEW
149 #endif
150
151 #endif
152
153
154 // Metrowerks Codewarrior
155 #if defined (__MWERKS__) && ! defined (BOOST_STRICT_CONFIG)
156
157 // 8.x
158 #if __MWERKS__ <= 0x3003
159 #define BOOST_UBLAS_UNSUPPORTED_COMPILER 1
160 #endif
161
162 #endif
163
164
165 // Detect other compilers with serious defects - override by defineing BOOST_UBLAS_UNSUPPORTED_COMPILER=0
166 #ifndef BOOST_UBLAS_UNSUPPORTED_COMPILER
167 #if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_SFINAE) || defined(BOOST_NO_STDC_NAMESPACE)
168 #define BOOST_UBLAS_UNSUPPORTED_COMPILER 1
169 #endif
170 #endif
171
172 // Cannot continue with an unsupported compiler
173 #if defined(BOOST_UBLAS_UNSUPPORTED_COMPILER) && (BOOST_UBLAS_UNSUPPORTED_COMPILER != 0)
174 #error Your compiler and/or configuration is unsupported by this verions of uBLAS. Define BOOST_UBLAS_UNSUPPORTED_COMPILER=0 to override this message. Boost 1.32.0 includes uBLAS with support for many older compilers.
175 #endif
176
177
178
179 // Enable performance options in RELEASE mode
180 #if defined (NDEBUG) || defined (BOOST_UBLAS_NDEBUG)
181
182 #ifndef BOOST_UBLAS_INLINE
183 #define BOOST_UBLAS_INLINE inline
184 #endif
185
186 // Do not check sizes!
187 #define BOOST_UBLAS_USE_FAST_SAME
188
189 // NO runtime error checks with BOOST_UBLAS_CHECK macro
190 #ifndef BOOST_UBLAS_CHECK_ENABLE
191 #define BOOST_UBLAS_CHECK_ENABLE 0
192 #endif
193
194 // NO type compatibility numeric checks
195 #ifndef BOOST_UBLAS_TYPE_CHECK
196 #define BOOST_UBLAS_TYPE_CHECK 0
197 #endif
198
199
200 // Disable performance options in DEBUG mode
201 #else
202
203 #ifndef BOOST_UBLAS_INLINE
204 #define BOOST_UBLAS_INLINE
205 #endif
206
207 // Enable runtime error checks with BOOST_UBLAS_CHECK macro. Check bounds etc
208 #ifndef BOOST_UBLAS_CHECK_ENABLE
209 #define BOOST_UBLAS_CHECK_ENABLE 1
210 #endif
211
212 // Type compatibiltity numeric checks
213 #ifndef BOOST_UBLAS_TYPE_CHECK
214 #define BOOST_UBLAS_TYPE_CHECK 1
215 #endif
216
217 #endif
218
219
220 /*
221 * Type compatibility checks
222 * Control type compatibility numeric runtime checks for non dense matrices.
223 * Require additional storage and complexity
224 */
225 #if BOOST_UBLAS_TYPE_CHECK
226 template <class Dummy>
227 struct disable_type_check
228 {
229 static bool value;
230 };
231 template <class Dummy>
232 bool disable_type_check<Dummy>::value = false;
233 #endif
234 #ifndef BOOST_UBLAS_TYPE_CHECK_EPSILON
235 #define BOOST_UBLAS_TYPE_CHECK_EPSILON (type_traits<real_type>::type_sqrt (std::numeric_limits<real_type>::epsilon ()))
236 #endif
237 #ifndef BOOST_UBLAS_TYPE_CHECK_MIN
238 #define BOOST_UBLAS_TYPE_CHECK_MIN (type_traits<real_type>::type_sqrt ( (std::numeric_limits<real_type>::min) ()))
239 #endif
240
241
242 /*
243 * General Configuration
244 */
245
246 // Proxy shortcuts overload the alreadly heavily over used operator ()
247 //#define BOOST_UBLAS_ENABLE_PROXY_SHORTCUTS
248
249 // In order to simplify debugging is is possible to simplify expression template
250 // so they are restricted to a single operation
251 // #define BOOST_UBLAS_SIMPLE_ET_DEBUG
252
253 // Use invariant hoisting.
254 // #define BOOST_UBLAS_USE_INVARIANT_HOISTING
255
256 // Use Duff's device in element access loops
257 // #define BOOST_UBLAS_USE_DUFF_DEVICE
258
259 // Choose evaluation method for dense vectors and matrices
260 #if !(defined(BOOST_UBLAS_USE_INDEXING) || defined(BOOST_UBLAS_USE_ITERATING))
261 #define BOOST_UBLAS_USE_INDEXING
262 #endif
263 // #define BOOST_UBLAS_ITERATOR_THRESHOLD 0
264
265 // Use indexed iterators - unsupported implementation experiment
266 // #define BOOST_UBLAS_USE_INDEXED_ITERATOR
267
268 // Alignment of bounded_array type
269 #ifndef BOOST_UBLAS_BOUNDED_ARRAY_ALIGN
270 #define BOOST_UBLAS_BOUNDED_ARRAY_ALIGN
271 #endif
272
273 // Enable different sparse element proxies
274 #ifndef BOOST_UBLAS_NO_ELEMENT_PROXIES
275 // Sparse proxies prevent reference invalidation problems in expressions such as:
276 // a [1] = a [0] = 1 Thanks to Marc Duflot for spotting this.
277 // #define BOOST_UBLAS_STRICT_MAP_ARRAY
278 #define BOOST_UBLAS_STRICT_VECTOR_SPARSE
279 #define BOOST_UBLAS_STRICT_MATRIX_SPARSE
280 // Hermitian matrices use element proxies to allow assignment to conjugate triangle
281 #define BOOST_UBLAS_STRICT_HERMITIAN
282 #endif
283
284 // Define to configure special settings for reference returning members
285 // #define BOOST_UBLAS_REFERENCE_CONST_MEMBER
286 // #define BOOST_UBLAS_PROXY_CONST_MEMBER
287
288
289 // Include type declerations and functions
290 #include <boost/numeric/ublas/fwd.hpp>
291 #include <boost/numeric/ublas/detail/definitions.hpp>
292
293
294 #endif