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
Spot
Spot
Commits
3a3e5d4b
Commit
3a3e5d4b
authored
Jun 07, 2009
by
Guillaume Sadegh
Browse files
* src/tgba/tgbacomplement.cc (state_complement::hash): Improve
the hash function.
parent
8fe11196
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
3a3e5d4b
2009-06-07 Guillaume Sadegh <sadegh@lrde.epita.fr>
* src/tgba/tgbacomplement.cc (state_complement::hash): Improve
the hash function.
2009-06-09 Damien Lefortier <dam@lrde.epita.fr>
* src/eltlparse/eltlparse.yy: Fix a memory leak.
...
...
src/tgba/tgbacomplement.cc
View file @
3a3e5d4b
...
...
@@ -106,6 +106,7 @@ namespace spot
const
safra_tree
&
operator
=
(
const
safra_tree
&
other
);
int
compare
(
const
safra_tree
*
other
)
const
;
size_t
hash
()
const
;
void
add_node
(
const
state
*
s
);
int
max_name
()
const
;
...
...
@@ -232,6 +233,24 @@ namespace spot
return
0
;
}
/// \brief Hash a safra tree.
size_t
safra_tree
::
hash
()
const
{
size_t
hash
=
0
;
hash
^=
wang32_hash
(
name
);
hash
^=
wang32_hash
(
marked
);
for
(
subset_t
::
const_iterator
i
=
nodes
.
begin
();
i
!=
nodes
.
end
();
++
i
)
hash
^=
(
*
i
)
->
hash
();
for
(
child_list
::
const_iterator
i
=
children
.
begin
();
i
!=
children
.
end
();
++
i
)
hash
^=
(
*
i
)
->
hash
();
return
hash
;
}
void
safra_tree
::
add_node
(
const
state
*
s
)
{
...
...
@@ -912,7 +931,17 @@ namespace spot
size_t
state_complement
::
hash
()
const
{
return
0
;
// \todo
size_t
hash
=
tree
->
hash
();
hash
^=
wang32_hash
(
use_bitset
);
size_t
size_bitset
=
L
.
size
();
for
(
unsigned
i
=
0
;
i
<
size_bitset
;
++
i
)
{
hash
^=
wang32_hash
(
L
[
i
]);
hash
^=
wang32_hash
(
U
[
i
]);
// \todo To not apply for TGBAs
}
return
hash
;
}
state_complement
*
...
...
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