00001 /*! \file scppnt.h 00002 \brief SCPPNT general header file with macro definitions which control compilation options. 00003 00004 Definitions of macros which control compilation options. To enable 00005 a particular option uncomment the associated #define. This file 00006 also includes subscript.h which defines a Subscript type 00007 used by SCPPNT. 00008 00009 Alternatively, compiler options can be used to define 00010 the symbols that control the compilation options. 00011 For example, to enable bounds checking with GCC use: 00012 00013 g++ -DSCPPNT_BOUNDS_CHECK ... 00014 00015 A compiler option must be used to define SCPPNT_NO_DIR_PREFIX 00016 so that subscript.h is included correctly at the end of this file. 00017 00018 */ 00019 00020 /* 00021 00022 Simple C++ Numerical Toolkit (SCPPNT) 00023 http://www.smallwaters.com/software/cpp/scppnt.html 00024 This release updates original work contributed by 00025 Brad Hanson (http://www.b-a-h.com/) in 2001. 00026 00027 */ 00028 00029 // Text to appear on doxygen HTML index page. 00030 /*! \mainpage Simple C++ Numerical Toolkit (SCPPNT) 00031 00032 The Simple C++ Numerical Toolkit (SCPPNT) is derived from 00033 the Template Numerical Toolkit (http://math.nist.gov/tnt). 00034 SCPPNT includes simple concrete vector and matrix classes, 00035 and some numerical algorithms that operate on vectors 00036 and matrices. 00037 00038 The home page for the current version of SCPPNT is at 00039 http://www.smallwaters.com/software/cpp/scppnt.html. 00040 00041 The SCPPNT template library was originally developed and 00042 contributed by Brad Hanson (http://www.b-a-h.com/) in 2001. 00043 00044 */ 00045 00046 // Put namespace SCPPNT documentation here 00047 /*! \namespace SCPPNT 00048 \brief Namespace containing SCPPNT classes and functions. 00049 00050 Namespace containing Simple C++ Numerical Toolkit (SCPPNT) 00051 classes and functions. 00052 */ 00053 00054 #ifndef SCPPNT_H 00055 #define SCPPNT_H 00056 00057 /* Repeat list of symbols here so they are read by DOXYGEN 00058 in order to produce documentation even when they are not defined 00059 below. If a new symbol is added it should be listed here so 00060 DOXYGEN will include the symbol in the documentation even 00061 when it is not defined for use with SCPPNT. */ 00062 #ifdef DOXYGEN 00063 #define SCPPNT_BOUNDS_CHECK 00064 #define SCPPNT_NO_DIR_PREFIX 00065 #define SCPPNT_NO_IO 00066 #define SCPPNT_UNROLL_LOOPS 00067 #define SCPPNT_USE_REGIONS 00068 #define SCPPNT_MEMBER_COMPARISONS 00069 #define BOOST_NO_STDC_NAMESPACE 00070 #define BOOST_MSVC 00071 #endif 00072 00073 /*! \def SCPPNT_NO_DIR_PREFIX 00074 \brief If defined then includes do not contain the directory prefix scppnt/. 00075 00076 If SCPPNT_NO_DIR_PREFIX is defined then SCPPNT header file names included in 00077 SCPPNT source files contain the directory prefix scppnt/. For 00078 example, if SCPPNT_NO_DIR_PREFIX is not defined then 00079 00080 #include "scppnt/vec.h" 00081 00082 is used, whereas if SCPPNT_NO_DIR_PREFIX is defined then 00083 00084 #include "vec.h" 00085 00086 is used. 00087 00088 This must be defined using a compiler option rather than in this 00089 file, as in 00090 00091 g++ -DSCPPNT_NO_DIR_PREFIX ... 00092 00093 so this file is correctly included. 00094 */ 00095 // #define SCPPNT_NO_DIR_PREFIX 00096 00097 /*! \def SCPPNT_BOUNDS_CHECK 00098 \brief Turns on bounds checking for matrix and vector element access. 00099 00100 Define this macro if you want SCPPNT to ensure all references are 00101 within the bounds of the vector or matrix. This encurs a run-time 00102 overhead, of course, but is recommended while developing code. It 00103 can be turned off for production runs. 00104 */ 00105 // #define SCPPNT_BOUNDS_CHECK 00106 00107 /*! \def SCPPNT_NO_IO 00108 \brief If defined then functions requiring stream IO facilities are not compiled. 00109 00110 If SCPPNT_NO_IO is defined functions are not compiled which require 00111 the C++ stream IO facilities. This includes vector and matrix 00112 constructors from strings since they use strstream. 00113 */ 00114 // #define SCPPNT_NO_IO 00115 00116 /*! \def SCPPNT_UNROLL_LOOPS 00117 \brief Controls whether loop unrolling is performed. 00118 00119 If SCPPNT_UNROLL_LOOPS is defined then loops are unrolled in a few 00120 places in vec.h and cmat.h 00121 */ 00122 // #define SCPPNT_UNROLL_LOOPS 00123 00124 /*! \def BOOST_NO_STDC_NAMESPACE 00125 \brief Indicates standard C library is not in the std namespace. 00126 00127 This macro must be defined for compilers that do not include 00128 the standard C library in the std namespace (like Microsoft 00129 Visual C++ 6). This macro is used in scppnt_error.cpp and since 00130 this file is not included in scppnt_error.cpp the macro 00131 must be defined using a compiler option such as 00132 00133 g++ -DBOOST_NO_STDC_NAMESPACE ... 00134 00135 This symbol is from the configuration header for the 00136 Boost libraries (http://www.boost.org/) to provide a common 00137 symbol when SCPPNT is used with a Boost library. 00138 */ 00139 // #define BOOST_NO_STDC_NAMESPACE 00140 00141 /*! \def BOOST_MSVC 00142 \brief Indicates program is being compiled with Microsoft Visual C++. 00143 00144 This macro is used to work around some bugs in 00145 Microsoft Visual C++ 6. Defining this symbol will NOT 00146 allow all elements of SCPPNT to be compiled with Microsoft 00147 Visual C++ 6, although the matrix and vector classes 00148 defined in vec.h and cmat.h should compile. 00149 00150 This symbol is from the configuration header for the 00151 Boost libraries (http://www.boost.org/) to provide a common 00152 symbol when SCPPNT is used with a Boost library. 00153 */ 00154 // #define BOOST_MSVC 00155 00156 /*! \def SCPPNT_USE_REGIONS 00157 \brief Allows operator() which returns a region to be defined in the Matrix class. 00158 00159 If SCPPNT_USE_REGIONS is defined then a function call operator is 00160 defined for SCPPNT::Matrix which returns a region. This allows 00161 a simpler notation for creating regions from matrices as compared to 00162 using Region2D constructors. 00163 00164 */ 00165 // #define SCPPNT_USE_REGIONS 00166 00167 /*! \def SCPPNT_MEMBER_COMPARISONS 00168 \brief Use member functions for iterator comparison operators. 00169 00170 The techinique used for logical comparison operators for iterators that allow 00171 constant types to be compared with non-constant types using non-template 00172 friend functions is described in: 00173 00174 Austern, Matt (2001, January). Defining iterators and const iterators. 00175 C/C++ Users Journal (www.cuj.com), 74-79. 00176 00177 For some compilers (e.g., gcc) this technique does not work. 00178 If SCPPNT_MEMBER_COMPARISONS is defined comparisons are 00179 defined using member functions instead of non-template 00180 friend functions. In this case the expression in1==in2, 00181 where in1 is a constant iterator and in2 is a non-constant 00182 iterator, will not compile. 00183 00184 */ 00185 // #define SCPPNT_MEMBER_COMPARISONS 00186 00187 //--------------------------------------------------------------------- 00188 // Define the data type used for matrix and vector Subscripts. 00189 // 00190 // See subscript.h for details. 00191 //--------------------------------------------------------------------- 00192 #ifdef SCPPNT_NO_DIR_PREFIX 00193 #include "subscript.h" 00194 #else 00195 #include "scppnt/subscript.h" 00196 #endif 00197 00198 #endif // SCPPNT_H