Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Dissiml
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guyslain Naves
Dissiml
Commits
5ed687b3
"README.md" did not exist on "03221c3fccbd4f68ce6a4ae0b441f137b87f97e5"
Commit
5ed687b3
authored
1 year ago
by
Guyslain Naves
Browse files
Options
Downloads
Patches
Plain Diff
debug chain insertion
parent
4c4b42e4
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
lib/pqtrees/pqChainInsertion.ml
+5
-3
5 additions, 3 deletions
lib/pqtrees/pqChainInsertion.ml
test/unit/chainInsertionTest.ml
+21
-15
21 additions, 15 deletions
test/unit/chainInsertionTest.ml
test/unit/robinsonByChainTest.ml
+2
-2
2 additions, 2 deletions
test/unit/robinsonByChainTest.ml
with
28 additions
and
20 deletions
lib/pqtrees/pqChainInsertion.ml
+
5
−
3
View file @
5ed687b3
...
...
@@ -68,6 +68,7 @@ module Make =
let
q_node
subtrees
=
match
DeQueue
.
to_list
subtrees
with
|
[
single
]
->
single
|
[
_1
;
_2
]
as
children
->
P
children
|
children
->
Q
children
...
...
@@ -201,7 +202,7 @@ module Make =
|
Some
_
->
q_node
subtrees
|
None
->
assert
false
let
co
mpact
(
Central
(
left_bound
,_,
right_bound
)
as
tree
)
=
let
co
nsolidate
(
Central
(
left_bound
,_,
right_bound
)
as
tree
)
=
Central
(
left_bound
,
DeQueue
.
singleton
(
central_tree
tree
)
,
right_bound
)
let
reverse
(
Central
(
left_bound
,
subtrees
,
right_bound
))
=
...
...
@@ -232,8 +233,9 @@ module Make =
let
push
bound_left
bound_right
central
group
=
let
d_min
=
group_d_min
group
and
d_max
=
group_d_max
group
in
let
central
=
if
d_min
>=
max
(
left_bound_of
central
)
(
right_bound_of
central
)
then
compact
central
if
d_min
>=
max
(
left_bound_of
central
)
(
right_bound_of
central
)
&&
Bound
.
is_bounded
d_min
bound_left
&&
Bound
.
is_bounded
d_min
bound_right
then
consolidate
central
else
central
in
...
...
This diff is collapsed.
Click to expand it.
test/unit/chainInsertionTest.ml
+
21
−
15
View file @
5ed687b3
...
...
@@ -113,14 +113,24 @@ let interval_distance elements i =
let
ptree1
=
P
[
Leaf
0
;
Leaf
1
;
P
[
Leaf
2
;
Leaf
3
;
Leaf
4
;
P
[
P
[
P
[
Leaf
5
;
Leaf
6
];
Leaf
7
];
Leaf
8
;
P
[
Leaf
9
;
Leaf
10
];
Leaf
11
];
P
[
Leaf
12
;
Leaf
13
]];
Leaf
14
;
Leaf
15
;
Leaf
16
;
Leaf
17
;
P
[
P
[
Leaf
18
;
Leaf
19
];
Leaf
20
;
Leaf
21
];
Leaf
22
P
[
P
[
P
[
Leaf
5
;
Leaf
6
];
Leaf
7
];
Leaf
8
;
P
[
Leaf
9
;
Leaf
10
];
Leaf
11
];
P
[
Leaf
12
;
Leaf
13
]];
Leaf
14
;
Leaf
15
;
Leaf
16
;
Leaf
17
;
P
[
P
[
Leaf
18
;
Leaf
19
];
Leaf
20
;
Leaf
21
];
Leaf
22
]
let
%
expect_test
_
=
refine_by_distances
10
(
interval_distance
[
10
;
12
])
ptree1
|>
output
;
[
%
expect
{
|
|
}]
|>
output
;
[
%
expect
{
|
P
[
Leaf
0
;
Leaf
1
;
P
[
Leaf
2
;
Leaf
3
;
Leaf
4
;
Q
[
P
[
P
[
P
[
Leaf
5
;
Leaf
6
];
Leaf
7
];
Leaf
8
;
Leaf
11
];
Leaf
9
;
Leaf
10
;
Leaf
12
;
Leaf
13
]];
Leaf
14
;
Leaf
15
;
Leaf
16
;
Leaf
17
;
P
[
P
[
Leaf
18
;
Leaf
19
];
Leaf
20
;
Leaf
21
];
Leaf
22
]
|
}]
let
ptree2
=
...
...
@@ -130,7 +140,10 @@ let ptree2 =
let
%
expect_test
_
=
refine_by_distances
10
(
interval_distance
[
10
;
12
])
ptree2
|>
output
;
[
%
expect
{
|
|
}]
|>
output
;
[
%
expect
{
|
P
[
Leaf
2
;
Leaf
3
;
Leaf
4
;
Q
[
P
[
P
[
P
[
Leaf
5
;
Leaf
6
];
Leaf
7
];
Leaf
8
;
Leaf
11
];
Leaf
9
;
Leaf
10
;
Leaf
12
;
Leaf
13
]]
|
}]
let
ptree3
=
...
...
@@ -141,18 +154,11 @@ let ptree3 =
let
%
expect_test
_
=
refine_by_distances
10
(
interval_distance
[
10
;
12
])
ptree3
|>
output
;
[
%
expect
{
|
|
}]
|>
output
;
[
%
expect
{
|
P
[
Leaf
2
;
Q
[
Leaf
7
;
Leaf
9
;
Leaf
10
;
Leaf
12
;
Leaf
13
]]
|
}]
let
ptree4
=
P
[
Leaf
7
;
P
[
Leaf
8
;
Leaf
9
;
Leaf
10
];
Leaf
11
]
let
%
expect_test
_
=
refine_by_distances
10
(
interval_distance
[
10
;
12
])
ptree4
|>
output
;
[
%
expect
{
|
|
}]
let
ptree5
=
P
[
Leaf
8
;
Leaf
9
;
Leaf
10
]
let
%
expect_test
_
=
refine_by_distances
10
(
interval_distance
[
10
;
12
])
ptree5
|>
output
;
[
%
expect
{
|
|
}]
refine_by_distances
10
(
interval_distance
[
8
;
10
])
ptree4
|>
output
;
[
%
expect
{
|
P
[
Leaf
7
;
P
[
P
[
Leaf
8
;
Leaf
10
];
Leaf
9
];
Leaf
11
]
|
}]
This diff is collapsed.
Click to expand it.
test/unit/robinsonByChainTest.ml
+
2
−
2
View file @
5ed687b3
...
...
@@ -26,7 +26,7 @@ let%expect_test _ =
|
Some
order
->
print_order
order
|
None
->
Format
.(
fprintf
std_formatter
"not Robinson"
)
end
;
[
%
expect
{
|
9
,
8
,
7
,
6
,
5
,
4
,
3
,
2
,
1
,
0
|
}]
[
%
expect
{
|
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
|
}]
let
diss2
=
RandomDissimilarity
.
Toeplitz
.
toeplitz012
~
k
:
3
~
n
:
20
...
...
@@ -36,4 +36,4 @@ let%expect_test _ =
|
Some
order
->
print_order
order
|
None
->
Format
.(
fprintf
std_formatter
"not Robinson"
)
end
;
[
%
expect
{
|
19
,
1
8
,
17
,
16
,
15
,
14
,
13
,
12
,
11
,
10
,
9
,
8
,
7
,
6
,
5
,
4
,
3
,
2
,
1
,
0
|
}]
[
%
expect
{
|
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
1
5
,
16
,
17
,
18
,
19
|
}]
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