forked from itsoulos/NNC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcprogram.h
More file actions
34 lines (33 loc) · 779 Bytes
/
Copy pathcprogram.h
File metadata and controls
34 lines (33 loc) · 779 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
# ifndef __CPROGRAM__H
# include <symbol.h>
# include <rule.h>
# include <fparser.hh>
class Cprogram
{
protected:
string vars;
FunctionParser parser;
int dimension;
vector<Rule*> rule;
Symbol Start, Expr, function, binaryop, terminal,
XXlist,DigitList, Digit0, Digit1, MinMax;
Symbol Sin, Cos, Exp, Log, Abs, Sqrt, Min, PI, Max;
Symbol Plus, Minus, Mult, Div, Pow;
Symbol Lpar, Rpar, Dot, Comma;
Symbol Tan, Int, Log10;
vector<Symbol> Digit;
vector<Symbol> XX;
int newRule();
void makeTerminals();
void makeNonTerminals();
void makeRules();
public:
Cprogram(int dim);
int Parse(string expr);
double Eval(const double *X);
int EvalError();
Symbol *getStartSymbol();
~Cprogram();
};
# define __CPROGRAM__H
# endif