Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
3a53fa12
Commit
3a53fa12
authored
May 07, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
56d07b9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
wcfs/internal/xbtree.py
wcfs/internal/xbtree.py
+20
-5
No files found.
wcfs/internal/xbtree.py
View file @
3a53fa12
...
...
@@ -25,8 +25,18 @@ It is primarily used to verify ΔBTail in wcfs.
- `Tree` represents a tree node.
- `Bucket` represents a bucket node.
- `StrctureOf` returns internal structure of a BTree represented as Tree and
Bucket nodes.
- `Restructure` XXX
- GenStructs
Topology encoding
-----------------
XXX Typology:
- TopoEncode XXX
- TopoDecode
"""
from
__future__
import
print_function
,
absolute_import
...
...
@@ -72,7 +82,7 @@ class Tree:
#def __repr__(t):
# return 'R'+str(t)
# TODO def
dot
() -> str for graphviz
# TODO def
graphviz
() -> str for graphviz
# TODO def TopoEncode() -> str with topology encoding
# TODO @staticmethod def TopoDecode(in) <- Tree from topology string
...
...
@@ -98,7 +108,9 @@ class Bucket:
__repr__
=
__str__
# StructureOf returns internal structure of a tree.
# StructureOf returns internal structure of a BTree.
#
# The structure is represented as Tree and Bucket nodes.
def
StructureOf
(
node
):
typ
=
type
(
node
)
is_tree
=
(
"Tree"
in
typ
.
__name__
)
...
...
@@ -184,10 +196,13 @@ def AllStructs(keys, maxdepth, maxsplit): # -> i[] of Tree
def
_allStructs
(
klo
,
khi
,
keyv
,
maxdepth
,
maxsplit
):
assert
klo
<=
khi
# XXX assert keyv sorted, in [klo, khi)
_assertIncv
(
keyv
)
if
len
(
keyv
)
>
0
:
assert
klo
<=
keyv
[
0
]
assert
keyv
[
-
1
]
<
khi
print
(
'_allStructs [%s, %s) keyv: %r, maxdepth=%d, maxsplit=%d'
%
(
klo
,
khi
,
keyv
,
maxdepth
,
maxsplit
))
#
print('_allStructs [%s, %s) keyv: %r, maxdepth=%d, maxsplit=%d' %
#
(klo, khi, keyv, maxdepth, maxsplit))
for
nsplit
in
range
(
0
,
maxsplit
+
1
):
for
ksplitv
in
_iterSplitByN
(
klo
,
khi
,
nsplit
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment