![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ICRS Eurobot 2013
Dependencies: mbed mbed-rtos Servo QEI
tvmet/VectorBinaryFunctions.h@15:9c5aaeda36dc, 2013-04-06 (annotated)
- Committer:
- madcowswe
- Date:
- Sat Apr 06 20:57:54 2013 +0000
- Revision:
- 15:9c5aaeda36dc
Encoders fairly tuned, still has random noise in it
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: VectorBinaryFunctions.h,v 1.17 2007-06-23 15:58:58 opetzold Exp $ |
madcowswe | 15:9c5aaeda36dc | 22 | */ |
madcowswe | 15:9c5aaeda36dc | 23 | |
madcowswe | 15:9c5aaeda36dc | 24 | #ifndef TVMET_VECTOR_BINARY_FUNCTIONS_H |
madcowswe | 15:9c5aaeda36dc | 25 | #define TVMET_VECTOR_BINARY_FUNCTIONS_H |
madcowswe | 15:9c5aaeda36dc | 26 | |
madcowswe | 15:9c5aaeda36dc | 27 | #include <tvmet/NumericTraits.h> |
madcowswe | 15:9c5aaeda36dc | 28 | #include <tvmet/Extremum.h> |
madcowswe | 15:9c5aaeda36dc | 29 | |
madcowswe | 15:9c5aaeda36dc | 30 | namespace tvmet { |
madcowswe | 15:9c5aaeda36dc | 31 | |
madcowswe | 15:9c5aaeda36dc | 32 | |
madcowswe | 15:9c5aaeda36dc | 33 | /********************************************************* |
madcowswe | 15:9c5aaeda36dc | 34 | * PART I: DECLARATION |
madcowswe | 15:9c5aaeda36dc | 35 | *********************************************************/ |
madcowswe | 15:9c5aaeda36dc | 36 | |
madcowswe | 15:9c5aaeda36dc | 37 | /* |
madcowswe | 15:9c5aaeda36dc | 38 | * binary_function(Vector<T1, Sz>, Vector<T1, Sz>) |
madcowswe | 15:9c5aaeda36dc | 39 | * binary_function(Vector<T, Sz>, XprVector<E>) |
madcowswe | 15:9c5aaeda36dc | 40 | * binary_function(XprVector<E>, Vector<T, Sz>) |
madcowswe | 15:9c5aaeda36dc | 41 | */ |
madcowswe | 15:9c5aaeda36dc | 42 | #define TVMET_DECLARE_MACRO(NAME) \ |
madcowswe | 15:9c5aaeda36dc | 43 | template<class T1, class T2, std::size_t Sz> \ |
madcowswe | 15:9c5aaeda36dc | 44 | inline \ |
madcowswe | 15:9c5aaeda36dc | 45 | XprVector< \ |
madcowswe | 15:9c5aaeda36dc | 46 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 47 | Fcnl_##NAME<T1, T2>, \ |
madcowswe | 15:9c5aaeda36dc | 48 | VectorConstReference<T1, Sz>, \ |
madcowswe | 15:9c5aaeda36dc | 49 | VectorConstReference<T2, Sz> \ |
madcowswe | 15:9c5aaeda36dc | 50 | >, \ |
madcowswe | 15:9c5aaeda36dc | 51 | Sz \ |
madcowswe | 15:9c5aaeda36dc | 52 | > \ |
madcowswe | 15:9c5aaeda36dc | 53 | NAME(const Vector<T1, Sz>& lhs, \ |
madcowswe | 15:9c5aaeda36dc | 54 | const Vector<T2, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; \ |
madcowswe | 15:9c5aaeda36dc | 55 | \ |
madcowswe | 15:9c5aaeda36dc | 56 | template<class E, class T, std::size_t Sz> \ |
madcowswe | 15:9c5aaeda36dc | 57 | inline \ |
madcowswe | 15:9c5aaeda36dc | 58 | XprVector< \ |
madcowswe | 15:9c5aaeda36dc | 59 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 60 | Fcnl_##NAME<typename E::value_type, T>, \ |
madcowswe | 15:9c5aaeda36dc | 61 | VectorConstReference<T, Sz>, \ |
madcowswe | 15:9c5aaeda36dc | 62 | XprVector<E, Sz> \ |
madcowswe | 15:9c5aaeda36dc | 63 | >, \ |
madcowswe | 15:9c5aaeda36dc | 64 | Sz \ |
madcowswe | 15:9c5aaeda36dc | 65 | > \ |
madcowswe | 15:9c5aaeda36dc | 66 | NAME(const XprVector<E, Sz>& lhs, \ |
madcowswe | 15:9c5aaeda36dc | 67 | const Vector<T, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; \ |
madcowswe | 15:9c5aaeda36dc | 68 | \ |
madcowswe | 15:9c5aaeda36dc | 69 | template<class E, class T, std::size_t Sz> \ |
madcowswe | 15:9c5aaeda36dc | 70 | inline \ |
madcowswe | 15:9c5aaeda36dc | 71 | XprVector< \ |
madcowswe | 15:9c5aaeda36dc | 72 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 73 | Fcnl_##NAME<T, typename E::value_type>, \ |
madcowswe | 15:9c5aaeda36dc | 74 | VectorConstReference<T, Sz>, \ |
madcowswe | 15:9c5aaeda36dc | 75 | XprVector<E, Sz> \ |
madcowswe | 15:9c5aaeda36dc | 76 | >, \ |
madcowswe | 15:9c5aaeda36dc | 77 | Sz \ |
madcowswe | 15:9c5aaeda36dc | 78 | > \ |
madcowswe | 15:9c5aaeda36dc | 79 | NAME(const Vector<T, Sz>& lhs, \ |
madcowswe | 15:9c5aaeda36dc | 80 | const XprVector<E, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE; |
madcowswe | 15:9c5aaeda36dc | 81 | |
madcowswe | 15:9c5aaeda36dc | 82 | TVMET_DECLARE_MACRO(atan2) |
madcowswe | 15:9c5aaeda36dc | 83 | TVMET_DECLARE_MACRO(drem) |
madcowswe | 15:9c5aaeda36dc | 84 | TVMET_DECLARE_MACRO(fmod) |
madcowswe | 15:9c5aaeda36dc | 85 | TVMET_DECLARE_MACRO(hypot) |
madcowswe | 15:9c5aaeda36dc | 86 | TVMET_DECLARE_MACRO(jn) |
madcowswe | 15:9c5aaeda36dc | 87 | TVMET_DECLARE_MACRO(yn) |
madcowswe | 15:9c5aaeda36dc | 88 | TVMET_DECLARE_MACRO(pow) |
madcowswe | 15:9c5aaeda36dc | 89 | #if defined(TVMET_HAVE_COMPLEX) |
madcowswe | 15:9c5aaeda36dc | 90 | TVMET_DECLARE_MACRO(polar) |
madcowswe | 15:9c5aaeda36dc | 91 | #endif |
madcowswe | 15:9c5aaeda36dc | 92 | |
madcowswe | 15:9c5aaeda36dc | 93 | #undef TVMET_DECLARE_MACRO |
madcowswe | 15:9c5aaeda36dc | 94 | |
madcowswe | 15:9c5aaeda36dc | 95 | |
madcowswe | 15:9c5aaeda36dc | 96 | /* |
madcowswe | 15:9c5aaeda36dc | 97 | * binary_function(Vector<T, Sz>, POD) |
madcowswe | 15:9c5aaeda36dc | 98 | */ |
madcowswe | 15:9c5aaeda36dc | 99 | #define TVMET_DECLARE_MACRO(NAME, TP) \ |
madcowswe | 15:9c5aaeda36dc | 100 | template<class T, std::size_t Sz> \ |
madcowswe | 15:9c5aaeda36dc | 101 | inline \ |
madcowswe | 15:9c5aaeda36dc | 102 | XprVector< \ |
madcowswe | 15:9c5aaeda36dc | 103 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 104 | Fcnl_##NAME<T, TP >, \ |
madcowswe | 15:9c5aaeda36dc | 105 | VectorConstReference<T, Sz>, \ |
madcowswe | 15:9c5aaeda36dc | 106 | XprLiteral< TP > \ |
madcowswe | 15:9c5aaeda36dc | 107 | >, \ |
madcowswe | 15:9c5aaeda36dc | 108 | Sz \ |
madcowswe | 15:9c5aaeda36dc | 109 | > \ |
madcowswe | 15:9c5aaeda36dc | 110 | NAME(const Vector<T, Sz>& lhs, TP rhs) TVMET_CXX_ALWAYS_INLINE; |
madcowswe | 15:9c5aaeda36dc | 111 | |
madcowswe | 15:9c5aaeda36dc | 112 | TVMET_DECLARE_MACRO(atan2, int) |
madcowswe | 15:9c5aaeda36dc | 113 | TVMET_DECLARE_MACRO(drem, int) |
madcowswe | 15:9c5aaeda36dc | 114 | TVMET_DECLARE_MACRO(fmod, int) |
madcowswe | 15:9c5aaeda36dc | 115 | TVMET_DECLARE_MACRO(hypot, int) |
madcowswe | 15:9c5aaeda36dc | 116 | TVMET_DECLARE_MACRO(jn, int) |
madcowswe | 15:9c5aaeda36dc | 117 | TVMET_DECLARE_MACRO(yn, int) |
madcowswe | 15:9c5aaeda36dc | 118 | TVMET_DECLARE_MACRO(pow, int) |
madcowswe | 15:9c5aaeda36dc | 119 | |
madcowswe | 15:9c5aaeda36dc | 120 | #if defined(TVMET_HAVE_LONG_LONG) |
madcowswe | 15:9c5aaeda36dc | 121 | TVMET_DECLARE_MACRO(atan2, long long int) |
madcowswe | 15:9c5aaeda36dc | 122 | TVMET_DECLARE_MACRO(drem, long long int) |
madcowswe | 15:9c5aaeda36dc | 123 | TVMET_DECLARE_MACRO(fmod, long long int) |
madcowswe | 15:9c5aaeda36dc | 124 | TVMET_DECLARE_MACRO(hypot, long long int) |
madcowswe | 15:9c5aaeda36dc | 125 | TVMET_DECLARE_MACRO(jn, long long int) |
madcowswe | 15:9c5aaeda36dc | 126 | TVMET_DECLARE_MACRO(yn, long long int) |
madcowswe | 15:9c5aaeda36dc | 127 | TVMET_DECLARE_MACRO(pow, long long int) |
madcowswe | 15:9c5aaeda36dc | 128 | #endif // defined(TVMET_HAVE_LONG_LONG) |
madcowswe | 15:9c5aaeda36dc | 129 | |
madcowswe | 15:9c5aaeda36dc | 130 | TVMET_DECLARE_MACRO(atan2, float) |
madcowswe | 15:9c5aaeda36dc | 131 | TVMET_DECLARE_MACRO(drem, float) |
madcowswe | 15:9c5aaeda36dc | 132 | TVMET_DECLARE_MACRO(fmod, float) |
madcowswe | 15:9c5aaeda36dc | 133 | TVMET_DECLARE_MACRO(hypot, float) |
madcowswe | 15:9c5aaeda36dc | 134 | TVMET_DECLARE_MACRO(jn, float) |
madcowswe | 15:9c5aaeda36dc | 135 | TVMET_DECLARE_MACRO(yn, float) |
madcowswe | 15:9c5aaeda36dc | 136 | TVMET_DECLARE_MACRO(pow, float) |
madcowswe | 15:9c5aaeda36dc | 137 | |
madcowswe | 15:9c5aaeda36dc | 138 | TVMET_DECLARE_MACRO(atan2, double) |
madcowswe | 15:9c5aaeda36dc | 139 | TVMET_DECLARE_MACRO(drem, double) |
madcowswe | 15:9c5aaeda36dc | 140 | TVMET_DECLARE_MACRO(fmod, double) |
madcowswe | 15:9c5aaeda36dc | 141 | TVMET_DECLARE_MACRO(hypot, double) |
madcowswe | 15:9c5aaeda36dc | 142 | TVMET_DECLARE_MACRO(jn, double) |
madcowswe | 15:9c5aaeda36dc | 143 | TVMET_DECLARE_MACRO(yn, double) |
madcowswe | 15:9c5aaeda36dc | 144 | TVMET_DECLARE_MACRO(pow, double) |
madcowswe | 15:9c5aaeda36dc | 145 | |
madcowswe | 15:9c5aaeda36dc | 146 | #if defined(TVMET_HAVE_LONG_DOUBLE) |
madcowswe | 15:9c5aaeda36dc | 147 | TVMET_DECLARE_MACRO(atan2, long double) |
madcowswe | 15:9c5aaeda36dc | 148 | TVMET_DECLARE_MACRO(drem, long double) |
madcowswe | 15:9c5aaeda36dc | 149 | TVMET_DECLARE_MACRO(fmod, long double) |
madcowswe | 15:9c5aaeda36dc | 150 | TVMET_DECLARE_MACRO(hypot, long double) |
madcowswe | 15:9c5aaeda36dc | 151 | TVMET_DECLARE_MACRO(jn, long double) |
madcowswe | 15:9c5aaeda36dc | 152 | TVMET_DECLARE_MACRO(yn, long double) |
madcowswe | 15:9c5aaeda36dc | 153 | TVMET_DECLARE_MACRO(pow, long double) |
madcowswe | 15:9c5aaeda36dc | 154 | #endif // defined(TVMET_HAVE_LONG_DOUBLE) |
madcowswe | 15:9c5aaeda36dc | 155 | |
madcowswe | 15:9c5aaeda36dc | 156 | #undef TVMET_DECLARE_MACRO |
madcowswe | 15:9c5aaeda36dc | 157 | |
madcowswe | 15:9c5aaeda36dc | 158 | |
madcowswe | 15:9c5aaeda36dc | 159 | /* |
madcowswe | 15:9c5aaeda36dc | 160 | * complex support |
madcowswe | 15:9c5aaeda36dc | 161 | */ |
madcowswe | 15:9c5aaeda36dc | 162 | |
madcowswe | 15:9c5aaeda36dc | 163 | #if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) |
madcowswe | 15:9c5aaeda36dc | 164 | template<class T, std::size_t Sz> |
madcowswe | 15:9c5aaeda36dc | 165 | XprVector< |
madcowswe | 15:9c5aaeda36dc | 166 | XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 167 | Fcnl_pow<T, std::complex<T> >, |
madcowswe | 15:9c5aaeda36dc | 168 | VectorConstReference<T, Sz>, |
madcowswe | 15:9c5aaeda36dc | 169 | XprLiteral< std::complex<T> > |
madcowswe | 15:9c5aaeda36dc | 170 | >, |
madcowswe | 15:9c5aaeda36dc | 171 | Sz |
madcowswe | 15:9c5aaeda36dc | 172 | > |
madcowswe | 15:9c5aaeda36dc | 173 | pow(const Vector<T, Sz>& lhs, |
madcowswe | 15:9c5aaeda36dc | 174 | const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE; |
madcowswe | 15:9c5aaeda36dc | 175 | |
madcowswe | 15:9c5aaeda36dc | 176 | |
madcowswe | 15:9c5aaeda36dc | 177 | template<class T, std::size_t Sz> |
madcowswe | 15:9c5aaeda36dc | 178 | XprVector< |
madcowswe | 15:9c5aaeda36dc | 179 | XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 180 | Fcnl_pow<std::complex<T>, std::complex<T> >, |
madcowswe | 15:9c5aaeda36dc | 181 | VectorConstReference<std::complex<T>, Sz>, |
madcowswe | 15:9c5aaeda36dc | 182 | XprLiteral< std::complex<T> > |
madcowswe | 15:9c5aaeda36dc | 183 | >, |
madcowswe | 15:9c5aaeda36dc | 184 | Sz |
madcowswe | 15:9c5aaeda36dc | 185 | > |
madcowswe | 15:9c5aaeda36dc | 186 | pow(const Vector<std::complex<T>, Sz>& lhs, |
madcowswe | 15:9c5aaeda36dc | 187 | const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE; |
madcowswe | 15:9c5aaeda36dc | 188 | |
madcowswe | 15:9c5aaeda36dc | 189 | |
madcowswe | 15:9c5aaeda36dc | 190 | template<class T, std::size_t Sz> |
madcowswe | 15:9c5aaeda36dc | 191 | XprVector< |
madcowswe | 15:9c5aaeda36dc | 192 | XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 193 | Fcnl_pow<std::complex<T>, T>, |
madcowswe | 15:9c5aaeda36dc | 194 | VectorConstReference<std::complex<T>, Sz>, |
madcowswe | 15:9c5aaeda36dc | 195 | XprLiteral<T> |
madcowswe | 15:9c5aaeda36dc | 196 | >, |
madcowswe | 15:9c5aaeda36dc | 197 | Sz |
madcowswe | 15:9c5aaeda36dc | 198 | > |
madcowswe | 15:9c5aaeda36dc | 199 | pow(const Vector<std::complex<T>, Sz>& lhs, |
madcowswe | 15:9c5aaeda36dc | 200 | const T& rhs) TVMET_CXX_ALWAYS_INLINE; |
madcowswe | 15:9c5aaeda36dc | 201 | |
madcowswe | 15:9c5aaeda36dc | 202 | |
madcowswe | 15:9c5aaeda36dc | 203 | template<class T, std::size_t Sz> |
madcowswe | 15:9c5aaeda36dc | 204 | XprVector< |
madcowswe | 15:9c5aaeda36dc | 205 | XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 206 | Fcnl_pow<std::complex<T>, int>, |
madcowswe | 15:9c5aaeda36dc | 207 | VectorConstReference<std::complex<T>, Sz>, |
madcowswe | 15:9c5aaeda36dc | 208 | XprLiteral<int> |
madcowswe | 15:9c5aaeda36dc | 209 | >, |
madcowswe | 15:9c5aaeda36dc | 210 | Sz |
madcowswe | 15:9c5aaeda36dc | 211 | > |
madcowswe | 15:9c5aaeda36dc | 212 | pow(const Vector<std::complex<T>, Sz>& lhs, |
madcowswe | 15:9c5aaeda36dc | 213 | int rhs) TVMET_CXX_ALWAYS_INLINE; |
madcowswe | 15:9c5aaeda36dc | 214 | |
madcowswe | 15:9c5aaeda36dc | 215 | |
madcowswe | 15:9c5aaeda36dc | 216 | template<class T, std::size_t Sz> |
madcowswe | 15:9c5aaeda36dc | 217 | XprVector< |
madcowswe | 15:9c5aaeda36dc | 218 | XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 219 | Fcnl_polar<T, T>, |
madcowswe | 15:9c5aaeda36dc | 220 | VectorConstReference<T, Sz>, |
madcowswe | 15:9c5aaeda36dc | 221 | XprLiteral<T> |
madcowswe | 15:9c5aaeda36dc | 222 | >, |
madcowswe | 15:9c5aaeda36dc | 223 | Sz |
madcowswe | 15:9c5aaeda36dc | 224 | > |
madcowswe | 15:9c5aaeda36dc | 225 | polar(const Vector<T, Sz>& lhs, const T& rhs) TVMET_CXX_ALWAYS_INLINE; |
madcowswe | 15:9c5aaeda36dc | 226 | |
madcowswe | 15:9c5aaeda36dc | 227 | #endif // defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) |
madcowswe | 15:9c5aaeda36dc | 228 | |
madcowswe | 15:9c5aaeda36dc | 229 | #if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH2) |
madcowswe | 15:9c5aaeda36dc | 230 | // to be written (atan2) |
madcowswe | 15:9c5aaeda36dc | 231 | #endif // defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH2) |
madcowswe | 15:9c5aaeda36dc | 232 | |
madcowswe | 15:9c5aaeda36dc | 233 | |
madcowswe | 15:9c5aaeda36dc | 234 | /********************************************************* |
madcowswe | 15:9c5aaeda36dc | 235 | * PART II: IMPLEMENTATION |
madcowswe | 15:9c5aaeda36dc | 236 | *********************************************************/ |
madcowswe | 15:9c5aaeda36dc | 237 | |
madcowswe | 15:9c5aaeda36dc | 238 | /* |
madcowswe | 15:9c5aaeda36dc | 239 | * binary_function(Vector<T1, Sz>, Vector<T1, Sz>) |
madcowswe | 15:9c5aaeda36dc | 240 | * binary_function(Vector<T, Sz>, XprVector<E>) |
madcowswe | 15:9c5aaeda36dc | 241 | * binary_function(XprVector<E>, Vector<T, Sz>) |
madcowswe | 15:9c5aaeda36dc | 242 | */ |
madcowswe | 15:9c5aaeda36dc | 243 | #define TVMET_IMPLEMENT_MACRO(NAME) \ |
madcowswe | 15:9c5aaeda36dc | 244 | template<class T1, class T2, std::size_t Sz> \ |
madcowswe | 15:9c5aaeda36dc | 245 | inline \ |
madcowswe | 15:9c5aaeda36dc | 246 | XprVector< \ |
madcowswe | 15:9c5aaeda36dc | 247 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 248 | Fcnl_##NAME<T1, T2>, \ |
madcowswe | 15:9c5aaeda36dc | 249 | VectorConstReference<T1, Sz>, \ |
madcowswe | 15:9c5aaeda36dc | 250 | VectorConstReference<T2, Sz> \ |
madcowswe | 15:9c5aaeda36dc | 251 | >, \ |
madcowswe | 15:9c5aaeda36dc | 252 | Sz \ |
madcowswe | 15:9c5aaeda36dc | 253 | > \ |
madcowswe | 15:9c5aaeda36dc | 254 | NAME(const Vector<T1, Sz>& lhs, const Vector<T2, Sz>& rhs) { \ |
madcowswe | 15:9c5aaeda36dc | 255 | typedef XprBinOp < \ |
madcowswe | 15:9c5aaeda36dc | 256 | Fcnl_##NAME<T1, T2>, \ |
madcowswe | 15:9c5aaeda36dc | 257 | VectorConstReference<T1, Sz>, \ |
madcowswe | 15:9c5aaeda36dc | 258 | VectorConstReference<T2, Sz> \ |
madcowswe | 15:9c5aaeda36dc | 259 | > expr_type; \ |
madcowswe | 15:9c5aaeda36dc | 260 | return XprVector<expr_type, Sz>( \ |
madcowswe | 15:9c5aaeda36dc | 261 | expr_type(lhs.const_ref(), rhs.const_ref())); \ |
madcowswe | 15:9c5aaeda36dc | 262 | } \ |
madcowswe | 15:9c5aaeda36dc | 263 | \ |
madcowswe | 15:9c5aaeda36dc | 264 | template<class E, class T, std::size_t Sz> \ |
madcowswe | 15:9c5aaeda36dc | 265 | inline \ |
madcowswe | 15:9c5aaeda36dc | 266 | XprVector< \ |
madcowswe | 15:9c5aaeda36dc | 267 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 268 | Fcnl_##NAME<typename E::value_type, T>, \ |
madcowswe | 15:9c5aaeda36dc | 269 | VectorConstReference<T, Sz>, \ |
madcowswe | 15:9c5aaeda36dc | 270 | XprVector<E, Sz> \ |
madcowswe | 15:9c5aaeda36dc | 271 | >, \ |
madcowswe | 15:9c5aaeda36dc | 272 | Sz \ |
madcowswe | 15:9c5aaeda36dc | 273 | > \ |
madcowswe | 15:9c5aaeda36dc | 274 | NAME(const XprVector<E, Sz>& lhs, const Vector<T, Sz>& rhs) { \ |
madcowswe | 15:9c5aaeda36dc | 275 | typedef XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 276 | Fcnl_##NAME<typename E::value_type, T>, \ |
madcowswe | 15:9c5aaeda36dc | 277 | XprVector<E, Sz>, \ |
madcowswe | 15:9c5aaeda36dc | 278 | VectorConstReference<T, Sz> \ |
madcowswe | 15:9c5aaeda36dc | 279 | > expr_type; \ |
madcowswe | 15:9c5aaeda36dc | 280 | return XprVector<expr_type, Sz>( \ |
madcowswe | 15:9c5aaeda36dc | 281 | expr_type(lhs, rhs.const_ref())); \ |
madcowswe | 15:9c5aaeda36dc | 282 | } \ |
madcowswe | 15:9c5aaeda36dc | 283 | \ |
madcowswe | 15:9c5aaeda36dc | 284 | template<class E, class T, std::size_t Sz> \ |
madcowswe | 15:9c5aaeda36dc | 285 | inline \ |
madcowswe | 15:9c5aaeda36dc | 286 | XprVector< \ |
madcowswe | 15:9c5aaeda36dc | 287 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 288 | Fcnl_##NAME<T, typename E::value_type>, \ |
madcowswe | 15:9c5aaeda36dc | 289 | VectorConstReference<T, Sz>, \ |
madcowswe | 15:9c5aaeda36dc | 290 | XprVector<E, Sz> \ |
madcowswe | 15:9c5aaeda36dc | 291 | >, \ |
madcowswe | 15:9c5aaeda36dc | 292 | Sz \ |
madcowswe | 15:9c5aaeda36dc | 293 | > \ |
madcowswe | 15:9c5aaeda36dc | 294 | NAME(const Vector<T, Sz>& lhs, const XprVector<E, Sz>& rhs) { \ |
madcowswe | 15:9c5aaeda36dc | 295 | typedef XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 296 | Fcnl_##NAME<T, typename E::value_type>, \ |
madcowswe | 15:9c5aaeda36dc | 297 | VectorConstReference<T, Sz>, \ |
madcowswe | 15:9c5aaeda36dc | 298 | XprVector<E, Sz> \ |
madcowswe | 15:9c5aaeda36dc | 299 | > expr_type; \ |
madcowswe | 15:9c5aaeda36dc | 300 | return XprVector<expr_type, Sz>( \ |
madcowswe | 15:9c5aaeda36dc | 301 | expr_type(lhs.const_ref(), rhs)); \ |
madcowswe | 15:9c5aaeda36dc | 302 | } |
madcowswe | 15:9c5aaeda36dc | 303 | |
madcowswe | 15:9c5aaeda36dc | 304 | TVMET_IMPLEMENT_MACRO(atan2) |
madcowswe | 15:9c5aaeda36dc | 305 | TVMET_IMPLEMENT_MACRO(drem) |
madcowswe | 15:9c5aaeda36dc | 306 | TVMET_IMPLEMENT_MACRO(fmod) |
madcowswe | 15:9c5aaeda36dc | 307 | TVMET_IMPLEMENT_MACRO(hypot) |
madcowswe | 15:9c5aaeda36dc | 308 | TVMET_IMPLEMENT_MACRO(jn) |
madcowswe | 15:9c5aaeda36dc | 309 | TVMET_IMPLEMENT_MACRO(yn) |
madcowswe | 15:9c5aaeda36dc | 310 | TVMET_IMPLEMENT_MACRO(pow) |
madcowswe | 15:9c5aaeda36dc | 311 | #if defined(TVMET_HAVE_COMPLEX) |
madcowswe | 15:9c5aaeda36dc | 312 | TVMET_IMPLEMENT_MACRO(polar) |
madcowswe | 15:9c5aaeda36dc | 313 | #endif |
madcowswe | 15:9c5aaeda36dc | 314 | |
madcowswe | 15:9c5aaeda36dc | 315 | #undef TVMET_IMPLEMENT_MACRO |
madcowswe | 15:9c5aaeda36dc | 316 | |
madcowswe | 15:9c5aaeda36dc | 317 | |
madcowswe | 15:9c5aaeda36dc | 318 | /* |
madcowswe | 15:9c5aaeda36dc | 319 | * binary_function(Vector<T, Sz>, POD) |
madcowswe | 15:9c5aaeda36dc | 320 | */ |
madcowswe | 15:9c5aaeda36dc | 321 | #define TVMET_IMPLEMENT_MACRO(NAME, TP) \ |
madcowswe | 15:9c5aaeda36dc | 322 | template<class T, std::size_t Sz> \ |
madcowswe | 15:9c5aaeda36dc | 323 | inline \ |
madcowswe | 15:9c5aaeda36dc | 324 | XprVector< \ |
madcowswe | 15:9c5aaeda36dc | 325 | XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 326 | Fcnl_##NAME<T, TP >, \ |
madcowswe | 15:9c5aaeda36dc | 327 | VectorConstReference<T, Sz>, \ |
madcowswe | 15:9c5aaeda36dc | 328 | XprLiteral< TP > \ |
madcowswe | 15:9c5aaeda36dc | 329 | >, \ |
madcowswe | 15:9c5aaeda36dc | 330 | Sz \ |
madcowswe | 15:9c5aaeda36dc | 331 | > \ |
madcowswe | 15:9c5aaeda36dc | 332 | NAME(const Vector<T, Sz>& lhs, TP rhs) { \ |
madcowswe | 15:9c5aaeda36dc | 333 | typedef XprBinOp< \ |
madcowswe | 15:9c5aaeda36dc | 334 | Fcnl_##NAME<T, TP >, \ |
madcowswe | 15:9c5aaeda36dc | 335 | VectorConstReference<T, Sz>, \ |
madcowswe | 15:9c5aaeda36dc | 336 | XprLiteral< TP > \ |
madcowswe | 15:9c5aaeda36dc | 337 | > expr_type; \ |
madcowswe | 15:9c5aaeda36dc | 338 | return XprVector<expr_type, Sz>( \ |
madcowswe | 15:9c5aaeda36dc | 339 | expr_type(lhs.const_ref(), XprLiteral< TP >(rhs))); \ |
madcowswe | 15:9c5aaeda36dc | 340 | } |
madcowswe | 15:9c5aaeda36dc | 341 | |
madcowswe | 15:9c5aaeda36dc | 342 | TVMET_IMPLEMENT_MACRO(atan2, int) |
madcowswe | 15:9c5aaeda36dc | 343 | TVMET_IMPLEMENT_MACRO(drem, int) |
madcowswe | 15:9c5aaeda36dc | 344 | TVMET_IMPLEMENT_MACRO(fmod, int) |
madcowswe | 15:9c5aaeda36dc | 345 | TVMET_IMPLEMENT_MACRO(hypot, int) |
madcowswe | 15:9c5aaeda36dc | 346 | TVMET_IMPLEMENT_MACRO(jn, int) |
madcowswe | 15:9c5aaeda36dc | 347 | TVMET_IMPLEMENT_MACRO(yn, int) |
madcowswe | 15:9c5aaeda36dc | 348 | TVMET_IMPLEMENT_MACRO(pow, int) |
madcowswe | 15:9c5aaeda36dc | 349 | |
madcowswe | 15:9c5aaeda36dc | 350 | #if defined(TVMET_HAVE_LONG_LONG) |
madcowswe | 15:9c5aaeda36dc | 351 | TVMET_IMPLEMENT_MACRO(atan2, long long int) |
madcowswe | 15:9c5aaeda36dc | 352 | TVMET_IMPLEMENT_MACRO(drem, long long int) |
madcowswe | 15:9c5aaeda36dc | 353 | TVMET_IMPLEMENT_MACRO(fmod, long long int) |
madcowswe | 15:9c5aaeda36dc | 354 | TVMET_IMPLEMENT_MACRO(hypot, long long int) |
madcowswe | 15:9c5aaeda36dc | 355 | TVMET_IMPLEMENT_MACRO(jn, long long int) |
madcowswe | 15:9c5aaeda36dc | 356 | TVMET_IMPLEMENT_MACRO(yn, long long int) |
madcowswe | 15:9c5aaeda36dc | 357 | TVMET_IMPLEMENT_MACRO(pow, long long int) |
madcowswe | 15:9c5aaeda36dc | 358 | #endif // defined(TVMET_HAVE_LONG_LONG) |
madcowswe | 15:9c5aaeda36dc | 359 | |
madcowswe | 15:9c5aaeda36dc | 360 | TVMET_IMPLEMENT_MACRO(atan2, float) |
madcowswe | 15:9c5aaeda36dc | 361 | TVMET_IMPLEMENT_MACRO(drem, float) |
madcowswe | 15:9c5aaeda36dc | 362 | TVMET_IMPLEMENT_MACRO(fmod, float) |
madcowswe | 15:9c5aaeda36dc | 363 | TVMET_IMPLEMENT_MACRO(hypot, float) |
madcowswe | 15:9c5aaeda36dc | 364 | TVMET_IMPLEMENT_MACRO(jn, float) |
madcowswe | 15:9c5aaeda36dc | 365 | TVMET_IMPLEMENT_MACRO(yn, float) |
madcowswe | 15:9c5aaeda36dc | 366 | TVMET_IMPLEMENT_MACRO(pow, float) |
madcowswe | 15:9c5aaeda36dc | 367 | |
madcowswe | 15:9c5aaeda36dc | 368 | TVMET_IMPLEMENT_MACRO(atan2, double) |
madcowswe | 15:9c5aaeda36dc | 369 | TVMET_IMPLEMENT_MACRO(drem, double) |
madcowswe | 15:9c5aaeda36dc | 370 | TVMET_IMPLEMENT_MACRO(fmod, double) |
madcowswe | 15:9c5aaeda36dc | 371 | TVMET_IMPLEMENT_MACRO(hypot, double) |
madcowswe | 15:9c5aaeda36dc | 372 | TVMET_IMPLEMENT_MACRO(jn, double) |
madcowswe | 15:9c5aaeda36dc | 373 | TVMET_IMPLEMENT_MACRO(yn, double) |
madcowswe | 15:9c5aaeda36dc | 374 | TVMET_IMPLEMENT_MACRO(pow, double) |
madcowswe | 15:9c5aaeda36dc | 375 | |
madcowswe | 15:9c5aaeda36dc | 376 | #if defined(TVMET_HAVE_LONG_DOUBLE) |
madcowswe | 15:9c5aaeda36dc | 377 | TVMET_IMPLEMENT_MACRO(atan2, long double) |
madcowswe | 15:9c5aaeda36dc | 378 | TVMET_IMPLEMENT_MACRO(drem, long double) |
madcowswe | 15:9c5aaeda36dc | 379 | TVMET_IMPLEMENT_MACRO(fmod, long double) |
madcowswe | 15:9c5aaeda36dc | 380 | TVMET_IMPLEMENT_MACRO(hypot, long double) |
madcowswe | 15:9c5aaeda36dc | 381 | TVMET_IMPLEMENT_MACRO(jn, long double) |
madcowswe | 15:9c5aaeda36dc | 382 | TVMET_IMPLEMENT_MACRO(yn, long double) |
madcowswe | 15:9c5aaeda36dc | 383 | TVMET_IMPLEMENT_MACRO(pow, long double) |
madcowswe | 15:9c5aaeda36dc | 384 | #endif // defined(TVMET_HAVE_LONG_DOUBLE) |
madcowswe | 15:9c5aaeda36dc | 385 | |
madcowswe | 15:9c5aaeda36dc | 386 | #undef TVMET_IMPLEMENT_MACRO |
madcowswe | 15:9c5aaeda36dc | 387 | |
madcowswe | 15:9c5aaeda36dc | 388 | |
madcowswe | 15:9c5aaeda36dc | 389 | /* |
madcowswe | 15:9c5aaeda36dc | 390 | * complex support |
madcowswe | 15:9c5aaeda36dc | 391 | */ |
madcowswe | 15:9c5aaeda36dc | 392 | |
madcowswe | 15:9c5aaeda36dc | 393 | #if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) |
madcowswe | 15:9c5aaeda36dc | 394 | /** |
madcowswe | 15:9c5aaeda36dc | 395 | * \fn pow(const Vector<T, Sz>& lhs, const std::complex<T>& rhs) |
madcowswe | 15:9c5aaeda36dc | 396 | * \ingroup _binary_function |
madcowswe | 15:9c5aaeda36dc | 397 | */ |
madcowswe | 15:9c5aaeda36dc | 398 | template<class T, std::size_t Sz> |
madcowswe | 15:9c5aaeda36dc | 399 | inline |
madcowswe | 15:9c5aaeda36dc | 400 | XprVector< |
madcowswe | 15:9c5aaeda36dc | 401 | XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 402 | Fcnl_pow<T, std::complex<T> >, |
madcowswe | 15:9c5aaeda36dc | 403 | VectorConstReference<T, Sz>, |
madcowswe | 15:9c5aaeda36dc | 404 | XprLiteral< std::complex<T> > |
madcowswe | 15:9c5aaeda36dc | 405 | >, |
madcowswe | 15:9c5aaeda36dc | 406 | Sz |
madcowswe | 15:9c5aaeda36dc | 407 | > |
madcowswe | 15:9c5aaeda36dc | 408 | pow(const Vector<T, Sz>& lhs, const std::complex<T>& rhs) { |
madcowswe | 15:9c5aaeda36dc | 409 | typedef XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 410 | Fcnl_pow<T, std::complex<T> >, |
madcowswe | 15:9c5aaeda36dc | 411 | VectorConstReference<T, Sz>, |
madcowswe | 15:9c5aaeda36dc | 412 | XprLiteral< std::complex<T> > |
madcowswe | 15:9c5aaeda36dc | 413 | > expr_type; |
madcowswe | 15:9c5aaeda36dc | 414 | return XprVector<expr_type, Sz>( |
madcowswe | 15:9c5aaeda36dc | 415 | expr_type(lhs.const_ref(), XprLiteral< std::complex<T> >(rhs))); |
madcowswe | 15:9c5aaeda36dc | 416 | } |
madcowswe | 15:9c5aaeda36dc | 417 | |
madcowswe | 15:9c5aaeda36dc | 418 | |
madcowswe | 15:9c5aaeda36dc | 419 | /** |
madcowswe | 15:9c5aaeda36dc | 420 | * \fn pow(const Vector<std::complex<T>, Sz>& lhs, const std::complex<T>& rhs) |
madcowswe | 15:9c5aaeda36dc | 421 | * \ingroup _binary_function |
madcowswe | 15:9c5aaeda36dc | 422 | */ |
madcowswe | 15:9c5aaeda36dc | 423 | template<class T, std::size_t Sz> |
madcowswe | 15:9c5aaeda36dc | 424 | inline |
madcowswe | 15:9c5aaeda36dc | 425 | XprVector< |
madcowswe | 15:9c5aaeda36dc | 426 | XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 427 | Fcnl_pow<std::complex<T>, std::complex<T> >, |
madcowswe | 15:9c5aaeda36dc | 428 | VectorConstReference<std::complex<T>, Sz>, |
madcowswe | 15:9c5aaeda36dc | 429 | XprLiteral< std::complex<T> > |
madcowswe | 15:9c5aaeda36dc | 430 | >, |
madcowswe | 15:9c5aaeda36dc | 431 | Sz |
madcowswe | 15:9c5aaeda36dc | 432 | > |
madcowswe | 15:9c5aaeda36dc | 433 | pow(const Vector<std::complex<T>, Sz>& lhs, const std::complex<T>& rhs) { |
madcowswe | 15:9c5aaeda36dc | 434 | typedef XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 435 | Fcnl_pow<std::complex<T>, std::complex<T> >, |
madcowswe | 15:9c5aaeda36dc | 436 | VectorConstReference<std::complex<T>, Sz>, |
madcowswe | 15:9c5aaeda36dc | 437 | XprLiteral< std::complex<T> > |
madcowswe | 15:9c5aaeda36dc | 438 | > expr_type; |
madcowswe | 15:9c5aaeda36dc | 439 | return XprVector<expr_type, Sz>( |
madcowswe | 15:9c5aaeda36dc | 440 | expr_type(lhs.const_ref(), XprLiteral< std::complex<T> >(rhs))); |
madcowswe | 15:9c5aaeda36dc | 441 | } |
madcowswe | 15:9c5aaeda36dc | 442 | |
madcowswe | 15:9c5aaeda36dc | 443 | |
madcowswe | 15:9c5aaeda36dc | 444 | /** |
madcowswe | 15:9c5aaeda36dc | 445 | * \fn pow(const Vector<std::complex<T>, Sz>& lhs, const T& rhs) |
madcowswe | 15:9c5aaeda36dc | 446 | * \ingroup _binary_function |
madcowswe | 15:9c5aaeda36dc | 447 | */ |
madcowswe | 15:9c5aaeda36dc | 448 | template<class T, std::size_t Sz> |
madcowswe | 15:9c5aaeda36dc | 449 | inline |
madcowswe | 15:9c5aaeda36dc | 450 | XprVector< |
madcowswe | 15:9c5aaeda36dc | 451 | XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 452 | Fcnl_pow<std::complex<T>, T>, |
madcowswe | 15:9c5aaeda36dc | 453 | VectorConstReference<std::complex<T>, Sz>, |
madcowswe | 15:9c5aaeda36dc | 454 | XprLiteral<T> |
madcowswe | 15:9c5aaeda36dc | 455 | >, |
madcowswe | 15:9c5aaeda36dc | 456 | Sz |
madcowswe | 15:9c5aaeda36dc | 457 | > |
madcowswe | 15:9c5aaeda36dc | 458 | pow(const Vector<std::complex<T>, Sz>& lhs, const T& rhs) { |
madcowswe | 15:9c5aaeda36dc | 459 | typedef XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 460 | Fcnl_pow<std::complex<T>, T>, |
madcowswe | 15:9c5aaeda36dc | 461 | VectorConstReference<std::complex<T>, Sz>, |
madcowswe | 15:9c5aaeda36dc | 462 | XprLiteral<T> |
madcowswe | 15:9c5aaeda36dc | 463 | > expr_type; |
madcowswe | 15:9c5aaeda36dc | 464 | return XprVector<expr_type, Sz>( |
madcowswe | 15:9c5aaeda36dc | 465 | expr_type(lhs.const_ref(), XprLiteral<T>(rhs))); |
madcowswe | 15:9c5aaeda36dc | 466 | } |
madcowswe | 15:9c5aaeda36dc | 467 | |
madcowswe | 15:9c5aaeda36dc | 468 | |
madcowswe | 15:9c5aaeda36dc | 469 | /** |
madcowswe | 15:9c5aaeda36dc | 470 | * \fn pow(const Vector<std::complex<T>, Sz>& lhs, int rhs) |
madcowswe | 15:9c5aaeda36dc | 471 | * \ingroup _binary_function |
madcowswe | 15:9c5aaeda36dc | 472 | */ |
madcowswe | 15:9c5aaeda36dc | 473 | template<class T, std::size_t Sz> |
madcowswe | 15:9c5aaeda36dc | 474 | inline |
madcowswe | 15:9c5aaeda36dc | 475 | XprVector< |
madcowswe | 15:9c5aaeda36dc | 476 | XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 477 | Fcnl_pow<std::complex<T>, int>, |
madcowswe | 15:9c5aaeda36dc | 478 | VectorConstReference<std::complex<T>, Sz>, |
madcowswe | 15:9c5aaeda36dc | 479 | XprLiteral<int> |
madcowswe | 15:9c5aaeda36dc | 480 | >, |
madcowswe | 15:9c5aaeda36dc | 481 | Sz |
madcowswe | 15:9c5aaeda36dc | 482 | > |
madcowswe | 15:9c5aaeda36dc | 483 | pow(const Vector<std::complex<T>, Sz>& lhs, int rhs) { |
madcowswe | 15:9c5aaeda36dc | 484 | typedef XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 485 | Fcnl_pow<std::complex<T>, int>, |
madcowswe | 15:9c5aaeda36dc | 486 | VectorConstReference<std::complex<T>, Sz>, |
madcowswe | 15:9c5aaeda36dc | 487 | XprLiteral<int> |
madcowswe | 15:9c5aaeda36dc | 488 | > expr_type; |
madcowswe | 15:9c5aaeda36dc | 489 | return XprVector<expr_type, Sz>( |
madcowswe | 15:9c5aaeda36dc | 490 | expr_type(lhs.const_ref(), XprLiteral<int>(rhs))); |
madcowswe | 15:9c5aaeda36dc | 491 | } |
madcowswe | 15:9c5aaeda36dc | 492 | |
madcowswe | 15:9c5aaeda36dc | 493 | |
madcowswe | 15:9c5aaeda36dc | 494 | /** |
madcowswe | 15:9c5aaeda36dc | 495 | * \fn polar(const Vector<T, Sz>& lhs, const T& rhs) |
madcowswe | 15:9c5aaeda36dc | 496 | * \ingroup _binary_function |
madcowswe | 15:9c5aaeda36dc | 497 | */ |
madcowswe | 15:9c5aaeda36dc | 498 | template<class T, std::size_t Sz> |
madcowswe | 15:9c5aaeda36dc | 499 | inline |
madcowswe | 15:9c5aaeda36dc | 500 | XprVector< |
madcowswe | 15:9c5aaeda36dc | 501 | XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 502 | Fcnl_polar<T, T>, |
madcowswe | 15:9c5aaeda36dc | 503 | VectorConstReference<T, Sz>, |
madcowswe | 15:9c5aaeda36dc | 504 | XprLiteral<T> |
madcowswe | 15:9c5aaeda36dc | 505 | >, |
madcowswe | 15:9c5aaeda36dc | 506 | Sz |
madcowswe | 15:9c5aaeda36dc | 507 | > |
madcowswe | 15:9c5aaeda36dc | 508 | polar(const Vector<T, Sz>& lhs, const T& rhs) { |
madcowswe | 15:9c5aaeda36dc | 509 | typedef XprBinOp< |
madcowswe | 15:9c5aaeda36dc | 510 | Fcnl_polar<T, T>, |
madcowswe | 15:9c5aaeda36dc | 511 | VectorConstReference<T, Sz>, |
madcowswe | 15:9c5aaeda36dc | 512 | XprLiteral<T> |
madcowswe | 15:9c5aaeda36dc | 513 | > expr_type; |
madcowswe | 15:9c5aaeda36dc | 514 | return XprVector<expr_type, Sz>( |
madcowswe | 15:9c5aaeda36dc | 515 | expr_type(lhs.const_ref(), XprLiteral<T>(rhs))); |
madcowswe | 15:9c5aaeda36dc | 516 | } |
madcowswe | 15:9c5aaeda36dc | 517 | #endif // defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH1) |
madcowswe | 15:9c5aaeda36dc | 518 | |
madcowswe | 15:9c5aaeda36dc | 519 | #if defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH2) |
madcowswe | 15:9c5aaeda36dc | 520 | // to be written (atan2) |
madcowswe | 15:9c5aaeda36dc | 521 | #endif // defined(TVMET_HAVE_COMPLEX) && defined(TVMET_HAVE_COMPLEX_MATH2) |
madcowswe | 15:9c5aaeda36dc | 522 | |
madcowswe | 15:9c5aaeda36dc | 523 | |
madcowswe | 15:9c5aaeda36dc | 524 | } // namespace tvmet |
madcowswe | 15:9c5aaeda36dc | 525 | |
madcowswe | 15:9c5aaeda36dc | 526 | #endif // TVMET_VECTOR_BINARY_FUNCTIONS_H |
madcowswe | 15:9c5aaeda36dc | 527 | |
madcowswe | 15:9c5aaeda36dc | 528 | // Local Variables: |
madcowswe | 15:9c5aaeda36dc | 529 | // mode:C++ |
madcowswe | 15:9c5aaeda36dc | 530 | // tab-width:8 |
madcowswe | 15:9c5aaeda36dc | 531 | // End: |