2014 Eurobot fork

Dependencies:   mbed-rtos mbed QEI

Committer:
rsavitski
Date:
Tue Oct 15 12:19:32 2013 +0000
Revision:
92:4a1225fbb146
Parent:
91:fdadfd883825
touch: ripped out 2013-specific bits. Need to address "2014" comments. Rewrite AI layer and other deleted parts.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
madcowswe 15:9c5aaeda36dc 1 /*
madcowswe 15:9c5aaeda36dc 2 * Tiny Vector Matrix Library
madcowswe 15:9c5aaeda36dc 3 * Dense Vector Matrix Libary of Tiny size using Expression Templates
madcowswe 15:9c5aaeda36dc 4 *
madcowswe 15:9c5aaeda36dc 5 * Copyright (C) 2001 - 2007 Olaf Petzold <opetzold@users.sourceforge.net>
madcowswe 15:9c5aaeda36dc 6 *
madcowswe 15:9c5aaeda36dc 7 * This library is free software; you can redistribute it and/or
madcowswe 15:9c5aaeda36dc 8 * modify it under the terms of the GNU Lesser General Public
madcowswe 15:9c5aaeda36dc 9 * License as published by the Free Software Foundation; either
madcowswe 15:9c5aaeda36dc 10 * version 2.1 of the License, or (at your option) any later version.
madcowswe 15:9c5aaeda36dc 11 *
madcowswe 15:9c5aaeda36dc 12 * This library is distributed in the hope that it will be useful,
madcowswe 15:9c5aaeda36dc 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
madcowswe 15:9c5aaeda36dc 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
madcowswe 15:9c5aaeda36dc 15 * Lesser General Public License for more details.
madcowswe 15:9c5aaeda36dc 16 *
madcowswe 15:9c5aaeda36dc 17 * You should have received a copy of the GNU Lesser General Public
madcowswe 15:9c5aaeda36dc 18 * License along with this library; if not, write to the Free Software
madcowswe 15:9c5aaeda36dc 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
madcowswe 15:9c5aaeda36dc 20 *
madcowswe 15:9c5aaeda36dc 21 * $Id: tvmet.h,v 1.21 2007-06-23 15:58:59 opetzold Exp $
madcowswe 15:9c5aaeda36dc 22 */
madcowswe 15:9c5aaeda36dc 23
madcowswe 15:9c5aaeda36dc 24 #ifndef TVMET_H
madcowswe 15:9c5aaeda36dc 25 #define TVMET_H
madcowswe 15:9c5aaeda36dc 26
madcowswe 15:9c5aaeda36dc 27 #include <tvmet/config.h>
madcowswe 15:9c5aaeda36dc 28
rsavitski 91:fdadfd883825 29 // BEGIN typeid hack
rsavitski 91:fdadfd883825 30 #include <string>
rsavitski 91:fdadfd883825 31 class typeid_hack{
rsavitski 91:fdadfd883825 32 public:
rsavitski 91:fdadfd883825 33 string name() { return "dummy_typeid"; }
rsavitski 91:fdadfd883825 34 };
rsavitski 91:fdadfd883825 35 #define typeid(arg...) typeid_hack()
rsavitski 91:fdadfd883825 36 // END typeid hack
rsavitski 91:fdadfd883825 37
madcowswe 15:9c5aaeda36dc 38
madcowswe 15:9c5aaeda36dc 39 /***********************************************************************
madcowswe 15:9c5aaeda36dc 40 * Compiler specifics
madcowswe 15:9c5aaeda36dc 41 ***********************************************************************/
madcowswe 15:9c5aaeda36dc 42 #if defined(__GNUC__)
madcowswe 15:9c5aaeda36dc 43 # include <tvmet/config/config-gcc.h>
madcowswe 15:9c5aaeda36dc 44 #endif
madcowswe 15:9c5aaeda36dc 45
madcowswe 15:9c5aaeda36dc 46 #if defined(__ICC)
madcowswe 15:9c5aaeda36dc 47 # include <tvmet/config/config-icc.h>
madcowswe 15:9c5aaeda36dc 48 #endif
madcowswe 15:9c5aaeda36dc 49
madcowswe 15:9c5aaeda36dc 50 #if defined(__KCC)
madcowswe 15:9c5aaeda36dc 51 # include <tvmet/config/config-kcc.h>
madcowswe 15:9c5aaeda36dc 52 #endif
madcowswe 15:9c5aaeda36dc 53
madcowswe 15:9c5aaeda36dc 54 #if defined(__PGI)
madcowswe 15:9c5aaeda36dc 55 # include <tvmet/config/config-pgi.h>
madcowswe 15:9c5aaeda36dc 56 #endif
madcowswe 15:9c5aaeda36dc 57
madcowswe 15:9c5aaeda36dc 58 // vc7.1: 1310 and vc7.0 1300
madcowswe 15:9c5aaeda36dc 59 #if defined(_MSC_VER) && (_MSC_VER >= 1310)
madcowswe 15:9c5aaeda36dc 60 # include <tvmet/config/config-vc71.h>
madcowswe 15:9c5aaeda36dc 61 #endif
madcowswe 15:9c5aaeda36dc 62
madcowswe 15:9c5aaeda36dc 63
madcowswe 15:9c5aaeda36dc 64 // give up for these cases
madcowswe 15:9c5aaeda36dc 65 #if !defined(TVMET_HAVE_MUTABLE)
madcowswe 15:9c5aaeda36dc 66 # error "Your compiler doesn't support the mutable keyword! Giving up."
madcowswe 15:9c5aaeda36dc 67 #endif
madcowswe 15:9c5aaeda36dc 68
madcowswe 15:9c5aaeda36dc 69 #if !defined(TVMET_HAVE_TYPENAME)
madcowswe 15:9c5aaeda36dc 70 # error "Your compiler doesn't support the typename keyword! Giving up."
madcowswe 15:9c5aaeda36dc 71 #endif
madcowswe 15:9c5aaeda36dc 72
madcowswe 15:9c5aaeda36dc 73 #if !defined(TVMET_HAVE_NAMESPACES)
madcowswe 15:9c5aaeda36dc 74 # error "Your compiler doesn't support the namespace concept! Giving up."
madcowswe 15:9c5aaeda36dc 75 #endif
madcowswe 15:9c5aaeda36dc 76
madcowswe 15:9c5aaeda36dc 77 #if !defined(TVMET_HAVE_PARTIAL_SPECIALIZATION)
madcowswe 15:9c5aaeda36dc 78 # error "Your compiler doesn't support partial specialization! Giving up."
madcowswe 15:9c5aaeda36dc 79 #endif
madcowswe 15:9c5aaeda36dc 80
madcowswe 15:9c5aaeda36dc 81
madcowswe 15:9c5aaeda36dc 82 /*
madcowswe 15:9c5aaeda36dc 83 * other compiler specific stuff
madcowswe 15:9c5aaeda36dc 84 */
madcowswe 15:9c5aaeda36dc 85
madcowswe 15:9c5aaeda36dc 86 /**
madcowswe 15:9c5aaeda36dc 87 * \def TVMET_CXX_ALWAYS_INLINE
madcowswe 15:9c5aaeda36dc 88 * \brief Compiler specific stuff to force inline code if supported.
madcowswe 15:9c5aaeda36dc 89 *
madcowswe 15:9c5aaeda36dc 90 * Mainly, this declares the functions using g++'s
madcowswe 15:9c5aaeda36dc 91 * __attribute__((always_inline)). This features is enabled
madcowswe 15:9c5aaeda36dc 92 * on defined TVMET_OPTIMIZE.
madcowswe 15:9c5aaeda36dc 93 */
madcowswe 15:9c5aaeda36dc 94 #if !defined(TVMET_CXX_ALWAYS_INLINE)
madcowswe 15:9c5aaeda36dc 95 #define TVMET_CXX_ALWAYS_INLINE
madcowswe 15:9c5aaeda36dc 96 #endif
madcowswe 15:9c5aaeda36dc 97
madcowswe 15:9c5aaeda36dc 98
madcowswe 15:9c5aaeda36dc 99 /*
madcowswe 15:9c5aaeda36dc 100 * Complexity triggers, compiler and architecture specific.
madcowswe 15:9c5aaeda36dc 101 * If not defined, use defaults.
madcowswe 15:9c5aaeda36dc 102 */
madcowswe 15:9c5aaeda36dc 103
madcowswe 15:9c5aaeda36dc 104 /**
madcowswe 15:9c5aaeda36dc 105 * \def TVMET_COMPLEXITY_DEFAULT_TRIGGER
madcowswe 15:9c5aaeda36dc 106 * \brief Trigger for changing the matrix-product strategy.
madcowswe 15:9c5aaeda36dc 107 */
madcowswe 15:9c5aaeda36dc 108 #if !defined(TVMET_COMPLEXITY_DEFAULT_TRIGGER)
madcowswe 15:9c5aaeda36dc 109 # define TVMET_COMPLEXITY_DEFAULT_TRIGGER 1000
madcowswe 15:9c5aaeda36dc 110 #endif
madcowswe 15:9c5aaeda36dc 111
madcowswe 15:9c5aaeda36dc 112 /**
madcowswe 15:9c5aaeda36dc 113 * \def TVMET_COMPLEXITY_M_ASSIGN_TRIGGER
madcowswe 15:9c5aaeda36dc 114 * \brief Trigger for changing the matrix assign strategy.
madcowswe 15:9c5aaeda36dc 115 */
madcowswe 15:9c5aaeda36dc 116 #if !defined(TVMET_COMPLEXITY_M_ASSIGN_TRIGGER)
madcowswe 15:9c5aaeda36dc 117 # define TVMET_COMPLEXITY_M_ASSIGN_TRIGGER 8*8
madcowswe 15:9c5aaeda36dc 118 #endif
madcowswe 15:9c5aaeda36dc 119
madcowswe 15:9c5aaeda36dc 120 /**
madcowswe 15:9c5aaeda36dc 121 * \def TVMET_COMPLEXITY_MM_TRIGGER
madcowswe 15:9c5aaeda36dc 122 * \brief Trigger for changing the matrix-matrix-product strategy.
madcowswe 15:9c5aaeda36dc 123 * One strategy to build the matrix-matrix-product is to use
madcowswe 15:9c5aaeda36dc 124 * meta templates. The other to use looping.
madcowswe 15:9c5aaeda36dc 125 */
madcowswe 15:9c5aaeda36dc 126 #if !defined(TVMET_COMPLEXITY_MM_TRIGGER)
madcowswe 15:9c5aaeda36dc 127 # define TVMET_COMPLEXITY_MM_TRIGGER 8*8
madcowswe 15:9c5aaeda36dc 128 #endif
madcowswe 15:9c5aaeda36dc 129
madcowswe 15:9c5aaeda36dc 130 /**
madcowswe 15:9c5aaeda36dc 131 * \def TVMET_COMPLEXITY_V_ASSIGN_TRIGGER
madcowswe 15:9c5aaeda36dc 132 * \brief Trigger for changing the vector assign strategy.
madcowswe 15:9c5aaeda36dc 133 */
madcowswe 15:9c5aaeda36dc 134 #if !defined(TVMET_COMPLEXITY_V_ASSIGN_TRIGGER)
madcowswe 15:9c5aaeda36dc 135 # define TVMET_COMPLEXITY_V_ASSIGN_TRIGGER 8
madcowswe 15:9c5aaeda36dc 136 #endif
madcowswe 15:9c5aaeda36dc 137
madcowswe 15:9c5aaeda36dc 138 /**
madcowswe 15:9c5aaeda36dc 139 * \def TVMET_COMPLEXITY_MV_TRIGGER
madcowswe 15:9c5aaeda36dc 140 * \brief Trigger for changing the matrix-vector strategy.
madcowswe 15:9c5aaeda36dc 141 * One strategy to build the matrix-vector-product is to use
madcowswe 15:9c5aaeda36dc 142 * meta templates. The other to use looping.
madcowswe 15:9c5aaeda36dc 143 */
madcowswe 15:9c5aaeda36dc 144 #if !defined(TVMET_COMPLEXITY_MV_TRIGGER)
madcowswe 15:9c5aaeda36dc 145 # define TVMET_COMPLEXITY_MV_TRIGGER 8*8
madcowswe 15:9c5aaeda36dc 146 #endif
madcowswe 15:9c5aaeda36dc 147
madcowswe 15:9c5aaeda36dc 148
madcowswe 15:9c5aaeda36dc 149 /***********************************************************************
madcowswe 15:9c5aaeda36dc 150 * other specials
madcowswe 15:9c5aaeda36dc 151 ***********************************************************************/
madcowswe 15:9c5aaeda36dc 152 #if defined(TVMET_HAVE_IEEE_MATH)
madcowswe 15:9c5aaeda36dc 153 # define _ALL_SOURCE
madcowswe 15:9c5aaeda36dc 154 # if !defined(_XOPEN_SOURCE)
madcowswe 15:9c5aaeda36dc 155 # define _XOPEN_SOURCE
madcowswe 15:9c5aaeda36dc 156 # endif
madcowswe 15:9c5aaeda36dc 157 # if !defined(_XOPEN_SOURCE_EXTENDED)
madcowswe 15:9c5aaeda36dc 158 # define _XOPEN_SOURCE_EXTENDED
madcowswe 15:9c5aaeda36dc 159 # endif
madcowswe 15:9c5aaeda36dc 160 #endif
madcowswe 15:9c5aaeda36dc 161
madcowswe 15:9c5aaeda36dc 162
madcowswe 15:9c5aaeda36dc 163 /**
madcowswe 15:9c5aaeda36dc 164 * \def TVMET_DEBUG
madcowswe 15:9c5aaeda36dc 165 * This is defined if <code>DEBUG</code> is defined. This enables runtime error
madcowswe 15:9c5aaeda36dc 166 * bounds checking. If you compile %tvmet from another source directory
madcowswe 15:9c5aaeda36dc 167 * which defines <code>DEBUG</code>, then <code>TVMET_DEBUG</code> will be
madcowswe 15:9c5aaeda36dc 168 * <b>not</b> defined (This behavior differs from release less than 0.6.0).
madcowswe 15:9c5aaeda36dc 169 */
madcowswe 15:9c5aaeda36dc 170
madcowswe 15:9c5aaeda36dc 171
madcowswe 15:9c5aaeda36dc 172 /**
madcowswe 15:9c5aaeda36dc 173 * \def TVMET_OPTIMIZE
madcowswe 15:9c5aaeda36dc 174 * If this is defined tvmet uses some compiler specific keywords.
madcowswe 15:9c5aaeda36dc 175 * Mainly, this declares the functions using gcc's
madcowswe 15:9c5aaeda36dc 176 * <tt>__attribute__((always_inline))</tt>. This allows the
madcowswe 15:9c5aaeda36dc 177 * compiler to produce high efficient code even on less
madcowswe 15:9c5aaeda36dc 178 * optimization levels, like gcc's -O2 or even -O!
madcowswe 15:9c5aaeda36dc 179 * This is known to work with gcc v3.3.3 (and higher).
madcowswe 15:9c5aaeda36dc 180 * Using icc's v8 gnuc compatibility mode this may work, I've read
madcowswe 15:9c5aaeda36dc 181 * that it's using as an hint, this means you can have static inline
madcowswe 15:9c5aaeda36dc 182 * functions inside left.
madcowswe 15:9c5aaeda36dc 183 */
madcowswe 15:9c5aaeda36dc 184 #if !defined(TVMET_OPTIMIZE)
madcowswe 15:9c5aaeda36dc 185 # undef TVMET_CXX_ALWAYS_INLINE
madcowswe 15:9c5aaeda36dc 186 # define TVMET_CXX_ALWAYS_INLINE
madcowswe 15:9c5aaeda36dc 187 #endif
madcowswe 15:9c5aaeda36dc 188
madcowswe 15:9c5aaeda36dc 189
madcowswe 15:9c5aaeda36dc 190 /***********************************************************************
madcowswe 15:9c5aaeda36dc 191 * Namespaces
madcowswe 15:9c5aaeda36dc 192 ***********************************************************************/
madcowswe 15:9c5aaeda36dc 193
madcowswe 15:9c5aaeda36dc 194
madcowswe 15:9c5aaeda36dc 195 /**
madcowswe 15:9c5aaeda36dc 196 * \namespace std
madcowswe 15:9c5aaeda36dc 197 * \brief Imported ISO/IEC 14882:1998 functions from std namespace.
madcowswe 15:9c5aaeda36dc 198 */
madcowswe 15:9c5aaeda36dc 199
madcowswe 15:9c5aaeda36dc 200 /**
madcowswe 15:9c5aaeda36dc 201 * \namespace tvmet
madcowswe 15:9c5aaeda36dc 202 * \brief The namespace for the Tiny %Vector %Matrix using Expression Templates Libary.
madcowswe 15:9c5aaeda36dc 203 */
madcowswe 15:9c5aaeda36dc 204
madcowswe 15:9c5aaeda36dc 205 /**
madcowswe 15:9c5aaeda36dc 206 * \namespace tvmet::meta
madcowswe 15:9c5aaeda36dc 207 * \brief Meta stuff inside here.
madcowswe 15:9c5aaeda36dc 208 */
madcowswe 15:9c5aaeda36dc 209
madcowswe 15:9c5aaeda36dc 210 /**
madcowswe 15:9c5aaeda36dc 211 * \namespace tvmet::loop
madcowswe 15:9c5aaeda36dc 212 * \brief Loop stuff inside here.
madcowswe 15:9c5aaeda36dc 213 */
madcowswe 15:9c5aaeda36dc 214
madcowswe 15:9c5aaeda36dc 215 /**
madcowswe 15:9c5aaeda36dc 216 * \namespace tvmet::element_wise
madcowswe 15:9c5aaeda36dc 217 * \brief Operators inside this namespace does elementwise operations.
madcowswe 15:9c5aaeda36dc 218 */
madcowswe 15:9c5aaeda36dc 219
madcowswe 15:9c5aaeda36dc 220 /**
madcowswe 15:9c5aaeda36dc 221 * \namespace tvmet::util
madcowswe 15:9c5aaeda36dc 222 * \brief Miscellaneous utility functions used.
madcowswe 15:9c5aaeda36dc 223 */
madcowswe 15:9c5aaeda36dc 224
madcowswe 15:9c5aaeda36dc 225
madcowswe 15:9c5aaeda36dc 226 /***********************************************************************
madcowswe 15:9c5aaeda36dc 227 * forwards
madcowswe 15:9c5aaeda36dc 228 ***********************************************************************/
madcowswe 15:9c5aaeda36dc 229 #if defined(TVMET_HAVE_COMPLEX)
madcowswe 15:9c5aaeda36dc 230 namespace std {
madcowswe 15:9c5aaeda36dc 231 template<class T> class complex;
madcowswe 15:9c5aaeda36dc 232 }
madcowswe 15:9c5aaeda36dc 233 #endif
madcowswe 15:9c5aaeda36dc 234
madcowswe 15:9c5aaeda36dc 235
madcowswe 15:9c5aaeda36dc 236 /***********************************************************************
madcowswe 15:9c5aaeda36dc 237 * other stuff
madcowswe 15:9c5aaeda36dc 238 ***********************************************************************/
madcowswe 15:9c5aaeda36dc 239 #include <tvmet/TvmetBase.h>
madcowswe 15:9c5aaeda36dc 240
madcowswe 15:9c5aaeda36dc 241
madcowswe 15:9c5aaeda36dc 242 #endif // TVMET_H
madcowswe 15:9c5aaeda36dc 243
madcowswe 15:9c5aaeda36dc 244 // Local Variables:
madcowswe 15:9c5aaeda36dc 245 // mode:C++
madcowswe 15:9c5aaeda36dc 246 // tab-width:8
madcowswe 15:9c5aaeda36dc 247 // End:
madcowswe 15:9c5aaeda36dc 248 // LocalWords: gnuc gcc's icc's std