Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/instruction.h @ 16269

Last change on this file since 16269 was 16269, checked in by bburlacu, 5 years ago

#2958: Add C++ source code

File size: 692 bytes
Line 
1#ifndef INSTRUCTION_H
2#define INSTRUCTION_H
3
4#include <cstdint>
5
6#include "vector_operations.h"
7
8enum OpCodes : uint8_t
9{
10    // same values as in OpCodes.cs
11    Add = 1,
12    Sub = 2,
13    Mul = 3,
14    Div = 4,
15    Sin = 5,
16    Cos = 6,
17    Tan = 7,
18    Log = 8,
19    Exp = 9,
20    Var = 18,
21    Const = 20,
22    Power = 22,
23    Root = 23,
24    Square = 28,
25    Sqrt = 29
26};
27
28struct instruction
29{
30    // from Instruction.cs
31    uint8_t opcode;
32    uint16_t narg;
33
34    int childIndex;
35
36    // from LinearInstruction.cs
37    double value;
38    double weight; // necessary for variables
39
40    // pointer to data
41    double *buf;
42    double *data;
43};
44
45#endif
Note: See TracBrowser for help on using the repository browser.