-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMpzList.h
49 lines (45 loc) · 1.18 KB
/
MpzList.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
/*
* =====================================================================================
*
* Filename: MpzList.h
*
* Description: Class for dynamic mpz_t lists.
*
* Version: 1.0
* Created: 11/02/2008 10:37:36 AM
* Revision: none
* Compiler: gcc
*
* Author: Bryce Allen (bda), [email protected]
* Company:
*
* =====================================================================================
*/
/*
typedef struct {
mpz_t value;
MpzTreeNode *left;
MpzTreeNode *right;
} MpzTreeNode;
*/
class MpzList {
private:
mpz_t *list;
//MpzTreeNode *root;
size_t size;
size_t mallocSize;
size_t mallocSizeIncrement;
size_t initCount;
public:
MpzList (size_t initialSize=5, size_t sizeIncrement=5);
~MpzList ();
size_t append (mpz_t value);
//size_t appendInt (int value);
//size_t appendUInt (unsigned int value);
void clear ();
size_t compactify ();
size_t getSize ();
size_t getInitCount ();
bool find (size_t *index, mpz_t value);
mpz_t &operator[] (const size_t index);
};