Line | |
---|
1 | #ifndef INSTRUCTION_H
|
---|
2 | #define INSTRUCTION_H
|
---|
3 |
|
---|
4 | #include <cstdint>
|
---|
5 |
|
---|
6 | #include "vector_operations.h"
|
---|
7 |
|
---|
8 | enum 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 | Absolute = 48,
|
---|
27 | AnalyticalQuotient = 49,
|
---|
28 | Cube = 50,
|
---|
29 | CubeRoot = 51,
|
---|
30 | Tanh = 52
|
---|
31 | };
|
---|
32 |
|
---|
33 | struct instruction
|
---|
34 | {
|
---|
35 | // from Instruction.cs
|
---|
36 | uint8_t opcode;
|
---|
37 | uint16_t narg;
|
---|
38 |
|
---|
39 | int childIndex;
|
---|
40 |
|
---|
41 | // from LinearInstruction.cs
|
---|
42 | double value;
|
---|
43 | double weight; // necessary for variables
|
---|
44 |
|
---|
45 | // pointer to data
|
---|
46 | double *buf;
|
---|
47 | double *data;
|
---|
48 | };
|
---|
49 |
|
---|
50 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.