Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Algorithms Library Toolkit Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Container Registry
Model registry
Monitor
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Algorithms Library Toolkit
Algorithms Library Toolkit Core
Commits
97fb9a6c
Unverified
Commit
97fb9a6c
authored
2 years ago
by
Tomáš Pecka
Browse files
Options
Downloads
Patches
Plain Diff
[nomerge] UTPMZ benchmarking preprocessor definition to change datastructure of ZAutomaton
parent
212d3576
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
alib2data/src/automaton/TA/ArcFactoredDeterministicZAutomaton.h
+20
-9
20 additions, 9 deletions
...ata/src/automaton/TA/ArcFactoredDeterministicZAutomaton.h
with
20 additions
and
9 deletions
alib2data/src/automaton/TA/ArcFactoredDeterministicZAutomaton.h
+
20
−
9
View file @
97fb9a6c
...
...
@@ -20,7 +20,12 @@
#include <ostream>
#ifndef UTPMZ
#include <alib/map>
#else
#include <alib/unordered_map>
#endif
#include <alib/set>
#include <alib/vector>
...
...
@@ -64,11 +69,17 @@ public:
typedef SymbolTypeT SymbolType;
typedef StateTypeT StateType;
#ifndef UTPMZ
using Transitions = ext::map < ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType >;
#else
using Transitions = ext::unordered_map < ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType >;
#endif
private:
/**
* Transition function as mapping from a list of states times an input symbol on the left hand side to a state.
*/
ext::map < ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType >
transitions;
Transitions
transitions;
public:
/**
...
...
@@ -278,7 +289,7 @@ public:
*
* \returns transition function of the automaton
*/
const
ext::map < ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType >
& getTransitions ( ) const & {
const
Transitions
& getTransitions ( ) const & {
return transitions;
}
...
...
@@ -287,19 +298,19 @@ public:
*
* \returns transition function of the automaton
*/
ext::map < ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType >
&& getTransitions ( ) && {
Transitions
&& getTransitions ( ) && {
return std::move ( transitions );
}
/**
* \returns transitions to state @p q
*/
ext::map < ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType >
getTransitionsToState ( const StateType & q ) const;
Transitions
getTransitionsToState ( const StateType & q ) const;
/**
* \returns transitions from state @p q
*/
ext::map < ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType >
getTransitionsFromState ( const StateType & q ) const;
Transitions
getTransitionsFromState ( const StateType & q ) const;
/**
* The three way comparison implementation
...
...
@@ -431,8 +442,8 @@ bool ArcFactoredDeterministicZAutomaton < SymbolType, StateType >::removeTransit
}
template<class SymbolType, class StateType >
ext::map < ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType >
ArcFactoredDeterministicZAutomaton < SymbolType, StateType >::getTransitionsToState ( const StateType & q ) const {
ext::map < ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType >
res;
typename ArcFactoredDeterministicZAutomaton < SymbolType, StateType >::Transitions
ArcFactoredDeterministicZAutomaton < SymbolType, StateType >::getTransitionsToState ( const StateType & q ) const {
Transitions
res;
for ( const auto & transition : getTransitions ( ) ) {
if ( transition.second == q )
...
...
@@ -443,8 +454,8 @@ ext::map < ext::variant < SymbolType, ext::pair < StateType, StateType > >, Stat
}
template<class SymbolType, class StateType >
ext::map < ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType >
ArcFactoredDeterministicZAutomaton < SymbolType, StateType >::getTransitionsFromState ( const StateType & q ) const {
ext::map < ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType >
res;
typename ArcFactoredDeterministicZAutomaton < SymbolType, StateType >::Transitions
ArcFactoredDeterministicZAutomaton < SymbolType, StateType >::getTransitionsFromState ( const StateType & q ) const {
Transitions
res;
for ( const auto & transition : getTransitions ( ) ) {
if ( transition.first.template is < ext::pair < StateType, StateType > > ( ) && transition.first.template get < ext::pair < StateType, StateType > > ( ).second == q )
...
...
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