-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnumCode.h
More file actions
80 lines (62 loc) · 2.4 KB
/
EnumCode.h
File metadata and controls
80 lines (62 loc) · 2.4 KB
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
#ifndef ENUMCODE_H
#define ENUMCODE_H
#include <iostream>
#include <memory.h>
#include <fstream>
#include <cstdlib>
#include <vector>
#include <gmp.h>
#define MAXBLOCKLEN 1024
using namespace std;
class EnumCode
{
public:
//Constructors
EnumCode ();
EnumCode (unsigned alphabetSize);
EnumCode (vector<unsigned int> alpVector);
EnumCode (vector<unsigned int> alpVector, vector<unsigned int> sequence);
~EnumCode ();
//Set function members
void SetAlphaSize (unsigned alphabetSize);
void SetVector (vector<unsigned int> alpVector);
void SetSequence (vector<unsigned int> sequence);
void SetAlphabet (unsigned char* alphabet);
//Get function members
unsigned int GetAlphaSize();
vector<unsigned int> GetVector ();
vector<unsigned int> GetSequence ();
unsigned int GetInnerSum ();
unsigned char* GetAlphabet ();
//functions
void Number_to_BinarySeq (unsigned number);
void Number_to_BinarySeq (mpz_t number);
unsigned BinarySeq_to_Number ();
unsigned BinarySeq_to_Number (mpz_t value);
int Index_to_Vector_ui (unsigned sum, unsigned counter, unsigned index);
int Index_to_Vector_ui (unsigned index);
int Index_to_Vector (unsigned sum, unsigned counter, mpz_t index);
int Index_to_Vector (mpz_t index);
unsigned Vector_to_Index ();
unsigned Vector_to_Index (mpz_t index);
unsigned PermIndex_to_Seq (mpz_t permID);
unsigned Seq_to_PermIndex ();
unsigned Seq_to_PermIndex (mpz_t permID);
unsigned Count_ParVectors (unsigned sum, unsigned counter);
unsigned Count_ParVectors (unsigned sum, unsigned counter, mpz_t value);
unsigned Number_to_BinaryIndex (unsigned num);
unsigned Number_to_BinaryIndex (unsigned num, mpz_t value);
unsigned BinaryIndex_to_Number (unsigned index, vector<unsigned int> vec);
void BinaryIndex_to_Number (unsigned index, vector<unsigned int> vec, mpz_t value);
void test();
private:
unsigned int alphabetSize;
vector<unsigned int> alpVector;
vector<unsigned int> sequence;
unsigned char* alphabet;
void Helper_Index_to_Vector (unsigned block_length, mpz_t index);
void Helper_PermIndex_to_Seq (mpz_t permID);
void Helper_Seq_to_PermIndex (mpz_t permID, unsigned vectorSize);
void NumberofPermutations (mpz_t value);
};
#endif // ENUMDNA_H