Changeset 16274 for trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.h
- Timestamp:
- 11/04/18 11:05:31 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.h
r16269 r16274 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 … … 146 142 case OpCodes::Sub: 147 143 { 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); 144 if (in.narg == 1) 145 { 146 neg(in.buf, code[in.childIndex].buf); 147 break; 148 } 149 else 150 { 151 load(in.buf, code[in.childIndex].buf); 152 for (int j = 1; j < in.narg; ++j) 153 { 154 sub(in.buf, code[in.childIndex + j].buf); 155 } 156 156 } 157 157 break; … … 168 168 case OpCodes::Div: 169 169 { 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); 170 if (in.narg == 1) 171 { 172 inv(in.buf, code[in.childIndex].buf); 173 break; 174 } 175 else 176 { 177 load(in.buf, code[in.childIndex].buf); 178 for (int j = 1; j < in.narg; ++j) 179 { 180 div(in.buf, code[in.childIndex + j].buf); 181 } 178 182 } 179 183 break;
Note: See TracChangeset
for help on using the changeset viewer.