Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:59

0001 //
0002 //  Copyright (c) 2000-2002
0003 //  Joerg Walter, Mathias Koch
0004 //
0005 //  Distributed under the Boost Software License, Version 1.0. (See
0006 //  accompanying file LICENSE_1_0.txt or copy at
0007 //  http://www.boost.org/LICENSE_1_0.txt)
0008 //
0009 //  The authors gratefully acknowledge the support of
0010 //  GeNeSys mbH & Co. KG in producing this work.
0011 //
0012 
0013 #ifndef _BOOST_UBLAS_CONFIG_
0014 #define _BOOST_UBLAS_CONFIG_
0015 
0016 #include <cassert>
0017 #include <cstddef>
0018 #include <algorithm>
0019 #include <limits>
0020 
0021 #include <boost/config.hpp>
0022 #include <boost/static_assert.hpp>
0023 #include <boost/noncopyable.hpp>
0024 #include <boost/mpl/if.hpp>
0025 #include <boost/mpl/and.hpp>
0026 #include <boost/type_traits/is_same.hpp>
0027 #include <boost/type_traits/is_convertible.hpp>
0028 #include <boost/type_traits/is_const.hpp>
0029 #include <boost/type_traits/remove_reference.hpp>
0030 
0031 // C++11
0032 #if defined(__cplusplus) && __cplusplus >= 201103L
0033 
0034 #define BOOST_UBLAS_CPP_GE_2011
0035 
0036 #elif BOOST_MSVC >= 1800
0037 
0038 #define BOOST_UBLAS_CPP_GE_2011
0039 
0040 #else
0041 
0042 #undef BOOST_UBLAS_CPP_GE_2011 // Make sure no one defined it
0043 
0044 #endif
0045 
0046 // Microsoft Visual C++
0047 #if defined (BOOST_MSVC) && ! defined (BOOST_STRICT_CONFIG)
0048 
0049 // Version 7.1
0050 #if BOOST_MSVC == 1310
0051 // One of these workarounds is needed for MSVC 7.1 AFAIK
0052 // (thanks to John Maddock and Martin Lauer).
0053 #if !(defined(BOOST_UBLAS_NO_NESTED_CLASS_RELATION) || defined(BOOST_UBLAS_MSVC_NESTED_CLASS_RELATION))
0054 #define BOOST_UBLAS_NO_NESTED_CLASS_RELATION
0055 #endif
0056 
0057 #endif
0058 
0059 #endif
0060 
0061 
0062 // GNU Compiler Collection
0063 #if defined (__GNUC__) && ! defined (BOOST_STRICT_CONFIG)
0064 
0065 #if __GNUC__ >= 4 || (__GNUC__ >= 3 && __GNUC_MINOR__ >= 4)
0066 // Specified by ABI definition see GCC bug id 9982
0067 #define BOOST_UBLAS_USEFUL_ARRAY_PLACEMENT_NEW
0068 #endif
0069 
0070 #if __GNUC__ < 3
0071 #define BOOST_UBLAS_UNSUPPORTED_COMPILER 1
0072 #endif
0073 
0074 #endif
0075 
0076 
0077 // Intel Compiler
0078 #if defined (BOOST_INTEL) && ! defined (BOOST_STRICT_CONFIG)
0079 
0080 #if defined (BOOST_INTEL_LINUX) && (BOOST_INTEL_LINUX >= 800)
0081 // By inspection of compiler results
0082 #define BOOST_UBLAS_USEFUL_ARRAY_PLACEMENT_NEW
0083 #endif
0084 
0085 #if (BOOST_INTEL < 700)
0086 #define BOOST_UBLAS_UNSUPPORTED_COMPILER 1
0087 #endif
0088 
0089 // Define swap for index_pair and triple.
0090 #if (BOOST_INTEL <= 800)
0091 namespace boost { namespace numeric { namespace ublas {
0092     template<class C, class IC>
0093     class indexed_iterator;
0094 
0095     template<class V>
0096     class index_pair;
0097     template<class M>
0098     class index_triple;
0099 }}}
0100 
0101 namespace std {
0102     template<class V>
0103     inline
0104     void swap (boost::numeric::ublas::index_pair<V> i1, boost::numeric::ublas::index_pair<V> i2) {
0105         i1.swap (i2);
0106     }
0107     template<class M>
0108     inline
0109     void swap (boost::numeric::ublas::index_triple<M> i1, boost::numeric::ublas::index_triple<M> i2) {
0110         i1.swap (i2);
0111     }
0112     // iter_swap also needed for ICC on Itanium?
0113     template<class C, class IC>
0114     inline
0115     void iter_swap (boost::numeric::ublas::indexed_iterator<C, IC> it1,
0116                     boost::numeric::ublas::indexed_iterator<C, IC> it2) {
0117         swap (*it1, *it2);
0118     }
0119 }
0120 #endif
0121 
0122 #endif
0123 
0124 
0125 // Comeau compiler - thanks to Kresimir Fresl
0126 #if defined (__COMO__) && ! defined (BOOST_STRICT_CONFIG)
0127 
0128 // Missing std::abs overloads for float types in <cmath> are in <cstdlib>
0129 #if defined(__LIBCOMO__) && (__LIBCOMO_VERSION__ <= 31)
0130 #include <cstdlib>
0131 #endif
0132 
0133 #endif
0134 
0135 // PGI compiler
0136 #ifdef __PGIC__
0137 #define BOOST_UBLAS_UNSUPPORTED_COMPILER 0
0138 #endif
0139 
0140 //  HP aCC C++ compiler
0141 #if defined (__HP_aCC) && ! defined (BOOST_STRICT_CONFIG)
0142 #  if (__HP_aCC >= 60000 )
0143 #    define BOOST_UBLAS_USEFUL_ARRAY_PLACEMENT_NEW
0144 #endif
0145 #endif
0146 
0147 
0148 //  SGI MIPSpro C++ compiler
0149 #if defined (__sgi) && ! defined (BOOST_STRICT_CONFIG)
0150 
0151 // Missing std::abs overloads for float types in <cmath> are in <cstdlib>
0152 // This test should be library version specific.
0153 #include <cstdlib>
0154 
0155 #if __COMPILER_VERSION >=650
0156 // By inspection of compiler results - thanks to Peter Schmitteckert
0157 #define BOOST_UBLAS_USEFUL_ARRAY_PLACEMENT_NEW
0158 #endif
0159 
0160 #endif
0161 
0162 
0163 // Metrowerks Codewarrior
0164 #if defined (__MWERKS__) && ! defined (BOOST_STRICT_CONFIG)
0165 
0166 // 8.x
0167 #if __MWERKS__ <= 0x3003
0168 #define BOOST_UBLAS_UNSUPPORTED_COMPILER 1
0169 #endif
0170 
0171 #endif
0172 
0173 
0174 // Detect other compilers with serious defects - override by defineing BOOST_UBLAS_UNSUPPORTED_COMPILER=0
0175 #ifndef BOOST_UBLAS_UNSUPPORTED_COMPILER
0176 #if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) || defined(BOOST_NO_SFINAE) || defined(BOOST_NO_STDC_NAMESPACE)
0177 #define BOOST_UBLAS_UNSUPPORTED_COMPILER 1
0178 #endif
0179 #endif
0180 
0181 // Cannot continue with an unsupported compiler
0182 #if defined(BOOST_UBLAS_UNSUPPORTED_COMPILER) && (BOOST_UBLAS_UNSUPPORTED_COMPILER != 0)
0183 #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.
0184 #endif
0185 
0186 
0187 
0188 // Enable performance options in RELEASE mode
0189 #if defined (NDEBUG) || defined (BOOST_UBLAS_NDEBUG)
0190 
0191 #ifndef BOOST_UBLAS_INLINE
0192 #define BOOST_UBLAS_INLINE inline
0193 #endif
0194 
0195 // Do not check sizes!
0196 #define BOOST_UBLAS_USE_FAST_SAME
0197 
0198 // NO runtime error checks with BOOST_UBLAS_CHECK macro
0199 #ifndef BOOST_UBLAS_CHECK_ENABLE
0200 #define BOOST_UBLAS_CHECK_ENABLE 0
0201 #endif
0202 
0203 // NO type compatibility numeric checks
0204 #ifndef BOOST_UBLAS_TYPE_CHECK
0205 #define BOOST_UBLAS_TYPE_CHECK 0
0206 #endif
0207 
0208 
0209 // Disable performance options in DEBUG mode
0210 #else
0211 
0212 #ifndef BOOST_UBLAS_INLINE
0213 #define BOOST_UBLAS_INLINE
0214 #endif
0215 
0216 // Enable runtime error checks with BOOST_UBLAS_CHECK macro. Check bounds etc
0217 #ifndef BOOST_UBLAS_CHECK_ENABLE
0218 #define BOOST_UBLAS_CHECK_ENABLE 1
0219 #endif
0220 
0221 // Type compatibiltity numeric checks
0222 #ifndef BOOST_UBLAS_TYPE_CHECK
0223 #define BOOST_UBLAS_TYPE_CHECK 1
0224 #endif
0225 
0226 #endif
0227 
0228 
0229 /*
0230  * Type compatibility checks
0231  *  Control type compatibility numeric runtime checks for non dense matrices.
0232  *  Require additional storage and complexity
0233  */
0234 #if BOOST_UBLAS_TYPE_CHECK
0235 template <class Dummy>
0236 struct disable_type_check
0237 {
0238     static bool value;
0239 };
0240 template <class Dummy>
0241 bool disable_type_check<Dummy>::value = false;
0242 #endif
0243 #ifndef BOOST_UBLAS_TYPE_CHECK_EPSILON
0244 #define BOOST_UBLAS_TYPE_CHECK_EPSILON (type_traits<real_type>::type_sqrt (std::numeric_limits<real_type>::epsilon ()))
0245 #endif
0246 #ifndef BOOST_UBLAS_TYPE_CHECK_MIN
0247 #define BOOST_UBLAS_TYPE_CHECK_MIN (type_traits<real_type>::type_sqrt ( (std::numeric_limits<real_type>::min) ()))
0248 #endif
0249 
0250 
0251 /*
0252  * General Configuration
0253  */
0254 
0255 // Proxy shortcuts overload the alreadly heavily over used operator ()
0256 //#define BOOST_UBLAS_ENABLE_PROXY_SHORTCUTS
0257 
0258 // In order to simplify debugging is is possible to simplify expression template
0259 // so they are restricted to a single operation
0260 // #define BOOST_UBLAS_SIMPLE_ET_DEBUG
0261 
0262 // Use invariant hoisting.
0263 // #define BOOST_UBLAS_USE_INVARIANT_HOISTING
0264 
0265 // Use Duff's device in element access loops
0266 // #define BOOST_UBLAS_USE_DUFF_DEVICE
0267 
0268 // Choose evaluation method for dense vectors and matrices
0269 #if !(defined(BOOST_UBLAS_USE_INDEXING) || defined(BOOST_UBLAS_USE_ITERATING))
0270 #define BOOST_UBLAS_USE_INDEXING
0271 #endif
0272 // #define BOOST_UBLAS_ITERATOR_THRESHOLD 0
0273 
0274 // Use indexed iterators - unsupported implementation experiment
0275 // #define BOOST_UBLAS_USE_INDEXED_ITERATOR
0276 
0277 // Alignment of bounded_array type
0278 #ifndef BOOST_UBLAS_BOUNDED_ARRAY_ALIGN
0279 #define BOOST_UBLAS_BOUNDED_ARRAY_ALIGN
0280 #endif
0281 
0282 // Enable different sparse element proxies
0283 #ifndef BOOST_UBLAS_NO_ELEMENT_PROXIES
0284 // Sparse proxies prevent reference invalidation problems in expressions such as:
0285 // a [1] = a [0] = 1        Thanks to Marc Duflot for spotting this.
0286 // #define BOOST_UBLAS_STRICT_MAP_ARRAY
0287 #define BOOST_UBLAS_STRICT_VECTOR_SPARSE
0288 #define BOOST_UBLAS_STRICT_MATRIX_SPARSE
0289 // Hermitian matrices use element proxies to allow assignment to conjugate triangle
0290 #define BOOST_UBLAS_STRICT_HERMITIAN
0291 #endif
0292 
0293 // Define to configure special settings for reference returning members
0294 // #define BOOST_UBLAS_REFERENCE_CONST_MEMBER
0295 // #define BOOST_UBLAS_PROXY_CONST_MEMBER
0296 
0297 
0298 // Include type declerations and functions
0299 #include <boost/numeric/ublas/fwd.hpp>
0300 #include <boost/numeric/ublas/detail/definitions.hpp>
0301 
0302 
0303 #endif
0304