-
Notifications
You must be signed in to change notification settings - Fork 0
/
common_functions.h
executable file
·54 lines (48 loc) · 1.36 KB
/
common_functions.h
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
51
52
53
54
#ifndef COMFUN_H
#define COMFUN_H
//C Libraries
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
//P-GP2 Libraries
#include "common.h"
#include "debug.h"
#include "graph.h"
#include "graphStacks.h"
#include "parser.h"
#include "morphism.h"
typedef struct Function {
string name;
int arity;
double (*func)(double* inputs);
struct Function* next;
} Function;
typedef struct Function_Set {
int functionCount;
struct Function* first;
struct Function* last;
} Function_Set;
int get_max_arity(Function_Set* fset);
void print_fset(Function_Set* fsetV);
Function_Set* get_common_fset(string fsetV);
void add_function(Function_Set* fset, string name, int arity, double (*func)(double* inputs));
Function* get_function(Function_Set* fset, string name);
void freeFset(Function_Set* fset);
double common_and(double* inputs);
double common_or(double* inputs);
double common_nand(double* inputs);
double common_nor(double* inputs);
double common_xor(double* inputs);
double common_not(double* inputs);
double common_add(double* inputs);
double common_sub(double* inputs);
double common_div(double* inputs);
double common_mul(double* inputs);
double common_id(double* inputs);
double common_sin(double* inputs);
double common_log(double* inputs);
double common_cos(double* inputs);
double common_exp(double* inputs);
#endif