-
Notifications
You must be signed in to change notification settings - Fork 0
Implemented QuART_tail, QuART_xtail, QuART_lil and refactored codebase #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 73 commits
2f00f32
d404ffd
cd19fc5
b320592
fc5f407
e490f08
6433596
9f69848
4dfc3c5
d11c8e3
14a5ee4
6ff0dda
fc3dd77
7c96a37
927970d
edadf8c
ba67fe1
084ebc1
76801fe
c41b6b9
9ef356f
05e2a03
a461d53
0a19160
30bae60
a7e8a17
a17bce0
35b975e
dae7175
ee4c3b2
525165b
6cbb87e
f3c1b8e
6b3e610
35d0bf4
d51b80b
c357ffc
ec7423f
2d69ed2
ad82186
3c3a980
17ba101
e17dcbf
beabfd1
833b7d5
377ef2d
4560549
efd6858
355862a
468b435
6927d92
2619c12
a57f860
907c694
abec9e0
41ff6ed
ff72ce0
2f86e36
4118d5a
166a544
94fbdd2
5355ab1
3fdefda
ec5664b
8d20767
057b65b
fdaf6f8
3721461
142fe2a
8f757de
c898c20
235bcf5
41d1f02
a37d164
44e0302
d11d12b
73aea79
c552603
ce27845
af62dde
21415c2
e98e787
6149680
5b077d9
0ab723b
eb5367a
50535d1
45350c3
31a3ccb
82a69fa
cc3018f
f905932
87a3b6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| **/*.csv | ||
| build/ | ||
| .DS_Store | ||
| .vscode | ||
| .vscode | ||
| results/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |
| #include <chrono> | ||
|
|
||
| #include "Helper.h" | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. get rid of this line. Make sure you are formatting the files using the clang-format file at the base directory in the repo
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll do the formatting on Thursday |
||
| #include <cassert> | ||
| #include <cstdio> | ||
| #include <fstream> | ||
|
|
@@ -27,7 +27,7 @@ | |
| #include <memory> | ||
| #include <stdexcept> | ||
|
|
||
| #include <vector> | ||
| #include <array> | ||
|
|
||
| namespace ART { | ||
| class ART; | ||
|
|
@@ -73,7 +73,16 @@ | |
|
|
||
| void insertNode4(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
| ArtNode* child); | ||
| void insertNode4Tail(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
|
cangokmen marked this conversation as resolved.
Outdated
|
||
| ArtNode* child, std::array<ArtNode*, maxPrefixLength>& temp_fp_path, | ||
| size_t& temp_fp_path_length, size_t depth_prev); | ||
| void insertNode4OnlyUpdateFp(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
| ArtNode* child); | ||
| void insertNode4AlwaysChangeFp(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
|
cangokmen marked this conversation as resolved.
|
||
| ArtNode* child, std::array<ArtNode*, maxPrefixLength>& temp_fp_path, | ||
| size_t& temp_fp_path_length, size_t depth_prev); | ||
| void eraseNode4(ART* tree, ArtNode** nodeRef, ArtNode** leafPlace); | ||
|
|
||
| }; | ||
|
|
||
| // Node with up to 16 children | ||
|
|
@@ -88,7 +97,16 @@ | |
|
|
||
| void insertNode16(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
| ArtNode* child); | ||
| void insertNode16Tail(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
|
cangokmen marked this conversation as resolved.
Outdated
|
||
| ArtNode* child, std::array<ArtNode*, maxPrefixLength>& temp_fp_path, | ||
| size_t& temp_fp_path_length, size_t depth_prev); | ||
| void insertNode16OnlyUpdateFp(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
| ArtNode* child); | ||
| void insertNode16AlwaysChangeFp(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
| ArtNode* child, std::array<ArtNode*, maxPrefixLength>& temp_fp_path, | ||
| size_t& temp_fp_path_length, size_t depth_prev); | ||
| void eraseNode16(ART* tree, ArtNode** nodeRef, ArtNode** leafPlace); | ||
|
|
||
| }; | ||
|
|
||
| // Node with up to 48 children | ||
|
|
@@ -103,7 +121,16 @@ | |
|
|
||
| void insertNode48(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
| ArtNode* child); | ||
| void insertNode48Tail(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
|
cangokmen marked this conversation as resolved.
Outdated
|
||
| ArtNode* child, std::array<ArtNode*, maxPrefixLength>& temp_fp_path, | ||
| size_t& temp_fp_path_length, size_t depth_prev); | ||
| void insertNode48OnlyUpdateFp(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
| ArtNode* child); | ||
| void insertNode48AlwaysChangeFp(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
| ArtNode* child, std::array<ArtNode*, maxPrefixLength>& temp_fp_path, | ||
| size_t& temp_fp_path_length, size_t depth_prev); | ||
| void eraseNode48(ART* tree, ArtNode** nodeRef, uint8_t keyByte); | ||
|
|
||
| }; | ||
|
|
||
| // Node with up to 256 children | ||
|
|
@@ -114,8 +141,16 @@ | |
|
|
||
| void insertNode256(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
| ArtNode* child); | ||
| void insertNode256Tail(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
|
cangokmen marked this conversation as resolved.
Outdated
|
||
| ArtNode* child, std::array<ArtNode*, maxPrefixLength>& temp_fp_path, | ||
| size_t& temp_fp_path_length, size_t depth_prev); | ||
| void insertNode256OnlyUpdateFp(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
| ArtNode* child); | ||
| void insertNode256AlwaysChangeFp(ART* tree, ArtNode** nodeRef, uint8_t keyByte, | ||
| ArtNode* child, std::array<ArtNode*, maxPrefixLength>& temp_fp_path, | ||
| size_t& temp_fp_path_length, size_t depth_prev); | ||
| void eraseNode256(ART* tree, ArtNode** nodeRef, uint8_t keyByte); | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove empty line
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll do the formatting on Thursday |
||
| }; | ||
|
|
||
| void copyPrefix(ArtNode* src, ArtNode* dst) { | ||
|
|
@@ -306,6 +341,7 @@ | |
| this->child[keyByte] = child; | ||
| } | ||
|
|
||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove extra empty line
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll do the formatting on Thursday
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove empty line.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll do the formatting on Thursday |
||
| void Node256::eraseNode256(ART* tree, ArtNode** nodeRef, uint8_t keyByte) { | ||
| // Delete leaf from inner node | ||
| this->child[keyByte] = NULL; | ||
|
|
@@ -362,8 +398,7 @@ | |
| } | ||
| } | ||
| throw; // Unreachable | ||
| } | ||
|
|
||
| } | ||
|
|
||
| ArtNode* minimum(ArtNode* node) { | ||
| // Find the leaf with smallest key | ||
|
|
@@ -481,5 +516,34 @@ | |
|
|
||
| return NULL; | ||
| } | ||
|
|
||
| void printFpPath(std::array<ArtNode*, maxPrefixLength> path, size_t path_length) { | ||
| // Print the fp path for debugging | ||
| for (size_t i = 0; i < path_length; i++) { | ||
| if (isLeaf(path[i])) { | ||
| printf("Leaf(%lu)\n", getLeafValue(path[i])); | ||
| } | ||
| else { | ||
| switch (path[i]->type) { | ||
| case NodeType4: | ||
| printf("Node4 %p\n", path[i]); | ||
| break; | ||
| case NodeType16: | ||
| printf("Node16 %p\n", path[i]); | ||
| break; | ||
| case NodeType48: | ||
| printf("Node48 %p\n", path[i]); | ||
| break; | ||
| case NodeType256: | ||
| printf("Node256 %p\n", path[i]); | ||
| break; | ||
| default: | ||
| printf("Unknown NodeType %p\n", path[i]); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.