Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-rtos mbed QEI
tvmet.h
00001 /* 00002 * Tiny Vector Matrix Library 00003 * Dense Vector Matrix Libary of Tiny size using Expression Templates 00004 * 00005 * Copyright (C) 2001 - 2007 Olaf Petzold <opetzold@users.sourceforge.net> 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 * 00021 * $Id: tvmet.h,v 1.21 2007-06-23 15:58:59 opetzold Exp $ 00022 */ 00023 00024 #ifndef TVMET_H 00025 #define TVMET_H 00026 00027 #include <tvmet/config.h> 00028 00029 // BEGIN typeid hack 00030 #include <string> 00031 class typeid_hack{ 00032 public: 00033 string name() { return "dummy_typeid"; } 00034 }; 00035 #define typeid(arg...) typeid_hack() 00036 // END typeid hack 00037 00038 00039 /*********************************************************************** 00040 * Compiler specifics 00041 ***********************************************************************/ 00042 #if defined(__GNUC__) 00043 # include <tvmet/config/config-gcc.h> 00044 #endif 00045 00046 #if defined(__ICC) 00047 # include <tvmet/config/config-icc.h> 00048 #endif 00049 00050 #if defined(__KCC) 00051 # include <tvmet/config/config-kcc.h> 00052 #endif 00053 00054 #if defined(__PGI) 00055 # include <tvmet/config/config-pgi.h> 00056 #endif 00057 00058 // vc7.1: 1310 and vc7.0 1300 00059 #if defined(_MSC_VER) && (_MSC_VER >= 1310) 00060 # include <tvmet/config/config-vc71.h> 00061 #endif 00062 00063 00064 // give up for these cases 00065 #if !defined(TVMET_HAVE_MUTABLE) 00066 # error "Your compiler doesn't support the mutable keyword! Giving up." 00067 #endif 00068 00069 #if !defined(TVMET_HAVE_TYPENAME) 00070 # error "Your compiler doesn't support the typename keyword! Giving up." 00071 #endif 00072 00073 #if !defined(TVMET_HAVE_NAMESPACES) 00074 # error "Your compiler doesn't support the namespace concept! Giving up." 00075 #endif 00076 00077 #if !defined(TVMET_HAVE_PARTIAL_SPECIALIZATION) 00078 # error "Your compiler doesn't support partial specialization! Giving up." 00079 #endif 00080 00081 00082 /* 00083 * other compiler specific stuff 00084 */ 00085 00086 /** 00087 * \def TVMET_CXX_ALWAYS_INLINE 00088 * \brief Compiler specific stuff to force inline code if supported. 00089 * 00090 * Mainly, this declares the functions using g++'s 00091 * __attribute__((always_inline)). This features is enabled 00092 * on defined TVMET_OPTIMIZE. 00093 */ 00094 #if !defined(TVMET_CXX_ALWAYS_INLINE) 00095 #define TVMET_CXX_ALWAYS_INLINE 00096 #endif 00097 00098 00099 /* 00100 * Complexity triggers, compiler and architecture specific. 00101 * If not defined, use defaults. 00102 */ 00103 00104 /** 00105 * \def TVMET_COMPLEXITY_DEFAULT_TRIGGER 00106 * \brief Trigger for changing the matrix-product strategy. 00107 */ 00108 #if !defined(TVMET_COMPLEXITY_DEFAULT_TRIGGER) 00109 # define TVMET_COMPLEXITY_DEFAULT_TRIGGER 1000 00110 #endif 00111 00112 /** 00113 * \def TVMET_COMPLEXITY_M_ASSIGN_TRIGGER 00114 * \brief Trigger for changing the matrix assign strategy. 00115 */ 00116 #if !defined(TVMET_COMPLEXITY_M_ASSIGN_TRIGGER) 00117 # define TVMET_COMPLEXITY_M_ASSIGN_TRIGGER 8*8 00118 #endif 00119 00120 /** 00121 * \def TVMET_COMPLEXITY_MM_TRIGGER 00122 * \brief Trigger for changing the matrix-matrix-product strategy. 00123 * One strategy to build the matrix-matrix-product is to use 00124 * meta templates. The other to use looping. 00125 */ 00126 #if !defined(TVMET_COMPLEXITY_MM_TRIGGER) 00127 # define TVMET_COMPLEXITY_MM_TRIGGER 8*8 00128 #endif 00129 00130 /** 00131 * \def TVMET_COMPLEXITY_V_ASSIGN_TRIGGER 00132 * \brief Trigger for changing the vector assign strategy. 00133 */ 00134 #if !defined(TVMET_COMPLEXITY_V_ASSIGN_TRIGGER) 00135 # define TVMET_COMPLEXITY_V_ASSIGN_TRIGGER 8 00136 #endif 00137 00138 /** 00139 * \def TVMET_COMPLEXITY_MV_TRIGGER 00140 * \brief Trigger for changing the matrix-vector strategy. 00141 * One strategy to build the matrix-vector-product is to use 00142 * meta templates. The other to use looping. 00143 */ 00144 #if !defined(TVMET_COMPLEXITY_MV_TRIGGER) 00145 # define TVMET_COMPLEXITY_MV_TRIGGER 8*8 00146 #endif 00147 00148 00149 /*********************************************************************** 00150 * other specials 00151 ***********************************************************************/ 00152 #if defined(TVMET_HAVE_IEEE_MATH) 00153 # define _ALL_SOURCE 00154 # if !defined(_XOPEN_SOURCE) 00155 # define _XOPEN_SOURCE 00156 # endif 00157 # if !defined(_XOPEN_SOURCE_EXTENDED) 00158 # define _XOPEN_SOURCE_EXTENDED 00159 # endif 00160 #endif 00161 00162 00163 /** 00164 * \def TVMET_DEBUG 00165 * This is defined if <code>DEBUG</code> is defined. This enables runtime error 00166 * bounds checking. If you compile %tvmet from another source directory 00167 * which defines <code>DEBUG</code>, then <code>TVMET_DEBUG</code> will be 00168 * <b>not</b> defined (This behavior differs from release less than 0.6.0). 00169 */ 00170 00171 00172 /** 00173 * \def TVMET_OPTIMIZE 00174 * If this is defined tvmet uses some compiler specific keywords. 00175 * Mainly, this declares the functions using gcc's 00176 * <tt>__attribute__((always_inline))</tt>. This allows the 00177 * compiler to produce high efficient code even on less 00178 * optimization levels, like gcc's -O2 or even -O! 00179 * This is known to work with gcc v3.3.3 (and higher). 00180 * Using icc's v8 gnuc compatibility mode this may work, I've read 00181 * that it's using as an hint, this means you can have static inline 00182 * functions inside left. 00183 */ 00184 #if !defined(TVMET_OPTIMIZE) 00185 # undef TVMET_CXX_ALWAYS_INLINE 00186 # define TVMET_CXX_ALWAYS_INLINE 00187 #endif 00188 00189 00190 /*********************************************************************** 00191 * Namespaces 00192 ***********************************************************************/ 00193 00194 00195 /** 00196 * \namespace std 00197 * \brief Imported ISO/IEC 14882:1998 functions from std namespace. 00198 */ 00199 00200 /** 00201 * \namespace tvmet 00202 * \brief The namespace for the Tiny %Vector %Matrix using Expression Templates Libary. 00203 */ 00204 00205 /** 00206 * \namespace tvmet::meta 00207 * \brief Meta stuff inside here. 00208 */ 00209 00210 /** 00211 * \namespace tvmet::loop 00212 * \brief Loop stuff inside here. 00213 */ 00214 00215 /** 00216 * \namespace tvmet::element_wise 00217 * \brief Operators inside this namespace does elementwise operations. 00218 */ 00219 00220 /** 00221 * \namespace tvmet::util 00222 * \brief Miscellaneous utility functions used. 00223 */ 00224 00225 00226 /*********************************************************************** 00227 * forwards 00228 ***********************************************************************/ 00229 #if defined(TVMET_HAVE_COMPLEX) 00230 namespace std { 00231 template<class T> class complex; 00232 } 00233 #endif 00234 00235 00236 /*********************************************************************** 00237 * other stuff 00238 ***********************************************************************/ 00239 #include <tvmet/TvmetBase.h> 00240 00241 00242 #endif // TVMET_H 00243 00244 // Local Variables: 00245 // mode:C++ 00246 // tab-width:8 00247 // End: 00248 // LocalWords: gnuc gcc's icc's std
Generated on Wed Jul 13 2022 18:41:59 by
