Changeset 17072 for stable/HeuristicLab.ExtLibs
- Timestamp:
- 07/04/19 16:07:49 (5 years ago)
- Location:
- stable
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
-
stable/HeuristicLab.ExtLibs
- Property svn:mergeinfo changed
/branches/2915-AbsoluteSymbol/HeuristicLab.ExtLibs (added) merged: 16240,16332,16349-16351 /trunk/HeuristicLab.ExtLibs merged: 16356
- Property svn:mergeinfo changed
-
stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/README.md
r17071 r17072 11 11 - Visual Studio 12 12 13 `cmake -G " MicrosoftVisual Studio 15 2017 [arch]" <path-to-repository>`. Leave `arch` empty for x86 or `Win64` for x64.13 `cmake -G "Visual Studio 15 2017 [arch]" <path-to-repository>`. Leave `arch` empty for x86 or `Win64` for x64. 14 14 15 15 `cmake --build . --config Release` -
stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/instruction.h
r16269 r17072 23 23 Root = 23, 24 24 Square = 28, 25 Sqrt = 29 25 Sqrt = 29, 26 Absolute = 48, 27 AnalyticalQuotient = 49, 28 Cube = 50, 29 CubeRoot = 51 26 30 }; 27 31 -
stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.h
r17071 r17072 12 12 switch (in.opcode) 13 13 { 14 case OpCodes::Const: /* nothing to do */ break; 14 15 case OpCodes::Var: 15 16 { … … 100 101 break; 101 102 } 103 case OpCodes::Sqrt: 104 { 105 in.value = std::pow(code[in.childIndex].value, 1./2.); 106 break; 107 } 102 108 case OpCodes::Square: 103 109 { … … 105 111 break; 106 112 } 107 case OpCodes::Sqrt: 108 { 109 in.value = std::sqrt(code[in.childIndex].value); 110 break; 111 } 113 case OpCodes::CubeRoot: 114 { 115 in.value = std::pow(code[in.childIndex].value, 1./3.); 116 break; 117 } 118 case OpCodes::Cube: 119 { 120 in.value = std::pow(code[in.childIndex].value, 3.); 121 break; 122 } 123 case OpCodes::Absolute: 124 { 125 in.value = std::fabs(code[in.childIndex].value); 126 break; 127 } 128 case OpCodes::AnalyticalQuotient: 129 { 130 double x = code[in.childIndex].value; 131 double y = code[in.childIndex + 1].value; 132 in.value = x / std::sqrt(1 + y*y); 133 break; 134 } 135 default: in.value = NAN; 112 136 } 113 137 } … … 136 160 break; 137 161 } 162 case OpCodes::Const: /* nothing to do because buffers for constants are already set */ break; 138 163 case OpCodes::Add: 139 164 { … … 227 252 case OpCodes::Square: 228 253 { 229 square(in.buf, code[in.childIndex].buf);254 pow(in.buf, code[in.childIndex].buf, 2.); 230 255 break; 231 256 } 232 257 case OpCodes::Sqrt: 233 258 { 234 sqrt(in.buf, code[in.childIndex].buf); 235 break; 236 } 237 } 259 pow(in.buf, code[in.childIndex].buf, 1./2.); 260 break; 261 } 262 case OpCodes::CubeRoot: 263 { 264 pow(in.buf, code[in.childIndex].buf, 1./3.); 265 break; 266 } 267 case OpCodes::Cube: 268 { 269 pow(in.buf, code[in.childIndex].buf, 3.); 270 break; 271 } 272 case OpCodes::Absolute: 273 { 274 abs(in.buf, code[in.childIndex].buf); 275 break; 276 } 277 case OpCodes::AnalyticalQuotient: 278 { 279 load(in.buf, code[in.childIndex].buf); 280 analytical_quotient(in.buf, code[in.childIndex + 1].buf); 281 break; 282 } 283 default: load(in.buf, NAN); 284 } 238 285 } 239 286 } -
stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/vector_operations.h
r17071 r17072 53 53 inline void inv(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = 1. / b[i]; } 54 54 inline void neg(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = -b[i]; } 55 inline void abs(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] = std::fabs(b[i]); } 56 inline void analytical_quotient(double* __restrict a, double const * __restrict b) noexcept { FOR(i) a[i] /= hl_sqrt(b[i]*b[i] + 1.); } 55 57 56 58 // vector - scalar operations … … 60 62 inline void mul(double* __restrict a, double s) noexcept { FOR(i) a[i] *= s; } 61 63 inline void div(double* __restrict a, double s) noexcept { FOR(i) a[i] /= s; } 64 inline void pow(double* __restrict dst, double const * __restrict src, double s) noexcept { FOR(i) dst[i] = hl_pow(src[i], s); } 62 65 63 66 // vector operations … … 68 71 inline void sin(double* __restrict a) noexcept { FOR(i) a[i] = hl_sin(a[i]); } 69 72 inline void cos(double* __restrict a) noexcept { FOR(i) a[i] = hl_cos(a[i]); } 70 inline void sqrt(double* __restrict a) noexcept { FOR(i) a[i] = hl_sqrt(a[i]); }71 73 inline void round(double* __restrict a) noexcept { FOR(i) a[i] = hl_round(a[i]); } 72 74 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.