Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fp-succinct-trees-1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Mehren
fp-succinct-trees-1
Commits
b82c8097
Verified
Commit
b82c8097
authored
7 years ago
by
Kevin Kaßelmann
Committed by
David Mehren
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Changed method signature
parent
b76c930f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/succinct_tree.rs
+1
-1
1 addition, 1 deletion
src/common/succinct_tree.rs
src/trees/bp_tree.rs
+4
-3
4 additions, 3 deletions
src/trees/bp_tree.rs
src/trees/louds_tree.rs
+4
-7
4 additions, 7 deletions
src/trees/louds_tree.rs
with
9 additions
and
11 deletions
src/common/succinct_tree.rs
+
1
−
1
View file @
b82c8097
...
...
@@ -10,7 +10,7 @@ pub trait SuccinctTree<T, Label>: Debug {
fn
first_child
(
&
self
,
index
:
u64
)
->
Result
<
u64
,
NodeError
>
;
fn
next_sibling
(
&
self
,
index
:
u64
)
->
Result
<
u64
,
NodeError
>
;
fn
from_id_tree
(
tree
:
Tree
<
i32
>
)
->
Result
<
T
,
EmptyTreeError
>
;
fn
child_label
(
&
self
,
index
:
u64
)
->
Result
<
Label
,
NodeError
>
;
fn
child_label
(
&
self
,
index
:
u64
)
->
Result
<
&
Label
,
NodeError
>
;
fn
labeled_child
(
&
self
,
index
:
u64
,
label
:
Label
)
->
Result
<
u64
,
NodeError
>
;
/// Prüft ob ein Bitvector ein gültiger SuccinctTree ist, anhand des gültigen Exzesses und
...
...
This diff is collapsed.
Click to expand it.
src/trees/bp_tree.rs
+
4
−
3
View file @
b82c8097
...
...
@@ -138,9 +138,9 @@ impl<L> SuccinctTree<BPTree<L>, L> for BPTree<L> {
/// # Arguments
/// * `index` The index of the node to get the label of
/// # Errors
/// * `No
tANode
Error` If `index` does not reference a node.
fn
child_label
(
&
self
,
index
:
u64
)
->
Result
<
L
,
NodeError
>
{
unimplemented!
();
/// * `No
Label
Error` If `index` does not reference a node
with a label
.
fn
child_label
(
&
self
,
index
:
u64
)
->
Result
<
&
L
,
NodeError
>
{
self
.labels
.get
(
index
as
usize
)
.ok_or
(
NodeError
::
NoLabelError
)
}
/// Returns the child from the specified node with that label
...
...
@@ -151,6 +151,7 @@ impl<L> SuccinctTree<BPTree<L>, L> for BPTree<L> {
/// * `NoSuchChildError` If there is no child which has this label
fn
labeled_child
(
&
self
,
index
:
u64
,
label
:
L
)
->
Result
<
u64
,
NodeError
>
{
unimplemented!
();
}
}
...
...
This diff is collapsed.
Click to expand it.
src/trees/louds_tree.rs
+
4
−
7
View file @
b82c8097
...
...
@@ -153,7 +153,7 @@ impl<L> SuccinctTree<LOUDSTree<L>, L> for LOUDSTree<L> {
/// * `index` The index of the node to get the label of
/// # Errors
/// * `NotANodeError` If `index` does not reference a node.
fn
child_label
(
&
self
,
index
:
u64
)
->
Result
<
L
,
NodeError
>
{
fn
child_label
(
&
self
,
index
:
u64
)
->
Result
<
&
L
,
NodeError
>
{
unimplemented!
();
}
...
...
@@ -250,7 +250,8 @@ mod tests {
let
tree
:
LOUDSTree
<
String
>
=
LOUDSTree
::
from_bitvec
(
bitvec
.clone
())
.unwrap
();
tree
.save_to
(
"testdata/loudstree.testdata"
.to_string
())
.unwrap
();
let
result
:
LOUDSTree
<
String
>
=
LOUDSTree
::
from_file
(
"testdata/loudstree.testdata"
.to_string
())
.unwrap
();
let
result
:
LOUDSTree
<
String
>
=
LOUDSTree
::
from_file
(
"testdata/loudstree.testdata"
.to_string
())
.unwrap
();
assert_eq!
(
tree
,
result
,
"The loaded tree is not equal to the original one."
...
...
@@ -388,7 +389,6 @@ mod tests {
assert_ne!
(
tree_a
,
tree_c
)
}
#[test]
fn
from_id_tree
()
{
let
mut
id_tree
:
Tree
<
i32
>
=
TreeBuilder
::
new
()
.with_node_capacity
(
5
)
.build
();
...
...
@@ -406,9 +406,6 @@ mod tests {
fn
from_empty_id_tree
()
{
let
id_tree
:
Tree
<
i32
>
=
TreeBuilder
::
new
()
.with_node_capacity
(
5
)
.build
();
let
tree
:
Result
<
LOUDSTree
<
String
>
,
EmptyTreeError
>
=
LOUDSTree
::
from_id_tree
(
id_tree
);
assert_eq!
(
tree
.unwrap_err
(),
EmptyTreeError
);
assert_eq!
(
tree
.unwrap_err
(),
EmptyTreeError
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment