Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Olena
pylene
Commits
b8d43e2b
Commit
b8d43e2b
authored
Feb 04, 2015
by
Edwin Carlinet
Browse files
Add the checktree routines for Morphological Tree Sanity Check.
* mln/morpho/datastruct/checktree.hpp: New.
parent
f7f14d76
Changes
1
Hide whitespace changes
Inline
Side-by-side
mln/morpho/datastruct/checktree.hpp
0 → 100644
View file @
b8d43e2b
#ifndef MLN_MORPHO_DATASTRUCT_CHECKTREE_HPP
# define MLN_MORPHO_DATASTRUCT_CHECKTREE_HPP
# include <mln/morpho/datastruct/component_tree.hpp>
namespace
mln
{
namespace
morpho
{
namespace
internal
{
template
<
class
Tree
>
void
checktree
(
const
Tree
&
tree
)
{
typename
Tree
::
node_type
prec
=
tree
.
nend
();
mln_foreach
(
auto
node
,
tree
.
nodes
())
{
mln_assertion
(
node
.
get_parent_id
()
==
prec
.
id
()
or
prec
.
get_next_sibling_id
()
==
node
.
id
());
mln_assertion
(
node
.
next_node
().
get_parent_id
()
==
node
.
id
()
or
node
.
get_next_node_id
()
==
node
.
get_next_sibling_id
());
mln_assertion
(
node
.
next_sibling
().
get_parent_id
()
==
node
.
get_parent_id
()
or
node
.
get_next_sibling_id
()
==
node
.
parent
().
get_next_sibling_id
());
prec
=
node
;
}
}
}
}
}
#endif // ! MLN_MORPHO_DATASTRUCT_CHECKTREE_HPP
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment