/
BoolModel.h
119 lines (84 loc) · 3.03 KB
/
BoolModel.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// BoolModel.h
//
// This is the main header file for the project:
// Evolutionary Algorithm for Discrete Dynamical System Optimization
//
// contains global definitions and pulls in include files in a specific order
//
#ifndef _VBI_POLYMATH_BOOL_MODEL_H_
#define _VBI_POLYMATH_BOOL_MODEL_H_
// Include the basic stuff
#include <cstdlib>
#include <cmath>
typedef unsigned short USHORT;
typedef unsigned int ULONG;
// Standard Template Library Containers
// dynamically sized array, fast random access, no insertion/deletion
#include <vector>
// doubly linked list, fast insertion/deletion, no random access
#include <list>
// sorted set where key=data, no duplicates, lookup by value
#include <set>
// sorted set of key, value pairs
#include <map>
// arbitrary length binary string with boolean operators
#include <bitset>
// a character string
#include <string>
// include time functions for randomization, timing
#include <ctime>
// include stdlib algorithms including min, max
#include <algorithm>
// include support for console input / output
#include <iostream>
// include file input / output definitions
#include <fstream>
// using std::set;
// using std::bitset;
#define MAX_VARIABLES 8
#define MAX_TERMS 80
// typedef std::bitset<MAX_VARIABLES> TermType;
// typedef std::bitset<MAX_VARIABLES> TupleType;
typedef std::vector<unsigned short> UShortTable;
typedef std::vector<unsigned short>::iterator UShortTableIter;
typedef std::vector<ULONG> WordArray;
typedef std::vector<ULONG>::iterator WordArrayIter;
typedef std::vector<ULONG>::const_iterator WordArrayConstIter;
typedef std::vector<double> DoubleVector;
typedef DoubleVector::iterator DoubleVectorIter;
// A simple (possibly sparse) matrix of doubles
typedef std::vector<double> WeightMatrixRow;
typedef WeightMatrixRow::iterator WeightMatrixRowIter;
typedef std::vector<WeightMatrixRow> WeightMatrix;
typedef WeightMatrix::iterator WeightMatrixIter;
struct ComplexityQuotient
{
int p;
int q;
};
typedef std::vector<ComplexityQuotient> ComplexityMatrixEntry;
typedef ComplexityMatrixEntry::iterator ComplexityMatrixEntryIter;
typedef std::vector<ComplexityMatrixEntry> ComplexityMatrixRow;
typedef ComplexityMatrixRow::iterator ComplexityMatrixRowIter;
typedef std::vector<ComplexityMatrixRow> ComplexityMatrix;
typedef ComplexityMatrix::iterator ComplexityMatrixIter;
// A handy definition for the STL string type
typedef std::string String;
typedef std::vector<String> StringVector;
typedef StringVector::iterator StringVectorIter;
//Comment out the next line to eliminate debug file
//#define GA_DEBUG_FILE
#include "PolyMathRand.h"
#include "BitStringNew.h"
typedef BitString TermType;
typedef BitString TupleType;
#include "PolyMathRand.h"
#include "GAParams.h"
#include "NTuple.h"
#include "Monomial.h"
#include "Polynomial.h"
#include "DynSysModel.h"
#include "FileManager.h"
#include "GAModel.h"
//#include "BoolDynSysGA.h"
#endif //_VBI_POLYMATH_BOOL_MODEL_H_