00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00027 #ifndef SHLIBARITH_HPP
00028 #define SHLIBARITH_HPP
00029
00030 #include "ShGeneric.hpp"
00031 #include "ShLib.hpp"
00032
00033 #ifndef WIN32
00034 namespace SH {
00035
00045 template<int N, typename T1, typename T2>
00046 ShGeneric<N, CT1T2> operator+(const ShGeneric<N, T1>& left, const ShGeneric<N, T2>& right);
00047 template<int N, typename T1, typename T2>
00048 ShGeneric<N, CT1T2> operator+(const ShGeneric<1, T1>& left, const ShGeneric<N, T2>& right);
00049 template<int N, typename T1, typename T2>
00050 ShGeneric<N, CT1T2> operator+(const ShGeneric<N, T1>& left, const ShGeneric<1, T2>& right);
00051 template<typename T1, typename T2>
00052 ShGeneric<1, CT1T2> operator+(const ShGeneric<1, T1>& left, const ShGeneric<1, T2>& right);
00053 SH_SHLIB_CONST_SCALAR_OP_DECL(operator+);
00054 SH_SHLIB_CONST_N_OP_BOTH_DECL(operator+);
00055
00060 template<int N, typename T1, typename T2>
00061 ShGeneric<N, CT1T2> operator-(const ShGeneric<N, T1>& left, const ShGeneric<N, T2>& right);
00062 template<int N, typename T1, typename T2>
00063 ShGeneric<N, CT1T2> operator-(const ShGeneric<1, T1>& left, const ShGeneric<N, T2>& right);
00064 template<int N, typename T1, typename T2>
00065 ShGeneric<N, CT1T2> operator-(const ShGeneric<N, T1>& left, const ShGeneric<1, T2>& right);
00066 template<typename T1, typename T2>
00067 ShGeneric<1, CT1T2> operator-(const ShGeneric<1, T1>& left, const ShGeneric<1, T2>& right);
00068 SH_SHLIB_CONST_SCALAR_OP_DECL(operator-);
00069 SH_SHLIB_CONST_N_OP_BOTH_DECL(operator-);
00070
00076 template<int N, typename T1, typename T2>
00077 ShGeneric<N, CT1T2> operator*(const ShGeneric<N, T1>& left, const ShGeneric<N, T2>& right);
00078 template<int N, typename T1, typename T2>
00079 ShGeneric<N, CT1T2> operator*(const ShGeneric<1, T1>& left, const ShGeneric<N, T2>& right);
00080 template<int N, typename T1, typename T2>
00081 ShGeneric<N, CT1T2> operator*(const ShGeneric<N, T1>& left, const ShGeneric<1, T2>& right);
00082 template<typename T1, typename T2>
00083 ShGeneric<1, CT1T2> operator*(const ShGeneric<1, T1>& left, const ShGeneric<1, T2>& right);
00084 SH_SHLIB_CONST_SCALAR_OP_DECL(operator*);
00085 SH_SHLIB_CONST_N_OP_BOTH_DECL(operator*);
00086
00092 template<int N, typename T1, typename T2>
00093 ShGeneric<N, CT1T2> operator/(const ShGeneric<N, T1>& left, const ShGeneric<N, T2>& right);
00094 template<int N, typename T1, typename T2>
00095 ShGeneric<N, CT1T2> operator/(const ShGeneric<N, T1>& left, const ShGeneric<1, T2>& right);
00096 template<int N, typename T1, typename T2>
00097 ShGeneric<N, CT1T2> operator/(const ShGeneric<1, T1>& left, const ShGeneric<N, T2>& right);
00098 template<typename T1, typename T2>
00099 ShGeneric<1, CT1T2> operator/(const ShGeneric<1, T1>& left, const ShGeneric<1, T2>& right);
00100 SH_SHLIB_CONST_SCALAR_OP_DECL(operator/);
00101 SH_SHLIB_CONST_N_OP_LEFT_DECL(operator/);
00102
00103
00108 template<int N, typename T>
00109 ShGeneric<N, T> exp(const ShGeneric<N, T>& var);
00110
00115 template<int N, typename T>
00116 ShGeneric<N, T> exp2(const ShGeneric<N, T>& var);
00117
00122 template<int N, typename T>
00123 ShGeneric<N, T> exp(const ShGeneric<N, T>& var);
00124
00129 template<int N, typename T>
00130 ShGeneric<N, T> expm1(const ShGeneric<N, T>& x);
00131
00136 template<int N, typename T>
00137 ShGeneric<N, T> log(const ShGeneric<N, T>& var);
00138
00143 template<int N, typename T>
00144 ShGeneric<N, T> log2(const ShGeneric<N, T>& var);
00145
00150 template<int N, typename T>
00151 ShGeneric<N, T> log(const ShGeneric<N, T>& var);
00152
00157 template<int N, typename T>
00158 ShGeneric<N, T> logp1(const ShGeneric<N, T>& x);
00159
00164 template<int N, typename T1, typename T2, typename T3>
00165 ShGeneric<N, CT1T2>
00166 pow(const ShGeneric<N, T1>& left, const ShGeneric<N, T2>& right);
00167 template<int N, typename T1, typename T2, typename T3>
00168 ShGeneric<N, CT1T2>
00169 pow(const ShGeneric<N, T1>& left, const ShGeneric<1, T2>& right);
00170 template<typename T1, typename T2, typename T3>
00171 ShGeneric<1, CT1T2> pow(const ShGeneric<1, T1>& left, const ShGeneric<1, T2>& right);
00172
00173 SH_SHLIB_CONST_SCALAR_OP_DECL(pow);
00174 SH_SHLIB_CONST_N_OP_RIGHT_DECL(pow);
00175
00181 template<int N, typename T1, typename T2, typename T3>
00182 ShGeneric<N, CT1T2T3>
00183 mad(const ShGeneric<N, T1>& m1, const ShGeneric<N, T2>& m2,
00184 const ShGeneric<N, T3>& a);
00185 template<int N, typename T1, typename T2, typename T3>
00186 ShGeneric<N, CT1T2T3>
00187 mad(const ShGeneric<N, T1>& m1, const ShGeneric<1, T2>& m2,
00188 const ShGeneric<N, T3>& a);
00189 template<int N, typename T1, typename T2, typename T3>
00190 ShGeneric<N, CT1T2T3>
00191 mad(const ShGeneric<1, T1>& m1, const ShGeneric<N, T2>& m2,
00192 const ShGeneric<N, T3>& a);
00193 template<typename T1, typename T2, typename T3>
00194 ShGeneric<1, CT1T2T3> mad(const ShGeneric<1, T1>& m1, const ShGeneric<1, T2>& m2,
00195 const ShGeneric<1, T3>& a);
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207 template<int N, typename T1, typename T2>
00208 ShGeneric<N, CT1T2>
00209 mad(double m1, const ShGeneric<N, T1>& m2, const ShGeneric<N, T2>& a);
00210 template<int N, typename T1, typename T2>
00211 ShGeneric<N, CT1T2>
00212 mad(const ShGeneric<N, T1>& m1, double m2, const ShGeneric<N, T2>& a);
00213
00214
00215
00216
00217 template<int N, typename T>
00218 ShGeneric<N, T> rcp(const ShGeneric<N, T>& var);
00219
00220
00221
00222
00223 template<int N, typename T>
00224 ShGeneric<N, T> sqrt(const ShGeneric<N, T>& var);
00225
00226
00227
00228
00229 template<int N, typename T>
00230 ShGeneric<N, T> rsqrt(const ShGeneric<N, T>& var);
00231
00232
00233
00234
00235 template<int N, typename T>
00236 ShGeneric<N, T> cbrt(const ShGeneric<N, T>& var);
00237
00244 template<int N, typename T1, typename T2, typename T3>
00245 ShGeneric<N, CT1T2T3>
00246 lerp(const ShGeneric<N, T1>& f, const ShGeneric<N, T2>& a,
00247 const ShGeneric<N, T3>& b);
00248 template<int N, typename T1, typename T2, typename T3>
00249 ShGeneric<N, CT1T2T3>
00250 lerp(const ShGeneric<1, T1>& f, const ShGeneric<N, T2>& a,
00251 const ShGeneric<N, T3>& b);
00252 template<typename T1, typename T2, typename T3>
00253 ShGeneric<1, CT1T2T3>
00254 lerp(const ShGeneric<1, T1>& f, const ShGeneric<1, T2>& a,
00255 const ShGeneric<1, T3>& b);
00256
00257 template<int N, typename T1, typename T2>
00258 ShGeneric<N, CT1T2>
00259 lerp(double f, const ShGeneric<N, T1>& a, const ShGeneric<N, T2>& b);
00260
00261
00262
00263
00264
00265 template<int N, typename T>
00266 ShGeneric<1, T> sum(const ShGeneric<N, T>& var);
00267
00268
00269
00270
00271 template<int N, typename T>
00272 ShGeneric<1, T> prod(const ShGeneric<N, T>& var);
00273
00274 }
00275 #endif
00276
00277 #include "ShLibArithImpl.hpp"
00278
00279 #endif