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
db628bed
Commit
db628bed
authored
May 06, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f954213c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
154 additions
and
10 deletions
+154
-10
wcfs/internal/xbtree.py
wcfs/internal/xbtree.py
+1
-1
wcfs/internal/xbtree_test.py
wcfs/internal/xbtree_test.py
+153
-9
No files found.
wcfs/internal/xbtree.py
View file @
db628bed
...
...
@@ -180,7 +180,7 @@ def _allStructs(klo, khi, keyv, maxdepth, maxsplit):
for
nsplit
in
range
(
0
,
maxsplit
+
1
):
for
ksplitv
in
_iterSplitByN
(
klo
,
khi
,
nsplit
):
# ksplitv = [klo, s1, s2, ..., sN, khi]
print
(
'ksplitv: %r'
%
ksplitv
)
#
print('ksplitv: %r' % ksplitv)
# emit Tree -> Buckets
children
=
[]
...
...
wcfs/internal/xbtree_test.py
View file @
db628bed
...
...
@@ -115,15 +115,159 @@ def test_AllStructs():
]
print
(
'
\
n
\
n
AAA
\
n
\
n
'
)
q
=
X
([
1
,
3
],
1
,
1
)
print
()
r
=
q
[
0
]
print
(
r
)
z
=
T
([],
B
(
1
,
3
))
print
(
z
)
print
(
r
==
z
)
print
()
1
/
0
assert
X
([
1
,
3
],
1
,
1
)
==
[
# nsplit=0, depth=0
T
([],
B
(
1
,
3
)),
# nsplit=0,0, depth=1
T
([],
T
([],
B
(
1
,
3
))),
# nsplit=0,1, depth=1
T
([],
T
([
0
],
B
(),
B
(
1
,
3
))),
T
([],
T
([
1
],
B
(),
B
(
1
,
3
))),
T
([],
T
([
2
],
B
(
1
),
B
(
3
))),
T
([],
T
([
3
],
B
(
1
),
B
(
3
))),
T
([],
T
([
4
],
B
(
1
,
3
),
B
())),
# nsplit=1, depth=0
T
([
0
],
B
(),
B
(
1
,
3
)),
T
([
0
],
# nsplit=1,(0,0)
T
([],
B
()),
T
([],
B
(
1
,
3
))),
# nsplit=1,(0,1)
T
([
0
],
# T0/
T
([],
B
()),
T
([
1
],
B
(),
B
(
1
,
3
))),
T
([
0
],
T
([],
B
()),
T
([
2
],
B
(
1
),
B
(
3
))),
T
([
1
],
B
(),
B
(
1
,
3
)),
T
([
2
],
B
(
1
),
B
(
3
)),
T
([
3
],
B
(
1
),
B
(
3
)),
T
([
4
],
B
(
1
,
3
),
B
()),
# nsplit=1,0 depth=1
#T([0],
# T([], B()),
# T([], B(1,3))),
T
([
1
],
T
([],
B
()),
T
([],
B
(
1
,
3
))),
T
([
2
],
T
([],
B
(
1
)),
T
([],
B
(
3
))),
T
([
3
],
T
([],
B
(
1
)),
T
([],
B
(
3
))),
T
([
4
],
T
([],
B
(
1
,
3
)),
T
([],
B
())),
# nsplit=1,(0|1,0|1) depth=1
#T([0], # T0/
# T([], B()),
# T([1], B(), B(1,3))),
#T([0],
# T([], B()),
# T([2], B(1), B(3))),
T
([
0
],
T
([],
B
()),
T
([
3
],
B
(
1
),
B
(
3
))),
T
([
0
],
T
([],
B
()),
T
([
4
],
B
(
1
,
3
),
B
())),
T
([
1
],
# T1/
T
([],
B
()),
# nsplit=1,(0,1)
T
([
2
],
B
(
1
),
B
(
3
))),
T
([
1
],
T
([],
B
()),
T
([
3
],
B
(
1
),
B
(
3
))),
T
([
1
],
T
([],
B
()),
T
([
4
],
B
(
1
,
3
),
B
())),
T
([
1
],
# nsplit=1,(1,0)
T
([
0
],
B
(),
B
()),
T
([],
B
(
1
,
3
))),
T
([
1
],
# nsplit=1,(1,1)
T
([
0
],
B
(),
B
()),
T
([
2
],
B
(
1
),
B
(
3
))),
T
([
1
],
T
([
0
],
B
(),
B
()),
T
([
3
],
B
(
1
),
B
(
3
))),
T
([
1
],
T
([
0
],
B
(),
B
()),
T
([
4
],
B
(
1
,
3
),
B
())),
T
([
2
],
# T2/
T
([],
B
(
1
)),
# nsplit=1,(0,1)
T
([
3
],
B
(),
B
(
3
))),
T
([
2
],
T
([],
B
(
1
)),
T
([
4
],
B
(
3
),
B
())),
T
([
2
],
# nsplit=1,(1,0)
T
([
0
],
B
(),
B
(
1
)),
T
([],
B
(
3
))),
T
([
2
],
T
([
1
],
B
(),
B
(
1
)),
T
([],
B
(
3
))),
T
([
2
],
# nsplit=1,(1,1)
T
([
0
],
B
(),
B
(
1
)),
T
([
3
],
B
(),
B
(
3
))),
T
([
2
],
T
([
0
],
B
(),
B
(
1
)),
T
([
4
],
B
(
3
),
B
())),
T
([
2
],
T
([
1
],
B
(),
B
(
1
)),
T
([
3
],
B
(),
B
(
3
))),
T
([
2
],
T
([
1
],
B
(),
B
(
1
)),
T
([
4
],
B
(
3
),
B
())),
T
([
3
],
# T3/
T
([],
B
(
1
)),
# nsplit=1,(0,1)
T
([
4
],
B
(
3
),
B
())),
T
([
3
],
# nsplit=1,(1,0)
T
([
0
],
B
(),
B
(
1
)),
T
([],
B
(
3
))),
T
([
3
],
T
([
1
],
B
(),
B
(
1
)),
T
([],
B
(
3
))),
T
([
3
],
T
([
2
],
B
(
1
),
B
()),
T
([],
B
(
3
))),
T
([
3
],
# nsplit=1,(1,1)
T
([
0
],
B
(),
B
(
1
)),
T
([
4
],
B
(
3
),
B
())),
T
([
3
],
T
([
1
],
B
(),
B
(
1
)),
T
([
4
],
B
(
3
),
B
())),
T
([
3
],
T
([
2
],
B
(
1
),
B
()),
T
([
4
],
B
(
3
),
B
())),
T
([
4
],
# T4/
T
([
0
],
B
(),
B
(
1
,
3
)),
T
([],
B
())),
T
([
4
],
T
([
1
],
B
(),
B
(
1
,
3
)),
T
([],
B
())),
T
([
4
],
T
([
2
],
B
(
1
),
B
(
3
)),
T
([],
B
())),
T
([
4
],
T
([
3
],
B
(
1
),
B
(
3
)),
T
([],
B
())),
]
return
print
(
'
\
n
\
n
BBB
\
n
\
n
'
)
assert
X
([
1
,
3
],
1
,
1
)
==
[
# nsplit=0, depth=0
T
([],
B
(
1
,
3
)),
...
...
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