Cooper Liu
/
Eurobot2013_Co-Processor
working version with calibration done
Fork of Eurobot2013 by
tvmet/xpr/MatrixBinaryFunctions.h@11:5ba926692210, 2013-04-09 (annotated)
- Committer:
- xiaxia686
- Date:
- Tue Apr 09 15:32:47 2013 +0000
- Revision:
- 11:5ba926692210
- Parent:
- 1:6799c07fe510
woking version (calibrated)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sv | 1:6799c07fe510 | 1 | /* |
sv | 1:6799c07fe510 | 2 | * Tiny Vector Matrix Library |
sv | 1:6799c07fe510 | 3 | * Dense Vector Matrix Libary of Tiny size using Expression Templates |
sv | 1:6799c07fe510 | 4 | * |
sv | 1:6799c07fe510 | 5 | * Copyright (C) 2001 - 2007 Olaf Petzold <opetzold@users.sourceforge.net> |
sv | 1:6799c07fe510 | 6 | * |
sv | 1:6799c07fe510 | 7 | * This library is free software; you can redistribute it and/or |
sv | 1:6799c07fe510 | 8 | * modify it under the terms of the GNU lesser General Public |
sv | 1:6799c07fe510 | 9 | * License as published by the Free Software Foundation; either |
sv | 1:6799c07fe510 | 10 | * version 2.1 of the License, or (at your option) any later version. |
sv | 1:6799c07fe510 | 11 | * |
sv | 1:6799c07fe510 | 12 | * This library is distributed in the hope that it will be useful, |
sv | 1:6799c07fe510 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
sv | 1:6799c07fe510 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
sv | 1:6799c07fe510 | 15 | * lesser General Public License for more details. |
sv | 1:6799c07fe510 | 16 | * |
sv | 1:6799c07fe510 | 17 | * You should have received a copy of the GNU lesser General Public |
sv | 1:6799c07fe510 | 18 | * License along with this library; if not, write to the Free Software |
sv | 1:6799c07fe510 | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
sv | 1:6799c07fe510 | 20 | * |
sv | 1:6799c07fe510 | 21 | * $Id: MatrixBinaryFunctions.h,v 1.12 2007-06-23 15:59:00 opetzold Exp $ |
sv | 1:6799c07fe510 | 22 | */ |
sv | 1:6799c07fe510 | 23 | |
sv | 1:6799c07fe510 | 24 | #ifndef TVMET_XPR_MATRIX_BINARY_FUNCTIONS_H |
sv | 1:6799c07fe510 | 25 | #define TVMET_XPR_MATRIX_BINARY_FUNCTIONS_H |
sv | 1:6799c07fe510 | 26 | |
sv | 1:6799c07fe510 | 27 | namespace tvmet { |
sv | 1:6799c07fe510 | 28 | |
sv | 1:6799c07fe510 | 29 | |
sv | 1:6799c07fe510 | 30 | /********************************************************* |
sv | 1:6799c07fe510 | 31 | * PART I: DECLARATION |
sv | 1:6799c07fe510 | 32 | *********************************************************/ |
sv | 1:6799c07fe510 | 33 | |
sv | 1:6799c07fe510 | 34 | /* |
sv | 1:6799c07fe510 | 35 | * binary_function(XprMatrix<E1, Rows, Cols>, XprMatrix<E2, Rows, Cols>) |
sv | 1:6799c07fe510 | 36 | */ |
sv | 1:6799c07fe510 | 37 | #define TVMET_DECLARE_MACRO(NAME) \ |
sv | 1:6799c07fe510 | 38 | template<class E1, std::size_t Rows, std::size_t Cols, class E2> \ |
sv | 1:6799c07fe510 | 39 | XprMatrix< \ |
sv | 1:6799c07fe510 | 40 | XprBinOp< \ |
sv | 1:6799c07fe510 | 41 | Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ |
sv | 1:6799c07fe510 | 42 | XprMatrix<E1, Rows, Cols>, \ |
sv | 1:6799c07fe510 | 43 | XprMatrix<E2, Rows, Cols> \ |
sv | 1:6799c07fe510 | 44 | >, \ |
sv | 1:6799c07fe510 | 45 | Rows, Cols \ |
sv | 1:6799c07fe510 | 46 | > \ |
sv | 1:6799c07fe510 | 47 | NAME(const XprMatrix<E1, Rows, Cols>& lhs, \ |
sv | 1:6799c07fe510 | 48 | const XprMatrix<E2, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE; |
sv | 1:6799c07fe510 | 49 | |
sv | 1:6799c07fe510 | 50 | TVMET_DECLARE_MACRO(atan2) |
sv | 1:6799c07fe510 | 51 | TVMET_DECLARE_MACRO(drem) |
sv | 1:6799c07fe510 | 52 | TVMET_DECLARE_MACRO(fmod) |
sv | 1:6799c07fe510 | 53 | TVMET_DECLARE_MACRO(hypot) |
sv | 1:6799c07fe510 | 54 | TVMET_DECLARE_MACRO(jn) |
sv | 1:6799c07fe510 | 55 | TVMET_DECLARE_MACRO(yn) |
sv | 1:6799c07fe510 | 56 | TVMET_DECLARE_MACRO(pow) |
sv | 1:6799c07fe510 | 57 | #if defined(TVMET_HAVE_COMPLEX) |
sv | 1:6799c07fe510 | 58 | //TVMET_DECLARE_MACRO(polar) |
sv | 1:6799c07fe510 | 59 | #endif |
sv | 1:6799c07fe510 | 60 | |
sv | 1:6799c07fe510 | 61 | #undef TVMET_DECLARE_MACRO |
sv | 1:6799c07fe510 | 62 | |
sv | 1:6799c07fe510 | 63 | |
sv | 1:6799c07fe510 | 64 | /* |
sv | 1:6799c07fe510 | 65 | * binary_function(XprMatrix<E, Rows, Cols>, POD) |
sv | 1:6799c07fe510 | 66 | */ |
sv | 1:6799c07fe510 | 67 | #define TVMET_DECLARE_MACRO(NAME, TP) \ |
sv | 1:6799c07fe510 | 68 | template<class E, std::size_t Rows, std::size_t Cols> \ |
sv | 1:6799c07fe510 | 69 | XprMatrix< \ |
sv | 1:6799c07fe510 | 70 | XprBinOp< \ |
sv | 1:6799c07fe510 | 71 | Fcnl_##NAME<typename E::value_type, TP >, \ |
sv | 1:6799c07fe510 | 72 | XprMatrix<E, Rows, Cols>, \ |
sv | 1:6799c07fe510 | 73 | XprLiteral< TP > \ |
sv | 1:6799c07fe510 | 74 | >, \ |
sv | 1:6799c07fe510 | 75 | Rows, Cols \ |
sv | 1:6799c07fe510 | 76 | > \ |
sv | 1:6799c07fe510 | 77 | NAME(const XprMatrix<E, Rows, Cols>& lhs, \ |
sv | 1:6799c07fe510 | 78 | TP rhs) TVMET_CXX_ALWAYS_INLINE; |
sv | 1:6799c07fe510 | 79 | |
sv | 1:6799c07fe510 | 80 | TVMET_DECLARE_MACRO(atan2, int) |
sv | 1:6799c07fe510 | 81 | TVMET_DECLARE_MACRO(drem, int) |
sv | 1:6799c07fe510 | 82 | TVMET_DECLARE_MACRO(fmod, int) |
sv | 1:6799c07fe510 | 83 | TVMET_DECLARE_MACRO(hypot, int) |
sv | 1:6799c07fe510 | 84 | TVMET_DECLARE_MACRO(jn, int) |
sv | 1:6799c07fe510 | 85 | TVMET_DECLARE_MACRO(yn, int) |
sv | 1:6799c07fe510 | 86 | TVMET_DECLARE_MACRO(pow, int) |
sv | 1:6799c07fe510 | 87 | |
sv | 1:6799c07fe510 | 88 | #if defined(TVMET_HAVE_LONG_LONG) |
sv | 1:6799c07fe510 | 89 | TVMET_DECLARE_MACRO(atan2, long long int) |
sv | 1:6799c07fe510 | 90 | TVMET_DECLARE_MACRO(drem, long long int) |
sv | 1:6799c07fe510 | 91 | TVMET_DECLARE_MACRO(fmod, long long int) |
sv | 1:6799c07fe510 | 92 | TVMET_DECLARE_MACRO(hypot, long long int) |
sv | 1:6799c07fe510 | 93 | TVMET_DECLARE_MACRO(jn, long long int) |
sv | 1:6799c07fe510 | 94 | TVMET_DECLARE_MACRO(yn,long long int) |
sv | 1:6799c07fe510 | 95 | TVMET_DECLARE_MACRO(pow, long long int) |
sv | 1:6799c07fe510 | 96 | #endif // defined(TVMET_HAVE_LONG_LONG) |
sv | 1:6799c07fe510 | 97 | |
sv | 1:6799c07fe510 | 98 | TVMET_DECLARE_MACRO(atan2, float) |
sv | 1:6799c07fe510 | 99 | TVMET_DECLARE_MACRO(drem, float) |
sv | 1:6799c07fe510 | 100 | TVMET_DECLARE_MACRO(fmod, float) |
sv | 1:6799c07fe510 | 101 | TVMET_DECLARE_MACRO(hypot, float) |
sv | 1:6799c07fe510 | 102 | TVMET_DECLARE_MACRO(jn, float) |
sv | 1:6799c07fe510 | 103 | TVMET_DECLARE_MACRO(yn, float) |
sv | 1:6799c07fe510 | 104 | TVMET_DECLARE_MACRO(pow, float) |
sv | 1:6799c07fe510 | 105 | |
sv | 1:6799c07fe510 | 106 | TVMET_DECLARE_MACRO(atan2, double) |
sv | 1:6799c07fe510 | 107 | TVMET_DECLARE_MACRO(drem, double) |
sv | 1:6799c07fe510 | 108 | TVMET_DECLARE_MACRO(fmod, double) |
sv | 1:6799c07fe510 | 109 | TVMET_DECLARE_MACRO(hypot,double) |
sv | 1:6799c07fe510 | 110 | TVMET_DECLARE_MACRO(jn, double) |
sv | 1:6799c07fe510 | 111 | TVMET_DECLARE_MACRO(yn, double) |
sv | 1:6799c07fe510 | 112 | TVMET_DECLARE_MACRO(pow, double) |
sv | 1:6799c07fe510 | 113 | |
sv | 1:6799c07fe510 | 114 | #if defined(TVMET_HAVE_LONG_DOUBLE) |
sv | 1:6799c07fe510 | 115 | TVMET_DECLARE_MACRO(atan2, long double) |
sv | 1:6799c07fe510 | 116 | TVMET_DECLARE_MACRO(drem, long double) |
sv | 1:6799c07fe510 | 117 | TVMET_DECLARE_MACRO(fmod, long double) |
sv | 1:6799c07fe510 | 118 | TVMET_DECLARE_MACRO(hypot, long double) |
sv | 1:6799c07fe510 | 119 | TVMET_DECLARE_MACRO(jn, long double) |
sv | 1:6799c07fe510 | 120 | TVMET_DECLARE_MACRO(yn, long double) |
sv | 1:6799c07fe510 | 121 | TVMET_DECLARE_MACRO(pow, long double) |
sv | 1:6799c07fe510 | 122 | #endif // defined(TVMET_HAVE_LONG_DOUBLE) |
sv | 1:6799c07fe510 | 123 | |
sv | 1:6799c07fe510 | 124 | #undef TVMET_DECLARE_MACRO |
sv | 1:6799c07fe510 | 125 | |
sv | 1:6799c07fe510 | 126 | |
sv | 1:6799c07fe510 | 127 | #if defined(TVMET_HAVE_COMPLEX) |
sv | 1:6799c07fe510 | 128 | /* |
sv | 1:6799c07fe510 | 129 | * binary_function(XprMatrix<E, Rows, Cols>, std::complex<>) |
sv | 1:6799c07fe510 | 130 | */ |
sv | 1:6799c07fe510 | 131 | #define TVMET_DECLARE_MACRO(NAME) \ |
sv | 1:6799c07fe510 | 132 | template<class E, std::size_t Rows, std::size_t Cols, class T> \ |
sv | 1:6799c07fe510 | 133 | XprMatrix< \ |
sv | 1:6799c07fe510 | 134 | XprBinOp< \ |
sv | 1:6799c07fe510 | 135 | Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ |
sv | 1:6799c07fe510 | 136 | XprMatrix<E, Rows, Cols>, \ |
sv | 1:6799c07fe510 | 137 | XprLiteral< std::complex<T> > \ |
sv | 1:6799c07fe510 | 138 | >, \ |
sv | 1:6799c07fe510 | 139 | Rows, Cols \ |
sv | 1:6799c07fe510 | 140 | > \ |
sv | 1:6799c07fe510 | 141 | NAME(const XprMatrix<E, Rows, Cols>& lhs, \ |
sv | 1:6799c07fe510 | 142 | const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE; |
sv | 1:6799c07fe510 | 143 | |
sv | 1:6799c07fe510 | 144 | TVMET_DECLARE_MACRO(pow) |
sv | 1:6799c07fe510 | 145 | |
sv | 1:6799c07fe510 | 146 | TVMET_DECLARE_MACRO(atan2) |
sv | 1:6799c07fe510 | 147 | TVMET_DECLARE_MACRO(drem) |
sv | 1:6799c07fe510 | 148 | TVMET_DECLARE_MACRO(fmod) |
sv | 1:6799c07fe510 | 149 | TVMET_DECLARE_MACRO(hypot) |
sv | 1:6799c07fe510 | 150 | TVMET_DECLARE_MACRO(jn) |
sv | 1:6799c07fe510 | 151 | TVMET_DECLARE_MACRO(yn) |
sv | 1:6799c07fe510 | 152 | |
sv | 1:6799c07fe510 | 153 | #undef TVMET_DECLARE_MACRO |
sv | 1:6799c07fe510 | 154 | |
sv | 1:6799c07fe510 | 155 | #endif // defined(TVMET_HAVE_COMPLEX) |
sv | 1:6799c07fe510 | 156 | |
sv | 1:6799c07fe510 | 157 | |
sv | 1:6799c07fe510 | 158 | /********************************************************* |
sv | 1:6799c07fe510 | 159 | * PART II: IMPLEMENTATION |
sv | 1:6799c07fe510 | 160 | *********************************************************/ |
sv | 1:6799c07fe510 | 161 | |
sv | 1:6799c07fe510 | 162 | |
sv | 1:6799c07fe510 | 163 | /* |
sv | 1:6799c07fe510 | 164 | * binary_function(XprMatrix<E1, Rows, Cols>, XprMatrix<E2, Rows, Cols>) |
sv | 1:6799c07fe510 | 165 | */ |
sv | 1:6799c07fe510 | 166 | #define TVMET_IMPLEMENT_MACRO(NAME) \ |
sv | 1:6799c07fe510 | 167 | template<class E1, std::size_t Rows, std::size_t Cols, class E2> \ |
sv | 1:6799c07fe510 | 168 | inline \ |
sv | 1:6799c07fe510 | 169 | XprMatrix< \ |
sv | 1:6799c07fe510 | 170 | XprBinOp< \ |
sv | 1:6799c07fe510 | 171 | Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ |
sv | 1:6799c07fe510 | 172 | XprMatrix<E1, Rows, Cols>, \ |
sv | 1:6799c07fe510 | 173 | XprMatrix<E2, Rows, Cols> \ |
sv | 1:6799c07fe510 | 174 | >, \ |
sv | 1:6799c07fe510 | 175 | Rows, Cols \ |
sv | 1:6799c07fe510 | 176 | > \ |
sv | 1:6799c07fe510 | 177 | NAME(const XprMatrix<E1, Rows, Cols>& lhs, const XprMatrix<E2, Rows, Cols>& rhs) { \ |
sv | 1:6799c07fe510 | 178 | typedef XprBinOp< \ |
sv | 1:6799c07fe510 | 179 | Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ |
sv | 1:6799c07fe510 | 180 | XprMatrix<E1, Rows, Cols>, \ |
sv | 1:6799c07fe510 | 181 | XprMatrix<E2, Rows, Cols> \ |
sv | 1:6799c07fe510 | 182 | > expr_type; \ |
sv | 1:6799c07fe510 | 183 | return XprMatrix<expr_type, Rows, Cols>( \ |
sv | 1:6799c07fe510 | 184 | expr_type(lhs, rhs)); \ |
sv | 1:6799c07fe510 | 185 | } |
sv | 1:6799c07fe510 | 186 | |
sv | 1:6799c07fe510 | 187 | TVMET_IMPLEMENT_MACRO(atan2) |
sv | 1:6799c07fe510 | 188 | TVMET_IMPLEMENT_MACRO(drem) |
sv | 1:6799c07fe510 | 189 | TVMET_IMPLEMENT_MACRO(fmod) |
sv | 1:6799c07fe510 | 190 | TVMET_IMPLEMENT_MACRO(hypot) |
sv | 1:6799c07fe510 | 191 | TVMET_IMPLEMENT_MACRO(jn) |
sv | 1:6799c07fe510 | 192 | TVMET_IMPLEMENT_MACRO(yn) |
sv | 1:6799c07fe510 | 193 | TVMET_IMPLEMENT_MACRO(pow) |
sv | 1:6799c07fe510 | 194 | #if defined(TVMET_HAVE_COMPLEX) |
sv | 1:6799c07fe510 | 195 | //TVMET_IMPLEMENT_MACRO(polar) |
sv | 1:6799c07fe510 | 196 | #endif |
sv | 1:6799c07fe510 | 197 | |
sv | 1:6799c07fe510 | 198 | #undef TVMET_IMPLEMENT_MACRO |
sv | 1:6799c07fe510 | 199 | |
sv | 1:6799c07fe510 | 200 | |
sv | 1:6799c07fe510 | 201 | /* |
sv | 1:6799c07fe510 | 202 | * binary_function(XprMatrix<E, Rows, Cols>, POD) |
sv | 1:6799c07fe510 | 203 | */ |
sv | 1:6799c07fe510 | 204 | #define TVMET_IMPLEMENT_MACRO(NAME, TP) \ |
sv | 1:6799c07fe510 | 205 | template<class E, std::size_t Rows, std::size_t Cols> \ |
sv | 1:6799c07fe510 | 206 | inline \ |
sv | 1:6799c07fe510 | 207 | XprMatrix< \ |
sv | 1:6799c07fe510 | 208 | XprBinOp< \ |
sv | 1:6799c07fe510 | 209 | Fcnl_##NAME<typename E::value_type, TP >, \ |
sv | 1:6799c07fe510 | 210 | XprMatrix<E, Rows, Cols>, \ |
sv | 1:6799c07fe510 | 211 | XprLiteral< TP > \ |
sv | 1:6799c07fe510 | 212 | >, \ |
sv | 1:6799c07fe510 | 213 | Rows, Cols \ |
sv | 1:6799c07fe510 | 214 | > \ |
sv | 1:6799c07fe510 | 215 | NAME(const XprMatrix<E, Rows, Cols>& lhs, TP rhs) { \ |
sv | 1:6799c07fe510 | 216 | typedef XprBinOp< \ |
sv | 1:6799c07fe510 | 217 | Fcnl_##NAME<typename E::value_type, TP >, \ |
sv | 1:6799c07fe510 | 218 | XprMatrix<E, Rows, Cols>, \ |
sv | 1:6799c07fe510 | 219 | XprLiteral< TP > \ |
sv | 1:6799c07fe510 | 220 | > expr_type; \ |
sv | 1:6799c07fe510 | 221 | return XprMatrix<expr_type, Rows, Cols>( \ |
sv | 1:6799c07fe510 | 222 | expr_type(lhs, XprLiteral< TP >(rhs))); \ |
sv | 1:6799c07fe510 | 223 | } |
sv | 1:6799c07fe510 | 224 | |
sv | 1:6799c07fe510 | 225 | TVMET_IMPLEMENT_MACRO(atan2, int) |
sv | 1:6799c07fe510 | 226 | TVMET_IMPLEMENT_MACRO(drem, int) |
sv | 1:6799c07fe510 | 227 | TVMET_IMPLEMENT_MACRO(fmod, int) |
sv | 1:6799c07fe510 | 228 | TVMET_IMPLEMENT_MACRO(hypot, int) |
sv | 1:6799c07fe510 | 229 | TVMET_IMPLEMENT_MACRO(jn, int) |
sv | 1:6799c07fe510 | 230 | TVMET_IMPLEMENT_MACRO(yn, int) |
sv | 1:6799c07fe510 | 231 | TVMET_IMPLEMENT_MACRO(pow, int) |
sv | 1:6799c07fe510 | 232 | |
sv | 1:6799c07fe510 | 233 | #if defined(TVMET_HAVE_LONG_LONG) |
sv | 1:6799c07fe510 | 234 | TVMET_IMPLEMENT_MACRO(atan2, long long int) |
sv | 1:6799c07fe510 | 235 | TVMET_IMPLEMENT_MACRO(drem, long long int) |
sv | 1:6799c07fe510 | 236 | TVMET_IMPLEMENT_MACRO(fmod, long long int) |
sv | 1:6799c07fe510 | 237 | TVMET_IMPLEMENT_MACRO(hypot, long long int) |
sv | 1:6799c07fe510 | 238 | TVMET_IMPLEMENT_MACRO(jn, long long int) |
sv | 1:6799c07fe510 | 239 | TVMET_IMPLEMENT_MACRO(yn,long long int) |
sv | 1:6799c07fe510 | 240 | TVMET_IMPLEMENT_MACRO(pow, long long int) |
sv | 1:6799c07fe510 | 241 | #endif // defined(TVMET_HAVE_LONG_LONG) |
sv | 1:6799c07fe510 | 242 | |
sv | 1:6799c07fe510 | 243 | TVMET_IMPLEMENT_MACRO(atan2, float) |
sv | 1:6799c07fe510 | 244 | TVMET_IMPLEMENT_MACRO(drem, float) |
sv | 1:6799c07fe510 | 245 | TVMET_IMPLEMENT_MACRO(fmod, float) |
sv | 1:6799c07fe510 | 246 | TVMET_IMPLEMENT_MACRO(hypot, float) |
sv | 1:6799c07fe510 | 247 | TVMET_IMPLEMENT_MACRO(jn, float) |
sv | 1:6799c07fe510 | 248 | TVMET_IMPLEMENT_MACRO(yn, float) |
sv | 1:6799c07fe510 | 249 | TVMET_IMPLEMENT_MACRO(pow, float) |
sv | 1:6799c07fe510 | 250 | |
sv | 1:6799c07fe510 | 251 | TVMET_IMPLEMENT_MACRO(atan2, double) |
sv | 1:6799c07fe510 | 252 | TVMET_IMPLEMENT_MACRO(drem, double) |
sv | 1:6799c07fe510 | 253 | TVMET_IMPLEMENT_MACRO(fmod, double) |
sv | 1:6799c07fe510 | 254 | TVMET_IMPLEMENT_MACRO(hypot,double) |
sv | 1:6799c07fe510 | 255 | TVMET_IMPLEMENT_MACRO(jn, double) |
sv | 1:6799c07fe510 | 256 | TVMET_IMPLEMENT_MACRO(yn, double) |
sv | 1:6799c07fe510 | 257 | TVMET_IMPLEMENT_MACRO(pow, double) |
sv | 1:6799c07fe510 | 258 | |
sv | 1:6799c07fe510 | 259 | #if defined(TVMET_HAVE_LONG_DOUBLE) |
sv | 1:6799c07fe510 | 260 | TVMET_IMPLEMENT_MACRO(atan2, long double) |
sv | 1:6799c07fe510 | 261 | TVMET_IMPLEMENT_MACRO(drem, long double) |
sv | 1:6799c07fe510 | 262 | TVMET_IMPLEMENT_MACRO(fmod, long double) |
sv | 1:6799c07fe510 | 263 | TVMET_IMPLEMENT_MACRO(hypot, long double) |
sv | 1:6799c07fe510 | 264 | TVMET_IMPLEMENT_MACRO(jn, long double) |
sv | 1:6799c07fe510 | 265 | TVMET_IMPLEMENT_MACRO(yn, long double) |
sv | 1:6799c07fe510 | 266 | TVMET_IMPLEMENT_MACRO(pow, long double) |
sv | 1:6799c07fe510 | 267 | #endif // defined(TVMET_HAVE_LONG_DOUBLE) |
sv | 1:6799c07fe510 | 268 | |
sv | 1:6799c07fe510 | 269 | #undef TVMET_IMPLEMENT_MACRO |
sv | 1:6799c07fe510 | 270 | |
sv | 1:6799c07fe510 | 271 | |
sv | 1:6799c07fe510 | 272 | #if defined(TVMET_HAVE_COMPLEX) |
sv | 1:6799c07fe510 | 273 | /* |
sv | 1:6799c07fe510 | 274 | * binary_function(XprMatrix<E, Rows, Cols>, std::complex<>) |
sv | 1:6799c07fe510 | 275 | */ |
sv | 1:6799c07fe510 | 276 | #define TVMET_IMPLEMENT_MACRO(NAME) \ |
sv | 1:6799c07fe510 | 277 | template<class E, std::size_t Rows, std::size_t Cols, class T> \ |
sv | 1:6799c07fe510 | 278 | inline \ |
sv | 1:6799c07fe510 | 279 | XprMatrix< \ |
sv | 1:6799c07fe510 | 280 | XprBinOp< \ |
sv | 1:6799c07fe510 | 281 | Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ |
sv | 1:6799c07fe510 | 282 | XprMatrix<E, Rows, Cols>, \ |
sv | 1:6799c07fe510 | 283 | XprLiteral< std::complex<T> > \ |
sv | 1:6799c07fe510 | 284 | >, \ |
sv | 1:6799c07fe510 | 285 | Rows, Cols \ |
sv | 1:6799c07fe510 | 286 | > \ |
sv | 1:6799c07fe510 | 287 | NAME(const XprMatrix<E, Rows, Cols>& lhs, const std::complex<T>& rhs) { \ |
sv | 1:6799c07fe510 | 288 | typedef XprBinOp< \ |
sv | 1:6799c07fe510 | 289 | Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ |
sv | 1:6799c07fe510 | 290 | XprMatrix<E, Rows, Cols>, \ |
sv | 1:6799c07fe510 | 291 | XprLiteral< std::complex<T> > \ |
sv | 1:6799c07fe510 | 292 | > expr_type; \ |
sv | 1:6799c07fe510 | 293 | return XprMatrix<expr_type, Rows, Cols>( \ |
sv | 1:6799c07fe510 | 294 | expr_type(lhs, XprLiteral< std::complex<T> >(rhs))); \ |
sv | 1:6799c07fe510 | 295 | } |
sv | 1:6799c07fe510 | 296 | |
sv | 1:6799c07fe510 | 297 | TVMET_IMPLEMENT_MACRO(pow) |
sv | 1:6799c07fe510 | 298 | |
sv | 1:6799c07fe510 | 299 | TVMET_IMPLEMENT_MACRO(atan2) |
sv | 1:6799c07fe510 | 300 | TVMET_IMPLEMENT_MACRO(drem) |
sv | 1:6799c07fe510 | 301 | TVMET_IMPLEMENT_MACRO(fmod) |
sv | 1:6799c07fe510 | 302 | TVMET_IMPLEMENT_MACRO(hypot) |
sv | 1:6799c07fe510 | 303 | TVMET_IMPLEMENT_MACRO(jn) |
sv | 1:6799c07fe510 | 304 | TVMET_IMPLEMENT_MACRO(yn) |
sv | 1:6799c07fe510 | 305 | |
sv | 1:6799c07fe510 | 306 | #undef TVMET_IMPLEMENT_MACRO |
sv | 1:6799c07fe510 | 307 | |
sv | 1:6799c07fe510 | 308 | #endif // defined(TVMET_HAVE_COMPLEX) |
sv | 1:6799c07fe510 | 309 | |
sv | 1:6799c07fe510 | 310 | |
sv | 1:6799c07fe510 | 311 | } // namespace tvmet |
sv | 1:6799c07fe510 | 312 | |
sv | 1:6799c07fe510 | 313 | #endif // TVMET_XPR_MATRIX_BINARY_FUNCTIONS_H |
sv | 1:6799c07fe510 | 314 | |
sv | 1:6799c07fe510 | 315 | // Local Variables: |
sv | 1:6799c07fe510 | 316 | // mode:C++ |
sv | 1:6799c07fe510 | 317 | // tab-width:8 |
sv | 1:6799c07fe510 | 318 | // End: |