Changeset 16701 for trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/vector_operations.h
- Timestamp:
- 03/20/19 10:31:37 (5 years ago)
- Location:
- trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1
-
Property
svn:global-ignores
set to
build
mingw
-
Property
svn:global-ignores
set to
-
trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/vector_operations.h
r16356 r16701 14 14 #define hl_cos vdt::fast_cos 15 15 #define hl_tan vdt::fast_tan 16 #define hl_tanh vdt::fast_tanh 16 17 #define hl_sqrt vdt::fast_sqrt 17 18 #define hl_pow vdt::fast_pow 18 19 #define hl_round vdt::fast_round 20 #define hl_inv vdt::fast_inv 19 21 #else 20 22 #define hl_exp std::exp … … 23 25 #define hl_cos std::cos 24 26 #define hl_tan std::tan 27 #define hl_tanh std::tanh 25 28 #define hl_sqrt std::sqrt 26 29 #define hl_pow std::pow 27 30 #define hl_round std::round 31 #define hl_inv(x) 1. / x; 32 28 33 #endif 29 34 … … 47 52 inline void cos(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_cos(b[i]); } 48 53 inline void tan(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_tan(b[i]); } 54 inline void tanh(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_tanh(b[i]); } 49 55 inline void sqrt(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_sqrt(b[i]); } 50 56 inline void pow(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_pow(a[i], hl_round(b[i])); }; 51 57 inline void root(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_pow(a[i], 1. / hl_round(b[i])); }; 52 58 inline void square(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_pow(b[i], 2.); }; 53 inline void inv(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = 1. / b[i]; }59 inline void inv(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = hl_inv(b[i]); } 54 60 inline void neg(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = -b[i]; } 55 61 inline void abs(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = std::fabs(b[i]); } … … 66 72 // vector operations 67 73 inline void neg(double* __restrict a) noexcept { FOR(i) a[i] = -a[i]; } 68 inline void inv(double* __restrict a) noexcept { FOR(i) a[i] = 1. / a[i]; }74 inline void inv(double* __restrict a) noexcept { FOR(i) a[i] = hl_inv(a[i]); } 69 75 inline void exp(double* __restrict a) noexcept { FOR(i) a[i] = hl_exp(a[i]); } 70 76 inline void log(double* __restrict a) noexcept { FOR(i) a[i] = hl_log(a[i]); } 71 77 inline void sin(double* __restrict a) noexcept { FOR(i) a[i] = hl_sin(a[i]); } 72 78 inline void cos(double* __restrict a) noexcept { FOR(i) a[i] = hl_cos(a[i]); } 79 inline void tan(double* __restrict a) noexcept { FOR(i) a[i] = hl_tan(a[i]); } 80 inline void tanh(double* __restrict a) noexcept { FOR(i) a[i] = hl_tanh(a[i]); } 73 81 inline void round(double* __restrict a) noexcept { FOR(i) a[i] = hl_round(a[i]); } 74 82 inline void square(double* __restrict a) noexcept { FOR(i) a[i] = hl_pow(a[i], 2.); }
Note: See TracChangeset
for help on using the changeset viewer.