forked from FantasqueX/Computing_Graph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.h
More file actions
50 lines (49 loc) · 1022 Bytes
/
node.h
File metadata and controls
50 lines (49 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
#include <iostream>
#include <string>
#include <cmath>
const float NaN=0.0/0.0;
class Node
{
public:
std::string name;
virtual float geteval();
virtual void setvalue(float a);
float tempeval;
bool calculated=0;
bool printable=0;
virtual void reset();
};
class ZeroParentsNode:public Node
{
public:
float geteval();
int getParentsNum();
};
class OneParentsNode:public Node
{
public:
Node *p1;//parents
OneParentsNode(std::string a,Node* parent1);
virtual float func(float x);
float geteval();
int getParentsNum();
};
class TwoParentsNode:public Node
{
public:
Node *p1,*p2;//parents
virtual float func(float x,float y);
float geteval();
int getParentsNum();
TwoParentsNode(std::string a,Node* parent1,Node* parent2);
};
class ThreeParentsNode:public Node
{
public:
Node *p1,*p2,*p3;//parents
virtual float func(float x,float y,float z);
float geteval();
int getParentsNum();
ThreeParentsNode(std::string a,Node* parent1,Node* parent2,Node* parent3);
};