Changeset 17071 for stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.h
- Timestamp:
- 07/04/19 16:03:48 (5 years ago)
- Location:
- stable
- Files:
-
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk merged: 16266,16269,16274,16276-16277,16285-16287,16289,16293,16296-16298,16333-16334
- Property svn:mergeinfo changed
-
stable/HeuristicLab.ExtLibs
- Property svn:mergeinfo changed
/trunk/HeuristicLab.ExtLibs merged: 16266,16269,16274,16333-16334
- Property svn:mergeinfo changed
-
stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.h
r16269 r17071 2 2 #define NATIVE_TREE_INTERPRETER_CLANG_H 3 3 4 #include <cstring> 5 #include <vector> 6 #include <algorithm> 7 4 #include "vector_operations.h" 8 5 #include "instruction.h" 9 #include "vector_operations.h"10 6 11 7 inline double evaluate(instruction *code, int len, int row) noexcept … … 104 100 break; 105 101 } 102 case OpCodes::Square: 103 { 104 in.value = std::pow(code[in.childIndex].value, 2.); 105 break; 106 } 106 107 case OpCodes::Sqrt: 107 108 { … … 146 147 case OpCodes::Sub: 147 148 { 148 load(in.buf, code[in.childIndex].buf); 149 for (int j = 1; j < in.narg; ++j) 150 { 151 sub(in.buf, code[in.childIndex + j].buf); 152 } 153 if (in.narg == 1) 154 { 155 neg(in.buf); 149 if (in.narg == 1) 150 { 151 neg(in.buf, code[in.childIndex].buf); 152 break; 153 } 154 else 155 { 156 load(in.buf, code[in.childIndex].buf); 157 for (int j = 1; j < in.narg; ++j) 158 { 159 sub(in.buf, code[in.childIndex + j].buf); 160 } 156 161 } 157 162 break; … … 168 173 case OpCodes::Div: 169 174 { 170 load(in.buf, code[in.childIndex].buf); 171 for (int j = 1; j < in.narg; ++j) 172 { 173 div(in.buf, code[in.childIndex + j].buf); 174 } 175 if (in.narg == 1) 176 { 177 inv(in.buf); 175 if (in.narg == 1) 176 { 177 inv(in.buf, code[in.childIndex].buf); 178 break; 179 } 180 else 181 { 182 load(in.buf, code[in.childIndex].buf); 183 for (int j = 1; j < in.narg; ++j) 184 { 185 div(in.buf, code[in.childIndex + j].buf); 186 } 178 187 } 179 188 break; … … 219 228 { 220 229 square(in.buf, code[in.childIndex].buf); 230 break; 231 } 232 case OpCodes::Sqrt: 233 { 234 sqrt(in.buf, code[in.childIndex].buf); 221 235 break; 222 236 }
Note: See TracChangeset
for help on using the changeset viewer.