2014 Eurobot fork
Dependencies: mbed-rtos mbed QEI
tvmet/xpr/MatrixBinaryFunctions.h@92:4a1225fbb146, 2013-10-15 (annotated)
- Committer:
- rsavitski
- Date:
- Tue Oct 15 12:19:32 2013 +0000
- Revision:
- 92:4a1225fbb146
- Parent:
- 15:9c5aaeda36dc
touch: ripped out 2013-specific bits. Need to address "2014" comments. Rewrite AI layer and other deleted parts.
Who changed what in which revision?
User | Revision | Line number | New 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: MatrixBinaryFunctions.h,v 1.12 2007-06-23 15:59:00 opetzold Exp $ |
madcowswe | 15:9c5aaeda36dc | 22 | */ |
madcowswe | 15:9c5aaeda36dc | 23 | |
madcowswe | 15:9c5aaeda36dc | 24 | #ifndef TVMET_XPR_MATRIX_BINARY_FUNCTIONS_H |
madcowswe | 15:9c5aaeda36dc | 25 | #define TVMET_XPR_MATRIX_BINARY_FUNCTIONS_H |
madcowswe | 15:9c5aaeda36dc | 26 | |
madcowswe | 15:9c5aaeda36dc | 27 | namespace tvmet { |
madcowswe | 15:9c5aaeda36dc | 28 | |
madcowswe | 15:9c5aaeda36dc | 29 | |
madcowswe | 15:9c5aaeda36dc | 30 | /********************************************************* |
madcowswe | 15:9c5aaeda36dc | 31 | * PART I: DECLARATION |
madcowswe | 15:9c5aaeda36dc | 32 | *********************************************************/ |
madcowswe | 15:9c5aaeda36dc | 33 | |
madcowswe | 15:9c5aaeda36dc | 34 | /* |
madcowswe | 15:9c5aaeda36dc | 35 | * binary_function(XprMatrix<E1, Rows, Cols>, XprMatrix<E2, Rows, Cols>) |
madcowswe | 15:9c5aaeda36dc | 36 | */ |
madcowswe | 15:9c5aaeda36dc | 37 | #define TVMET_DECLARE_MACRO(NAME) \ |
madcowswe | 15:9c5aaeda36dc | 38 | template<class E1, std::size_t Rows, std::size_t Cols, class E2> \ |
madcowswe | 15:9c5aaeda36dc | 39 | XprMatrix< \ |
madcowswe | 15:9c5aaeda36dc | 40 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 41 | Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ |
madcowswe | 15:9c5aaeda36dc | 42 | XprMatrix<E1, Rows, Cols>, \ |
madcowswe | 15:9c5aaeda36dc | 43 | XprMatrix<E2, Rows, Cols> \ |
madcowswe | 15:9c5aaeda36dc | 44 | >, \ |
madcowswe | 15:9c5aaeda36dc | 45 | Rows, Cols \ |
madcowswe | 15:9c5aaeda36dc | 46 | > \ |
madcowswe | 15:9c5aaeda36dc | 47 | NAME(const XprMatrix<E1, Rows, Cols>& lhs, \ |
madcowswe | 15:9c5aaeda36dc | 48 | const XprMatrix<E2, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE; |
madcowswe | 15:9c5aaeda36dc | 49 | |
madcowswe | 15:9c5aaeda36dc | 50 | TVMET_DECLARE_MACRO(atan2) |
madcowswe | 15:9c5aaeda36dc | 51 | TVMET_DECLARE_MACRO(drem) |
madcowswe | 15:9c5aaeda36dc | 52 | TVMET_DECLARE_MACRO(fmod) |
madcowswe | 15:9c5aaeda36dc | 53 | TVMET_DECLARE_MACRO(hypot) |
madcowswe | 15:9c5aaeda36dc | 54 | TVMET_DECLARE_MACRO(jn) |
madcowswe | 15:9c5aaeda36dc | 55 | TVMET_DECLARE_MACRO(yn) |
madcowswe | 15:9c5aaeda36dc | 56 | TVMET_DECLARE_MACRO(pow) |
madcowswe | 15:9c5aaeda36dc | 57 | #if defined(TVMET_HAVE_COMPLEX) |
madcowswe | 15:9c5aaeda36dc | 58 | //TVMET_DECLARE_MACRO(polar) |
madcowswe | 15:9c5aaeda36dc | 59 | #endif |
madcowswe | 15:9c5aaeda36dc | 60 | |
madcowswe | 15:9c5aaeda36dc | 61 | #undef TVMET_DECLARE_MACRO |
madcowswe | 15:9c5aaeda36dc | 62 | |
madcowswe | 15:9c5aaeda36dc | 63 | |
madcowswe | 15:9c5aaeda36dc | 64 | /* |
madcowswe | 15:9c5aaeda36dc | 65 | * binary_function(XprMatrix<E, Rows, Cols>, POD) |
madcowswe | 15:9c5aaeda36dc | 66 | */ |
madcowswe | 15:9c5aaeda36dc | 67 | #define TVMET_DECLARE_MACRO(NAME, TP) \ |
madcowswe | 15:9c5aaeda36dc | 68 | template<class E, std::size_t Rows, std::size_t Cols> \ |
madcowswe | 15:9c5aaeda36dc | 69 | XprMatrix< \ |
madcowswe | 15:9c5aaeda36dc | 70 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 71 | Fcnl_##NAME<typename E::value_type, TP >, \ |
madcowswe | 15:9c5aaeda36dc | 72 | XprMatrix<E, Rows, Cols>, \ |
madcowswe | 15:9c5aaeda36dc | 73 | XprLiteral< TP > \ |
madcowswe | 15:9c5aaeda36dc | 74 | >, \ |
madcowswe | 15:9c5aaeda36dc | 75 | Rows, Cols \ |
madcowswe | 15:9c5aaeda36dc | 76 | > \ |
madcowswe | 15:9c5aaeda36dc | 77 | NAME(const XprMatrix<E, Rows, Cols>& lhs, \ |
madcowswe | 15:9c5aaeda36dc | 78 | TP rhs) TVMET_CXX_ALWAYS_INLINE; |
madcowswe | 15:9c5aaeda36dc | 79 | |
madcowswe | 15:9c5aaeda36dc | 80 | TVMET_DECLARE_MACRO(atan2, int) |
madcowswe | 15:9c5aaeda36dc | 81 | TVMET_DECLARE_MACRO(drem, int) |
madcowswe | 15:9c5aaeda36dc | 82 | TVMET_DECLARE_MACRO(fmod, int) |
madcowswe | 15:9c5aaeda36dc | 83 | TVMET_DECLARE_MACRO(hypot, int) |
madcowswe | 15:9c5aaeda36dc | 84 | TVMET_DECLARE_MACRO(jn, int) |
madcowswe | 15:9c5aaeda36dc | 85 | TVMET_DECLARE_MACRO(yn, int) |
madcowswe | 15:9c5aaeda36dc | 86 | TVMET_DECLARE_MACRO(pow, int) |
madcowswe | 15:9c5aaeda36dc | 87 | |
madcowswe | 15:9c5aaeda36dc | 88 | #if defined(TVMET_HAVE_LONG_LONG) |
madcowswe | 15:9c5aaeda36dc | 89 | TVMET_DECLARE_MACRO(atan2, long long int) |
madcowswe | 15:9c5aaeda36dc | 90 | TVMET_DECLARE_MACRO(drem, long long int) |
madcowswe | 15:9c5aaeda36dc | 91 | TVMET_DECLARE_MACRO(fmod, long long int) |
madcowswe | 15:9c5aaeda36dc | 92 | TVMET_DECLARE_MACRO(hypot, long long int) |
madcowswe | 15:9c5aaeda36dc | 93 | TVMET_DECLARE_MACRO(jn, long long int) |
madcowswe | 15:9c5aaeda36dc | 94 | TVMET_DECLARE_MACRO(yn,long long int) |
madcowswe | 15:9c5aaeda36dc | 95 | TVMET_DECLARE_MACRO(pow, long long int) |
madcowswe | 15:9c5aaeda36dc | 96 | #endif // defined(TVMET_HAVE_LONG_LONG) |
madcowswe | 15:9c5aaeda36dc | 97 | |
madcowswe | 15:9c5aaeda36dc | 98 | TVMET_DECLARE_MACRO(atan2, float) |
madcowswe | 15:9c5aaeda36dc | 99 | TVMET_DECLARE_MACRO(drem, float) |
madcowswe | 15:9c5aaeda36dc | 100 | TVMET_DECLARE_MACRO(fmod, float) |
madcowswe | 15:9c5aaeda36dc | 101 | TVMET_DECLARE_MACRO(hypot, float) |
madcowswe | 15:9c5aaeda36dc | 102 | TVMET_DECLARE_MACRO(jn, float) |
madcowswe | 15:9c5aaeda36dc | 103 | TVMET_DECLARE_MACRO(yn, float) |
madcowswe | 15:9c5aaeda36dc | 104 | TVMET_DECLARE_MACRO(pow, float) |
madcowswe | 15:9c5aaeda36dc | 105 | |
madcowswe | 15:9c5aaeda36dc | 106 | TVMET_DECLARE_MACRO(atan2, double) |
madcowswe | 15:9c5aaeda36dc | 107 | TVMET_DECLARE_MACRO(drem, double) |
madcowswe | 15:9c5aaeda36dc | 108 | TVMET_DECLARE_MACRO(fmod, double) |
madcowswe | 15:9c5aaeda36dc | 109 | TVMET_DECLARE_MACRO(hypot,double) |
madcowswe | 15:9c5aaeda36dc | 110 | TVMET_DECLARE_MACRO(jn, double) |
madcowswe | 15:9c5aaeda36dc | 111 | TVMET_DECLARE_MACRO(yn, double) |
madcowswe | 15:9c5aaeda36dc | 112 | TVMET_DECLARE_MACRO(pow, double) |
madcowswe | 15:9c5aaeda36dc | 113 | |
madcowswe | 15:9c5aaeda36dc | 114 | #if defined(TVMET_HAVE_LONG_DOUBLE) |
madcowswe | 15:9c5aaeda36dc | 115 | TVMET_DECLARE_MACRO(atan2, long double) |
madcowswe | 15:9c5aaeda36dc | 116 | TVMET_DECLARE_MACRO(drem, long double) |
madcowswe | 15:9c5aaeda36dc | 117 | TVMET_DECLARE_MACRO(fmod, long double) |
madcowswe | 15:9c5aaeda36dc | 118 | TVMET_DECLARE_MACRO(hypot, long double) |
madcowswe | 15:9c5aaeda36dc | 119 | TVMET_DECLARE_MACRO(jn, long double) |
madcowswe | 15:9c5aaeda36dc | 120 | TVMET_DECLARE_MACRO(yn, long double) |
madcowswe | 15:9c5aaeda36dc | 121 | TVMET_DECLARE_MACRO(pow, long double) |
madcowswe | 15:9c5aaeda36dc | 122 | #endif // defined(TVMET_HAVE_LONG_DOUBLE) |
madcowswe | 15:9c5aaeda36dc | 123 | |
madcowswe | 15:9c5aaeda36dc | 124 | #undef TVMET_DECLARE_MACRO |
madcowswe | 15:9c5aaeda36dc | 125 | |
madcowswe | 15:9c5aaeda36dc | 126 | |
madcowswe | 15:9c5aaeda36dc | 127 | #if defined(TVMET_HAVE_COMPLEX) |
madcowswe | 15:9c5aaeda36dc | 128 | /* |
madcowswe | 15:9c5aaeda36dc | 129 | * binary_function(XprMatrix<E, Rows, Cols>, std::complex<>) |
madcowswe | 15:9c5aaeda36dc | 130 | */ |
madcowswe | 15:9c5aaeda36dc | 131 | #define TVMET_DECLARE_MACRO(NAME) \ |
madcowswe | 15:9c5aaeda36dc | 132 | template<class E, std::size_t Rows, std::size_t Cols, class T> \ |
madcowswe | 15:9c5aaeda36dc | 133 | XprMatrix< \ |
madcowswe | 15:9c5aaeda36dc | 134 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 135 | Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ |
madcowswe | 15:9c5aaeda36dc | 136 | XprMatrix<E, Rows, Cols>, \ |
madcowswe | 15:9c5aaeda36dc | 137 | XprLiteral< std::complex<T> > \ |
madcowswe | 15:9c5aaeda36dc | 138 | >, \ |
madcowswe | 15:9c5aaeda36dc | 139 | Rows, Cols \ |
madcowswe | 15:9c5aaeda36dc | 140 | > \ |
madcowswe | 15:9c5aaeda36dc | 141 | NAME(const XprMatrix<E, Rows, Cols>& lhs, \ |
madcowswe | 15:9c5aaeda36dc | 142 | const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE; |
madcowswe | 15:9c5aaeda36dc | 143 | |
madcowswe | 15:9c5aaeda36dc | 144 | TVMET_DECLARE_MACRO(pow) |
madcowswe | 15:9c5aaeda36dc | 145 | |
madcowswe | 15:9c5aaeda36dc | 146 | TVMET_DECLARE_MACRO(atan2) |
madcowswe | 15:9c5aaeda36dc | 147 | TVMET_DECLARE_MACRO(drem) |
madcowswe | 15:9c5aaeda36dc | 148 | TVMET_DECLARE_MACRO(fmod) |
madcowswe | 15:9c5aaeda36dc | 149 | TVMET_DECLARE_MACRO(hypot) |
madcowswe | 15:9c5aaeda36dc | 150 | TVMET_DECLARE_MACRO(jn) |
madcowswe | 15:9c5aaeda36dc | 151 | TVMET_DECLARE_MACRO(yn) |
madcowswe | 15:9c5aaeda36dc | 152 | |
madcowswe | 15:9c5aaeda36dc | 153 | #undef TVMET_DECLARE_MACRO |
madcowswe | 15:9c5aaeda36dc | 154 | |
madcowswe | 15:9c5aaeda36dc | 155 | #endif // defined(TVMET_HAVE_COMPLEX) |
madcowswe | 15:9c5aaeda36dc | 156 | |
madcowswe | 15:9c5aaeda36dc | 157 | |
madcowswe | 15:9c5aaeda36dc | 158 | /********************************************************* |
madcowswe | 15:9c5aaeda36dc | 159 | * PART II: IMPLEMENTATION |
madcowswe | 15:9c5aaeda36dc | 160 | *********************************************************/ |
madcowswe | 15:9c5aaeda36dc | 161 | |
madcowswe | 15:9c5aaeda36dc | 162 | |
madcowswe | 15:9c5aaeda36dc | 163 | /* |
madcowswe | 15:9c5aaeda36dc | 164 | * binary_function(XprMatrix<E1, Rows, Cols>, XprMatrix<E2, Rows, Cols>) |
madcowswe | 15:9c5aaeda36dc | 165 | */ |
madcowswe | 15:9c5aaeda36dc | 166 | #define TVMET_IMPLEMENT_MACRO(NAME) \ |
madcowswe | 15:9c5aaeda36dc | 167 | template<class E1, std::size_t Rows, std::size_t Cols, class E2> \ |
madcowswe | 15:9c5aaeda36dc | 168 | inline \ |
madcowswe | 15:9c5aaeda36dc | 169 | XprMatrix< \ |
madcowswe | 15:9c5aaeda36dc | 170 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 171 | Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ |
madcowswe | 15:9c5aaeda36dc | 172 | XprMatrix<E1, Rows, Cols>, \ |
madcowswe | 15:9c5aaeda36dc | 173 | XprMatrix<E2, Rows, Cols> \ |
madcowswe | 15:9c5aaeda36dc | 174 | >, \ |
madcowswe | 15:9c5aaeda36dc | 175 | Rows, Cols \ |
madcowswe | 15:9c5aaeda36dc | 176 | > \ |
madcowswe | 15:9c5aaeda36dc | 177 | NAME(const XprMatrix<E1, Rows, Cols>& lhs, const XprMatrix<E2, Rows, Cols>& rhs) { \ |
madcowswe | 15:9c5aaeda36dc | 178 | typedef XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 179 | Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ |
madcowswe | 15:9c5aaeda36dc | 180 | XprMatrix<E1, Rows, Cols>, \ |
madcowswe | 15:9c5aaeda36dc | 181 | XprMatrix<E2, Rows, Cols> \ |
madcowswe | 15:9c5aaeda36dc | 182 | > expr_type; \ |
madcowswe | 15:9c5aaeda36dc | 183 | return XprMatrix<expr_type, Rows, Cols>( \ |
madcowswe | 15:9c5aaeda36dc | 184 | expr_type(lhs, rhs)); \ |
madcowswe | 15:9c5aaeda36dc | 185 | } |
madcowswe | 15:9c5aaeda36dc | 186 | |
madcowswe | 15:9c5aaeda36dc | 187 | TVMET_IMPLEMENT_MACRO(atan2) |
madcowswe | 15:9c5aaeda36dc | 188 | TVMET_IMPLEMENT_MACRO(drem) |
madcowswe | 15:9c5aaeda36dc | 189 | TVMET_IMPLEMENT_MACRO(fmod) |
madcowswe | 15:9c5aaeda36dc | 190 | TVMET_IMPLEMENT_MACRO(hypot) |
madcowswe | 15:9c5aaeda36dc | 191 | TVMET_IMPLEMENT_MACRO(jn) |
madcowswe | 15:9c5aaeda36dc | 192 | TVMET_IMPLEMENT_MACRO(yn) |
madcowswe | 15:9c5aaeda36dc | 193 | TVMET_IMPLEMENT_MACRO(pow) |
madcowswe | 15:9c5aaeda36dc | 194 | #if defined(TVMET_HAVE_COMPLEX) |
madcowswe | 15:9c5aaeda36dc | 195 | //TVMET_IMPLEMENT_MACRO(polar) |
madcowswe | 15:9c5aaeda36dc | 196 | #endif |
madcowswe | 15:9c5aaeda36dc | 197 | |
madcowswe | 15:9c5aaeda36dc | 198 | #undef TVMET_IMPLEMENT_MACRO |
madcowswe | 15:9c5aaeda36dc | 199 | |
madcowswe | 15:9c5aaeda36dc | 200 | |
madcowswe | 15:9c5aaeda36dc | 201 | /* |
madcowswe | 15:9c5aaeda36dc | 202 | * binary_function(XprMatrix<E, Rows, Cols>, POD) |
madcowswe | 15:9c5aaeda36dc | 203 | */ |
madcowswe | 15:9c5aaeda36dc | 204 | #define TVMET_IMPLEMENT_MACRO(NAME, TP) \ |
madcowswe | 15:9c5aaeda36dc | 205 | template<class E, std::size_t Rows, std::size_t Cols> \ |
madcowswe | 15:9c5aaeda36dc | 206 | inline \ |
madcowswe | 15:9c5aaeda36dc | 207 | XprMatrix< \ |
madcowswe | 15:9c5aaeda36dc | 208 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 209 | Fcnl_##NAME<typename E::value_type, TP >, \ |
madcowswe | 15:9c5aaeda36dc | 210 | XprMatrix<E, Rows, Cols>, \ |
madcowswe | 15:9c5aaeda36dc | 211 | XprLiteral< TP > \ |
madcowswe | 15:9c5aaeda36dc | 212 | >, \ |
madcowswe | 15:9c5aaeda36dc | 213 | Rows, Cols \ |
madcowswe | 15:9c5aaeda36dc | 214 | > \ |
madcowswe | 15:9c5aaeda36dc | 215 | NAME(const XprMatrix<E, Rows, Cols>& lhs, TP rhs) { \ |
madcowswe | 15:9c5aaeda36dc | 216 | typedef XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 217 | Fcnl_##NAME<typename E::value_type, TP >, \ |
madcowswe | 15:9c5aaeda36dc | 218 | XprMatrix<E, Rows, Cols>, \ |
madcowswe | 15:9c5aaeda36dc | 219 | XprLiteral< TP > \ |
madcowswe | 15:9c5aaeda36dc | 220 | > expr_type; \ |
madcowswe | 15:9c5aaeda36dc | 221 | return XprMatrix<expr_type, Rows, Cols>( \ |
madcowswe | 15:9c5aaeda36dc | 222 | expr_type(lhs, XprLiteral< TP >(rhs))); \ |
madcowswe | 15:9c5aaeda36dc | 223 | } |
madcowswe | 15:9c5aaeda36dc | 224 | |
madcowswe | 15:9c5aaeda36dc | 225 | TVMET_IMPLEMENT_MACRO(atan2, int) |
madcowswe | 15:9c5aaeda36dc | 226 | TVMET_IMPLEMENT_MACRO(drem, int) |
madcowswe | 15:9c5aaeda36dc | 227 | TVMET_IMPLEMENT_MACRO(fmod, int) |
madcowswe | 15:9c5aaeda36dc | 228 | TVMET_IMPLEMENT_MACRO(hypot, int) |
madcowswe | 15:9c5aaeda36dc | 229 | TVMET_IMPLEMENT_MACRO(jn, int) |
madcowswe | 15:9c5aaeda36dc | 230 | TVMET_IMPLEMENT_MACRO(yn, int) |
madcowswe | 15:9c5aaeda36dc | 231 | TVMET_IMPLEMENT_MACRO(pow, int) |
madcowswe | 15:9c5aaeda36dc | 232 | |
madcowswe | 15:9c5aaeda36dc | 233 | #if defined(TVMET_HAVE_LONG_LONG) |
madcowswe | 15:9c5aaeda36dc | 234 | TVMET_IMPLEMENT_MACRO(atan2, long long int) |
madcowswe | 15:9c5aaeda36dc | 235 | TVMET_IMPLEMENT_MACRO(drem, long long int) |
madcowswe | 15:9c5aaeda36dc | 236 | TVMET_IMPLEMENT_MACRO(fmod, long long int) |
madcowswe | 15:9c5aaeda36dc | 237 | TVMET_IMPLEMENT_MACRO(hypot, long long int) |
madcowswe | 15:9c5aaeda36dc | 238 | TVMET_IMPLEMENT_MACRO(jn, long long int) |
madcowswe | 15:9c5aaeda36dc | 239 | TVMET_IMPLEMENT_MACRO(yn,long long int) |
madcowswe | 15:9c5aaeda36dc | 240 | TVMET_IMPLEMENT_MACRO(pow, long long int) |
madcowswe | 15:9c5aaeda36dc | 241 | #endif // defined(TVMET_HAVE_LONG_LONG) |
madcowswe | 15:9c5aaeda36dc | 242 | |
madcowswe | 15:9c5aaeda36dc | 243 | TVMET_IMPLEMENT_MACRO(atan2, float) |
madcowswe | 15:9c5aaeda36dc | 244 | TVMET_IMPLEMENT_MACRO(drem, float) |
madcowswe | 15:9c5aaeda36dc | 245 | TVMET_IMPLEMENT_MACRO(fmod, float) |
madcowswe | 15:9c5aaeda36dc | 246 | TVMET_IMPLEMENT_MACRO(hypot, float) |
madcowswe | 15:9c5aaeda36dc | 247 | TVMET_IMPLEMENT_MACRO(jn, float) |
madcowswe | 15:9c5aaeda36dc | 248 | TVMET_IMPLEMENT_MACRO(yn, float) |
madcowswe | 15:9c5aaeda36dc | 249 | TVMET_IMPLEMENT_MACRO(pow, float) |
madcowswe | 15:9c5aaeda36dc | 250 | |
madcowswe | 15:9c5aaeda36dc | 251 | TVMET_IMPLEMENT_MACRO(atan2, double) |
madcowswe | 15:9c5aaeda36dc | 252 | TVMET_IMPLEMENT_MACRO(drem, double) |
madcowswe | 15:9c5aaeda36dc | 253 | TVMET_IMPLEMENT_MACRO(fmod, double) |
madcowswe | 15:9c5aaeda36dc | 254 | TVMET_IMPLEMENT_MACRO(hypot,double) |
madcowswe | 15:9c5aaeda36dc | 255 | TVMET_IMPLEMENT_MACRO(jn, double) |
madcowswe | 15:9c5aaeda36dc | 256 | TVMET_IMPLEMENT_MACRO(yn, double) |
madcowswe | 15:9c5aaeda36dc | 257 | TVMET_IMPLEMENT_MACRO(pow, double) |
madcowswe | 15:9c5aaeda36dc | 258 | |
madcowswe | 15:9c5aaeda36dc | 259 | #if defined(TVMET_HAVE_LONG_DOUBLE) |
madcowswe | 15:9c5aaeda36dc | 260 | TVMET_IMPLEMENT_MACRO(atan2, long double) |
madcowswe | 15:9c5aaeda36dc | 261 | TVMET_IMPLEMENT_MACRO(drem, long double) |
madcowswe | 15:9c5aaeda36dc | 262 | TVMET_IMPLEMENT_MACRO(fmod, long double) |
madcowswe | 15:9c5aaeda36dc | 263 | TVMET_IMPLEMENT_MACRO(hypot, long double) |
madcowswe | 15:9c5aaeda36dc | 264 | TVMET_IMPLEMENT_MACRO(jn, long double) |
madcowswe | 15:9c5aaeda36dc | 265 | TVMET_IMPLEMENT_MACRO(yn, long double) |
madcowswe | 15:9c5aaeda36dc | 266 | TVMET_IMPLEMENT_MACRO(pow, long double) |
madcowswe | 15:9c5aaeda36dc | 267 | #endif // defined(TVMET_HAVE_LONG_DOUBLE) |
madcowswe | 15:9c5aaeda36dc | 268 | |
madcowswe | 15:9c5aaeda36dc | 269 | #undef TVMET_IMPLEMENT_MACRO |
madcowswe | 15:9c5aaeda36dc | 270 | |
madcowswe | 15:9c5aaeda36dc | 271 | |
madcowswe | 15:9c5aaeda36dc | 272 | #if defined(TVMET_HAVE_COMPLEX) |
madcowswe | 15:9c5aaeda36dc | 273 | /* |
madcowswe | 15:9c5aaeda36dc | 274 | * binary_function(XprMatrix<E, Rows, Cols>, std::complex<>) |
madcowswe | 15:9c5aaeda36dc | 275 | */ |
madcowswe | 15:9c5aaeda36dc | 276 | #define TVMET_IMPLEMENT_MACRO(NAME) \ |
madcowswe | 15:9c5aaeda36dc | 277 | template<class E, std::size_t Rows, std::size_t Cols, class T> \ |
madcowswe | 15:9c5aaeda36dc | 278 | inline \ |
madcowswe | 15:9c5aaeda36dc | 279 | XprMatrix< \ |
madcowswe | 15:9c5aaeda36dc | 280 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 281 | Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ |
madcowswe | 15:9c5aaeda36dc | 282 | XprMatrix<E, Rows, Cols>, \ |
madcowswe | 15:9c5aaeda36dc | 283 | XprLiteral< std::complex<T> > \ |
madcowswe | 15:9c5aaeda36dc | 284 | >, \ |
madcowswe | 15:9c5aaeda36dc | 285 | Rows, Cols \ |
madcowswe | 15:9c5aaeda36dc | 286 | > \ |
madcowswe | 15:9c5aaeda36dc | 287 | NAME(const XprMatrix<E, Rows, Cols>& lhs, const std::complex<T>& rhs) { \ |
madcowswe | 15:9c5aaeda36dc | 288 | typedef XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 289 | Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ |
madcowswe | 15:9c5aaeda36dc | 290 | XprMatrix<E, Rows, Cols>, \ |
madcowswe | 15:9c5aaeda36dc | 291 | XprLiteral< std::complex<T> > \ |
madcowswe | 15:9c5aaeda36dc | 292 | > expr_type; \ |
madcowswe | 15:9c5aaeda36dc | 293 | return XprMatrix<expr_type, Rows, Cols>( \ |
madcowswe | 15:9c5aaeda36dc | 294 | expr_type(lhs, XprLiteral< std::complex<T> >(rhs))); \ |
madcowswe | 15:9c5aaeda36dc | 295 | } |
madcowswe | 15:9c5aaeda36dc | 296 | |
madcowswe | 15:9c5aaeda36dc | 297 | TVMET_IMPLEMENT_MACRO(pow) |
madcowswe | 15:9c5aaeda36dc | 298 | |
madcowswe | 15:9c5aaeda36dc | 299 | TVMET_IMPLEMENT_MACRO(atan2) |
madcowswe | 15:9c5aaeda36dc | 300 | TVMET_IMPLEMENT_MACRO(drem) |
madcowswe | 15:9c5aaeda36dc | 301 | TVMET_IMPLEMENT_MACRO(fmod) |
madcowswe | 15:9c5aaeda36dc | 302 | TVMET_IMPLEMENT_MACRO(hypot) |
madcowswe | 15:9c5aaeda36dc | 303 | TVMET_IMPLEMENT_MACRO(jn) |
madcowswe | 15:9c5aaeda36dc | 304 | TVMET_IMPLEMENT_MACRO(yn) |
madcowswe | 15:9c5aaeda36dc | 305 | |
madcowswe | 15:9c5aaeda36dc | 306 | #undef TVMET_IMPLEMENT_MACRO |
madcowswe | 15:9c5aaeda36dc | 307 | |
madcowswe | 15:9c5aaeda36dc | 308 | #endif // defined(TVMET_HAVE_COMPLEX) |
madcowswe | 15:9c5aaeda36dc | 309 | |
madcowswe | 15:9c5aaeda36dc | 310 | |
madcowswe | 15:9c5aaeda36dc | 311 | } // namespace tvmet |
madcowswe | 15:9c5aaeda36dc | 312 | |
madcowswe | 15:9c5aaeda36dc | 313 | #endif // TVMET_XPR_MATRIX_BINARY_FUNCTIONS_H |
madcowswe | 15:9c5aaeda36dc | 314 | |
madcowswe | 15:9c5aaeda36dc | 315 | // Local Variables: |
madcowswe | 15:9c5aaeda36dc | 316 | // mode:C++ |
madcowswe | 15:9c5aaeda36dc | 317 | // tab-width:8 |
madcowswe | 15:9c5aaeda36dc | 318 | // End: |