From 8e681f2c78e6059fb8140ee8f5b9509c7f029c19 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Wed, 9 Aug 2017 12:40:01 +0200 Subject: [PATCH] move map to ext namespace --- aarbology2/src/aarbology.cpp | 2 +- acompare2/src/AutomatonCompare.h | 12 +- acompare2/src/GrammarCompare.cpp | 10 +- acompare2/src/GrammarCompare.h | 2 +- aconvert2/src/DotConverter.h | 206 +++++++++--------- aconvert2/src/GasTexConverter.cpp | 2 +- aconvert2/src/GasTexConverter.h | 36 +-- aconvert2/src/TikZConverter.h | 206 +++++++++--------- .../src/arbology/exact/BoyerMooreHorspool.h | 6 +- ...ZoneUsingBadCharacterShiftAndBorderArray.h | 12 +- .../src/arbology/exact/ExactPatternMatch.h | 10 +- .../exact/ReversedBoyerMooreHorspool.h | 12 +- .../CompressedBitParallelIndexConstruction.h | 4 +- .../query/CompressedBitParallelismPatterns.h | 4 +- .../NonlinearFullAndLinearIndexPatterns.h | 4 +- .../src/automaton/convert/ToGrammarLeftRG.cpp | 4 +- .../automaton/convert/ToGrammarRightRG.cpp | 4 +- .../determinize/DeterminizeNFTAPart.cxx | 2 +- .../determinize/DeterminizeRHDPDAPart.cxx | 14 +- .../determinize/DeterminizeVPAPart.cxx | 6 +- .../determinize/common/RHDPDACommon.cpp | 12 +- .../determinize/common/RHDPDACommon.h | 4 +- .../generate/RandomAutomatonFactory.cpp | 2 +- .../automaton/generate/RandomizeAutomaton.h | 8 +- .../properties/AllEpsilonClosure.cpp | 16 +- .../automaton/properties/AllEpsilonClosure.h | 44 ++-- .../src/automaton/properties/EpsilonClosure.h | 6 +- .../simplify/EpsilonRemoverIncoming.h | 2 +- alib2algo/src/automaton/simplify/Minimize.h | 30 +-- alib2algo/src/automaton/simplify/Normalize.h | 8 +- alib2algo/src/automaton/simplify/Rename.cpp | 22 +- .../simplify/UnreachableStatesRemover.h | 2 +- .../automaton/simplify/UselessStatesRemover.h | 2 +- .../src/automaton/transform/Compaction.h | 2 +- .../src/automaton/transform/RHPDAToPDA.cpp | 10 +- alib2algo/src/common/Permutation.hpp | 4 +- .../src/equations/RegularEquationSolver.h | 6 +- alib2algo/src/grammar/convert/ToAutomaton.cpp | 4 +- .../src/grammar/convert/ToAutomatonBottomUp.h | 2 +- .../src/grammar/generate/GenerateUpToLength.h | 2 +- .../src/grammar/generate/RandomizeGrammar.h | 10 +- alib2algo/src/grammar/simplify/Rename.cpp | 4 +- alib2algo/src/grammar/simplify/ToCNF.cpp | 6 +- alib2algo/src/grammar/simplify/ToGNF.h | 2 +- .../regexp/convert/ToAutomatonDerivation.cpp | 2 +- .../convert/ToGrammarRightRGDerivation.cpp | 2 +- .../ToPostfixPushdownAutomatonGlushkov.cpp | 2 +- alib2algo/src/rte/glushkov/GlushkovFollow.h | 40 ++-- .../properties/BadCharacterShiftTable.cpp | 4 +- .../properties/BadCharacterShiftTable.h | 10 +- .../ReversedBadCharacterShiftTable.cpp | 4 +- .../ReversedBadCharacterShiftTable.h | 10 +- .../src/string/simplify/NormalizeAlphabet.h | 2 +- alib2algo/src/stringology/exact/BoyerMoore.h | 2 +- .../stringology/exact/BoyerMooreHorspool.h | 2 +- .../exact/DeadZoneUsingBadCharacterShift.h | 8 +- .../exact/ReversedBoyerMooreHorspool.h | 2 +- .../indexing/BitParallelIndexConstruction.h | 2 +- .../CompressedBitParallelIndexConstruction.h | 2 +- .../indexing/ExactFactorOracleAutomaton.cpp | 4 +- .../indexing/ExactFactorOracleAutomaton.h | 2 +- .../indexing/ExactSubsequenceAutomaton.h | 2 +- .../indexing/ExactSuffixAutomaton.cpp | 4 +- .../indexing/ExactSuffixAutomaton.h | 2 +- .../matching/BNDMMatcherConstruction.h | 2 +- .../matching/WideBNDMMatcherConstruction.h | 2 +- .../stringology/properties/BackboneLength.h | 2 +- .../src/stringology/query/BNDMOccurrences.h | 2 +- .../stringology/query/BitParallelismFactors.h | 2 +- .../query/CompressedBitParallelismFactors.h | 2 +- .../stringology/query/WideBNDMOccurrences.h | 2 +- alib2algo/src/tree/NormalizeTreeLabels.h | 6 +- .../src/tree/generate/RandomTreeFactory.cpp | 14 +- .../properties/BadCharacterShiftTable.cpp | 6 +- .../tree/properties/BadCharacterShiftTable.h | 14 +- .../src/tree/properties/ExactSubtreeRepeats.h | 2 +- .../properties/ExactSubtreeRepeatsNaive.h | 24 +- .../ReversedBadCharacterShiftTable.cpp | 10 +- .../ReversedBadCharacterShiftTable.h | 24 +- .../properties/EpsilonClosureTest.cpp | 2 +- .../grammar/parsing/AbsorbTerminalSymbol.cpp | 4 +- .../grammar/parsing/AbsorbTerminalSymbol.h | 2 +- .../parsing/DeterministicLL1Grammar.cpp | 2 +- .../parsing/DeterministicLL1ParseTable.cpp | 4 +- .../parsing/DeterministicLL1ParseTable.h | 2 +- .../src/grammar/parsing/First.cpp | 18 +- .../src/grammar/parsing/First.h | 6 +- .../src/grammar/parsing/Follow.cpp | 10 +- .../src/grammar/parsing/Follow.h | 4 +- .../src/grammar/parsing/LL1ParseTable.cpp | 30 +-- .../src/grammar/parsing/LL1ParseTable.h | 6 +- .../src/grammar/parsing/LR0Parser.cpp | 4 +- .../src/grammar/parsing/SLR1ParseTable.cpp | 10 +- .../test-src/grammar/parsing/FirstTest.cpp | 12 +- .../test-src/grammar/parsing/FollowTest.cpp | 8 +- .../grammar/parsing/LL1ParseTable.cpp | 4 +- alib2cli/src/environment/Environment.h | 4 +- .../src/abstraction/AlgorithmRegistry.hpp | 8 +- alib2common/src/abstraction/CastRegistry.hpp | 4 +- .../src/abstraction/DowncastRegistry.hpp | 4 +- .../src/abstraction/ImmediateRegistry.hpp | 4 +- .../src/abstraction/NormalizeRegistry.hpp | 4 +- .../src/abstraction/ValuePrinterRegistry.hpp | 4 +- .../src/abstraction/XmlFileWriterRegistry.hpp | 4 +- .../src/abstraction/XmlParserRegistry.hpp | 4 +- alib2common/src/allocator/StealthTypes.hpp | 2 +- alib2common/src/container/ObjectsMap.h | 42 ++-- alib2common/src/container/ObjectsTrie.h | 16 +- alib2common/src/core/castApi.hpp | 14 +- alib2common/src/core/multipleDispatch.hpp | 6 +- alib2common/src/core/namingApi.hpp | 4 +- alib2common/src/core/xmlApi.hpp | 24 +- alib2common/src/debug/simpleStacktrace.cpp | 4 +- alib2common/src/introspection/Algorithms.hpp | 12 +- alib2common/src/introspection/Casts.hpp | 12 +- alib2common/src/introspection/DataTypes.hpp | 6 +- .../test-src/container/ContainerTest.cpp | 4 +- .../measurements/MeasurementsTest.cpp | 2 +- alib2data/src/automaton/FSM/CompactNFA.h | 18 +- alib2data/src/automaton/FSM/DFA.h | 20 +- alib2data/src/automaton/FSM/EpsilonNFA.h | 54 ++--- alib2data/src/automaton/FSM/ExtendedNFA.h | 18 +- .../src/automaton/FSM/MultiInitialStateNFA.h | 18 +- alib2data/src/automaton/FSM/NFA.h | 18 +- alib2data/src/automaton/PDA/DPDA.h | 18 +- alib2data/src/automaton/PDA/InputDrivenDPDA.h | 28 +-- alib2data/src/automaton/PDA/InputDrivenNPDA.h | 28 +-- alib2data/src/automaton/PDA/NPDA.h | 6 +- alib2data/src/automaton/PDA/NPDTA.h | 12 +- .../PDA/RealTimeHeightDeterministicDPDA.h | 18 +- .../PDA/RealTimeHeightDeterministicNPDA.h | 18 +- alib2data/src/automaton/PDA/SinglePopDPDA.h | 6 +- alib2data/src/automaton/PDA/SinglePopNPDA.h | 6 +- .../src/automaton/PDA/VisiblyPushdownDPDA.h | 18 +- .../src/automaton/PDA/VisiblyPushdownNPDA.h | 18 +- alib2data/src/automaton/TA/DFTA.h | 4 +- alib2data/src/automaton/TA/NFTA.h | 4 +- alib2data/src/automaton/TM/OneTapeDTM.h | 6 +- .../automaton/common/AutomatonFromXMLParser.h | 6 +- .../automaton/common/AutomatonToXMLComposer.h | 4 +- alib2data/src/grammar/ContextFree/CFG.h | 10 +- alib2data/src/grammar/ContextFree/CNF.h | 12 +- .../src/grammar/ContextFree/EpsilonFreeCFG.h | 12 +- alib2data/src/grammar/ContextFree/GNF.h | 12 +- alib2data/src/grammar/ContextFree/LG.h | 12 +- alib2data/src/grammar/ContextSensitive/CSG.h | 6 +- .../ContextSensitive/NonContractingGrammar.h | 6 +- alib2data/src/grammar/Regular/LeftLG.h | 12 +- alib2data/src/grammar/Regular/LeftRG.h | 12 +- alib2data/src/grammar/Regular/RightLG.h | 12 +- alib2data/src/grammar/Regular/RightRG.h | 12 +- .../ContextPreservingUnrestrictedGrammar.h | 6 +- .../Unrestricted/UnrestrictedGrammar.h | 6 +- .../arbology/CompressedBitParallelTreeIndex.h | 18 +- .../src/indexes/common/IndexesNormalize.h | 2 +- .../src/indexes/stringology/BNDMMatcher.h | 18 +- .../indexes/stringology/BitParallelIndex.h | 18 +- .../stringology/CompressedBitParallelIndex.h | 18 +- alib2data/test-src/string/StringTest.cpp | 2 +- .../src/grammar/parsing/LRParserTypes.h | 6 +- .../src/indexes/common/IndexFromXMLParser.cpp | 2 +- .../SuffixTrieNodeTerminatingSymbol.cpp | 14 +- .../SuffixTrieNodeTerminatingSymbol.h | 8 +- .../efficient/AllEpsilonClosure.cpp | 16 +- .../properties/efficient/AllEpsilonClosure.h | 50 ++--- .../properties/efficient/ReachableStates.h | 6 +- .../properties/efficient/UsefullStates.h | 4 +- .../efficient/EpsilonRemoverIncoming.h | 4 +- .../efficient/EpsilonRemoverOutgoing.h | 4 +- .../src/processor/MeasurementProcessor.cpp | 2 +- .../processor/MeasurementProcessorFilter.hpp | 2 +- .../MeasurementProvisionerInputData.cpp | 4 +- .../MeasurementProvisionerInputData.hpp | 4 +- alib2std/src/extensions/map.hpp | 74 +++++-- alib2std/src/extensions/trie.hpp | 29 +-- alib2std/test-src/extensions/CompareTest.cpp | 6 +- alib2std/test-src/extensions/MapTest.cpp | 4 +- alib2std/test-src/extensions/TrieTest.cpp | 8 +- alib2std/test-src/extensions/VariantTest.cpp | 2 +- .../src/automaton/AutomatonToStringComposer.h | 16 +- .../src/grammar/GrammarFromStringParser.cpp | 18 +- .../src/grammar/GrammarFromStringParser.h | 6 +- astringology2/src/astringology.cpp | 2 +- 183 files changed, 1089 insertions(+), 1060 deletions(-) diff --git a/aarbology2/src/aarbology.cpp b/aarbology2/src/aarbology.cpp index de2e08452e..5ff33174f8 100644 --- a/aarbology2/src/aarbology.cpp +++ b/aarbology2/src/aarbology.cpp @@ -331,7 +331,7 @@ int main ( int argc, char * argv[] ) { measurements::end ( ); measurements::start ( "Algorithm", measurements::Type::MAIN ); - std::map < common::ranked_symbol < DefaultSymbolType, DefaultRankType >, size_t > bcs = tree::properties::BadCharacterShiftTable::bcs ( pattern ); + ext::map < common::ranked_symbol < DefaultSymbolType, DefaultRankType >, size_t > bcs = tree::properties::BadCharacterShiftTable::bcs ( pattern ); measurements::end ( ); measurements::start ( "Output write", measurements::Type::AUXILIARY ); diff --git a/acompare2/src/AutomatonCompare.h b/acompare2/src/AutomatonCompare.h index e831a272a0..fdbff99472 100644 --- a/acompare2/src/AutomatonCompare.h +++ b/acompare2/src/AutomatonCompare.h @@ -140,7 +140,7 @@ private: template <class T> static void setCompare(const ext::set<T> &a, const ext::set<T> &b); template <class T> static void listCompare(const std::list<T> &a, const std::list<T> &b); - template <class T, class R> static void mapCompare(const std::map<T, R> &a, const std::map<T, R> &b); + template <class T, class R> static void mapCompare(const ext::map<T, R> &a, const ext::map<T, R> &b); public: template<class T> static int compare(const T & a, const T & b); @@ -385,18 +385,18 @@ template <class T> void AutomatonCompare::listCompare(const std::list<T> &a, con } } -template <class T, class R> void AutomatonCompare::mapCompare(const std::map<T, R> &a, const std::map<T, R> &b) { - std::map<T, R> aMinusB; +template <class T, class R> void AutomatonCompare::mapCompare(const ext::map<T, R> &a, const ext::map<T, R> &b) { + ext::map<T, R> aMinusB; std::set_difference(a.begin(), a.end(), b.begin(), b.end(), std::inserter(aMinusB, aMinusB.begin())); - std::map<T, R> bMinusA; + ext::map<T, R> bMinusA; std::set_difference(b.begin(), b.end(), a.begin(), a.end(), std::inserter(bMinusA, bMinusA.begin())); - for(typename std::map<T, R>::const_iterator iter = aMinusB.begin(); iter != aMinusB.end(); iter++) { + for(typename ext::map<T, R>::const_iterator iter = aMinusB.begin(); iter != aMinusB.end(); iter++) { std::cout << "< " << iter->first << ", " << iter->second << std::endl; } std::cout << "---" << std::endl; - for(typename std::map<T, R>::const_iterator iter = bMinusA.begin(); iter != bMinusA.end(); iter++) { + for(typename ext::map<T, R>::const_iterator iter = bMinusA.begin(); iter != bMinusA.end(); iter++) { std::cout << "> " << iter->first << ", " << iter->second << std::endl; } } diff --git a/acompare2/src/GrammarCompare.cpp b/acompare2/src/GrammarCompare.cpp index 5fc9afcc31..23038a8e04 100644 --- a/acompare2/src/GrammarCompare.cpp +++ b/acompare2/src/GrammarCompare.cpp @@ -154,18 +154,18 @@ template <class T> void GrammarCompare::listCompare(const std::list<T> &a, const } } -template <class T, class R> void GrammarCompare::mapCompare(const std::map<T, R> &a, const std::map<T, R> &b) { - std::map<T, R> aMinusB; +template <class T, class R> void GrammarCompare::mapCompare(const ext::map<T, R> &a, const ext::map<T, R> &b) { + ext::map<T, R> aMinusB; std::set_difference(a.begin(), a.end(), b.begin(), b.end(), std::inserter(aMinusB, aMinusB.begin())); - std::map<T, R> bMinusA; + ext::map<T, R> bMinusA; std::set_difference(b.begin(), b.end(), a.begin(), a.end(), std::inserter(bMinusA, bMinusA.begin())); - for(typename std::map<T, R>::const_iterator iter = aMinusB.begin(); iter != aMinusB.end(); iter++) { + for(typename ext::map<T, R>::const_iterator iter = aMinusB.begin(); iter != aMinusB.end(); iter++) { std::cout << "< " << iter->first << ", " << iter->second << std::endl; } std::cout << "---" << std::endl; - for(typename std::map<T, R>::const_iterator iter = bMinusA.begin(); iter != bMinusA.end(); iter++) { + for(typename ext::map<T, R>::const_iterator iter = bMinusA.begin(); iter != bMinusA.end(); iter++) { std::cout << "> " << iter->first << ", " << iter->second << std::endl; } } diff --git a/acompare2/src/GrammarCompare.h b/acompare2/src/GrammarCompare.h index 03d0bdafd0..8307e683fd 100644 --- a/acompare2/src/GrammarCompare.h +++ b/acompare2/src/GrammarCompare.h @@ -61,7 +61,7 @@ private: template <class T> static void setCompare(const ext::set<T> &a, const ext::set<T> &b); template <class T> static void listCompare(const std::list<T> &a, const std::list<T> &b); - template <class T, class R> static void mapCompare(const std::map<T, R> &a, const std::map<T, R> &b); + template <class T, class R> static void mapCompare(const ext::map<T, R> &a, const ext::map<T, R> &b); public: template < class T > static int compare(const T & a, const T & b); diff --git a/aconvert2/src/DotConverter.h b/aconvert2/src/DotConverter.h index 302ea4b6ff..abaa5e1935 100644 --- a/aconvert2/src/DotConverter.h +++ b/aconvert2/src/DotConverter.h @@ -50,61 +50,61 @@ class DotConverter : public alib::SingleDispatchFirstStaticParam<DotConverter, void, std::ostream&, const automaton::AutomatonBase &> { template < class SymbolType, class StateType > - static void transitions(const automaton::DFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::DFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class StateType > - static void transitions(const automaton::NFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::NFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class StateType > - static void transitions(const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class EpsilonType, class StateType > - static void transitions(const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class StateType > - static void transitions(const automaton::ExtendedNFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::ExtendedNFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class StateType > - static void transitions(const automaton::CompactNFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::CompactNFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class RankType, class StateType > - static void transitions(const automaton::NFTA < SymbolType, RankType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::NFTA < SymbolType, RankType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class RankType, class StateType > - static void transitions(const automaton::DFTA < SymbolType, RankType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::DFTA < SymbolType, RankType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class StateType > - static void transitions(const automaton::OneTapeDTM < SymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::OneTapeDTM < SymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); public: static void convert(std::ostream& out, const automaton::Automaton& a); @@ -173,7 +173,7 @@ void DotConverter::convert(std::ostream& out, const automaton::EpsilonNFA < Symb int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -205,7 +205,7 @@ void DotConverter::convert(std::ostream& out, const automaton::MultiInitialState int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -239,7 +239,7 @@ void DotConverter::convert(std::ostream& out, const automaton::NFA < SymbolType, int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -271,7 +271,7 @@ void DotConverter::convert(std::ostream& out, const automaton::DFA < SymbolType, int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -303,7 +303,7 @@ void DotConverter::convert(std::ostream& out, const automaton::ExtendedNFA < Sym int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -335,7 +335,7 @@ void DotConverter::convert(std::ostream& out, const automaton::CompactNFA < Symb int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -367,7 +367,7 @@ void DotConverter::convert(std::ostream& out, const automaton::NFTA < SymbolType int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -395,7 +395,7 @@ void DotConverter::convert(std::ostream& out, const automaton::DFTA < SymbolType int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -423,7 +423,7 @@ void DotConverter::convert(std::ostream& out, const automaton::DPDA < InputSymbo int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -455,7 +455,7 @@ void DotConverter::convert(std::ostream& out, const automaton::SinglePopDPDA < I int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -487,7 +487,7 @@ void DotConverter::convert(std::ostream& out, const automaton::InputDrivenDPDA < int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -519,7 +519,7 @@ void DotConverter::convert(std::ostream& out, const automaton::InputDrivenNPDA < int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -551,7 +551,7 @@ void DotConverter::convert(std::ostream& out, const automaton::VisiblyPushdownDP int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -583,7 +583,7 @@ void DotConverter::convert(std::ostream& out, const automaton::VisiblyPushdownNP int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -617,7 +617,7 @@ void DotConverter::convert(std::ostream& out, const automaton::RealTimeHeightDet int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -649,7 +649,7 @@ void DotConverter::convert(std::ostream& out, const automaton::RealTimeHeightDet int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -683,7 +683,7 @@ void DotConverter::convert(std::ostream& out, const automaton::NPDA < InputSymbo int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -715,7 +715,7 @@ void DotConverter::convert(std::ostream& out, const automaton::SinglePopNPDA < I int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -747,7 +747,7 @@ void DotConverter::convert(std::ostream& out, const automaton::OneTapeDTM < Symb int cnt = 1; //Map states to indices - std::map<StateType, int> states; + ext::map<StateType, int> states; for (const StateType& state : a.getStates()) { states.insert(std::make_pair(state, cnt++)); } @@ -773,8 +773,8 @@ void DotConverter::convert(std::ostream& out, const automaton::OneTapeDTM < Symb } template < class SymbolType, class EpsilonType, class StateType > -void DotConverter::transitions(const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; //put transitions from automaton to "transitions" for (const auto& transition : fsm.getTransitions()) { @@ -787,7 +787,7 @@ void DotConverter::transitions(const automaton::EpsilonNFA < SymbolType, Epsilon for(const StateType& to : transition.second) { std::pair<int, int> key(states.find(transition.first.first)->second, states.find(to)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -813,8 +813,8 @@ void DotConverter::transitions(const automaton::EpsilonNFA < SymbolType, Epsilon } template < class SymbolType, class StateType > -void DotConverter::transitions(const automaton::MultiInitialStateNFA < SymbolType, StateType >& fsm, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::MultiInitialStateNFA < SymbolType, StateType >& fsm, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; //put transitions from automaton to "transitions" for (const auto& transition : fsm.getTransitions()) { @@ -822,7 +822,7 @@ void DotConverter::transitions(const automaton::MultiInitialStateNFA < SymbolTyp for(const StateType& to : transition.second) { std::pair<int, int> key(states.find(transition.first.first)->second, states.find(to)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -848,8 +848,8 @@ void DotConverter::transitions(const automaton::MultiInitialStateNFA < SymbolTyp } template < class SymbolType, class StateType > -void DotConverter::transitions(const automaton::NFA < SymbolType, StateType > & fsm, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::NFA < SymbolType, StateType > & fsm, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; //put transitions from automaton to "transitions" for (const auto& transition : fsm.getTransitions()) { @@ -857,7 +857,7 @@ void DotConverter::transitions(const automaton::NFA < SymbolType, StateType > & for(const StateType& to : transition.second) { std::pair<int, int> key(states.find(transition.first.first)->second, states.find(to)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -883,15 +883,15 @@ void DotConverter::transitions(const automaton::NFA < SymbolType, StateType > & } template < class SymbolType, class StateType > -void DotConverter::transitions(const automaton::DFA < SymbolType, StateType > & fsm, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::DFA < SymbolType, StateType > & fsm, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; //put transitions from automaton to "transitions" for (const auto& transition : fsm.getTransitions()) { std::string symbol = replace ( alib::StringDataFactory::toString ( transition.first.second ), "\"", "\\\"" ); std::pair<int, int> key(states.find(transition.first.first)->second, states.find(transition.second)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -916,8 +916,8 @@ void DotConverter::transitions(const automaton::DFA < SymbolType, StateType > & } template < class SymbolType, class StateType > -void DotConverter::transitions(const automaton::ExtendedNFA < SymbolType, StateType > & fsm, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::ExtendedNFA < SymbolType, StateType > & fsm, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; //put transitions from automaton to "transitions" for (const auto& transition : fsm.getTransitions()) { @@ -925,7 +925,7 @@ void DotConverter::transitions(const automaton::ExtendedNFA < SymbolType, StateT for(const StateType& to : transition.second) { std::pair<int, int> key(states.find(transition.first.first)->second, states.find(to)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -951,8 +951,8 @@ void DotConverter::transitions(const automaton::ExtendedNFA < SymbolType, StateT } template < class SymbolType, class StateType > -void DotConverter::transitions(const automaton::CompactNFA < SymbolType, StateType > & fsm, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::CompactNFA < SymbolType, StateType > & fsm, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; //put transitions from automaton to "transitions" for (const auto& transition : fsm.getTransitions()) { @@ -960,7 +960,7 @@ void DotConverter::transitions(const automaton::CompactNFA < SymbolType, StateTy for(const StateType& to : transition.second) { std::pair<int, int> key(states.find(transition.first.first)->second, states.find(to)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -986,8 +986,8 @@ void DotConverter::transitions(const automaton::CompactNFA < SymbolType, StateTy } template < class SymbolType, class RankType, class StateType > -void DotConverter::transitions(const automaton::NFTA < SymbolType, RankType, StateType > & fta, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, ext::vector<int>>, std::string> transitions; +void DotConverter::transitions(const automaton::NFTA < SymbolType, RankType, StateType > & fta, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, ext::vector<int>>, std::string> transitions; //put transitions from automaton to "transitions" for (const auto& transition : fta.getTransitions()) { @@ -999,7 +999,7 @@ void DotConverter::transitions(const automaton::NFTA < SymbolType, RankType, Sta for(const StateType& state : transition.first.second) { key.second.push_back(states.find(state)->second); } - std::map<std::pair<int, ext::vector<int>>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, ext::vector<int>>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -1038,8 +1038,8 @@ void DotConverter::transitions(const automaton::NFTA < SymbolType, RankType, Sta } template < class SymbolType, class RankType, class StateType > -void DotConverter::transitions(const automaton::DFTA < SymbolType, RankType, StateType > & fta, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, ext::vector<int>>, std::string> transitions; +void DotConverter::transitions(const automaton::DFTA < SymbolType, RankType, StateType > & fta, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, ext::vector<int>>, std::string> transitions; //put transitions from automaton to "transitions" for (const auto& transition : fta.getTransitions()) { @@ -1050,7 +1050,7 @@ void DotConverter::transitions(const automaton::DFTA < SymbolType, RankType, Sta for(const StateType& state : transition.first.second) { key.second.push_back(states.find(state)->second); } - std::map<std::pair<int, ext::vector<int>>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, ext::vector<int>>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -1088,8 +1088,8 @@ void DotConverter::transitions(const automaton::DFTA < SymbolType, RankType, Sta } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -void DotConverter::transitions(const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; for (const auto& transition : pda.getTransitions()) { std::string symbol; @@ -1127,7 +1127,7 @@ void DotConverter::transitions(const automaton::DPDA < InputSymbolType, EpsilonT //Insert into map std::pair<int, int> key(states.find(std::get<0>(transition.first))->second, states.find(transition.second.first)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -1152,8 +1152,8 @@ void DotConverter::transitions(const automaton::DPDA < InputSymbolType, EpsilonT } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -void DotConverter::transitions(const automaton::SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; for (const auto& transition : pda.getTransitions()) { std::string symbol; @@ -1184,7 +1184,7 @@ void DotConverter::transitions(const automaton::SinglePopDPDA < InputSymbolType, //Insert into map std::pair<int, int> key(states.find(std::get<0>(transition.first))->second, states.find(transition.second.first)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -1209,8 +1209,8 @@ void DotConverter::transitions(const automaton::SinglePopDPDA < InputSymbolType, } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -void DotConverter::transitions(const automaton::InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; const auto& symbolToPDSOperation = pda.getPushdownStoreOperations(); for (const auto& transition : pda.getTransitions()) { @@ -1249,7 +1249,7 @@ void DotConverter::transitions(const automaton::InputDrivenDPDA < InputSymbolTyp //Insert into map std::pair<int, int> key(states.find(transition.first.first)->second, states.find(to)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -1274,8 +1274,8 @@ void DotConverter::transitions(const automaton::InputDrivenDPDA < InputSymbolTyp } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -void DotConverter::transitions(const automaton::InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; const auto& symbolToPDSOperation = pda.getPushdownStoreOperations(); for (const auto& transition : pda.getTransitions()) { @@ -1316,7 +1316,7 @@ void DotConverter::transitions(const automaton::InputDrivenNPDA < InputSymbolTyp //Insert into map std::pair<int, int> key(states.find(transition.first.first)->second, states.find(to)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol2)); @@ -1342,8 +1342,8 @@ void DotConverter::transitions(const automaton::InputDrivenNPDA < InputSymbolTyp } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -void DotConverter::transitions(const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; for (const auto& transition : pda.getCallTransitions()) { std::string symbol; @@ -1361,7 +1361,7 @@ void DotConverter::transitions(const automaton::VisiblyPushdownDPDA < InputSymbo //Insert into map std::pair<int, int> key(states.find(transition.first.first)->second, states.find(transition.second.first)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -1393,7 +1393,7 @@ void DotConverter::transitions(const automaton::VisiblyPushdownDPDA < InputSymbo //Insert into map std::pair<int, int> key(states.find(std::get<0>(transition.first))->second, states.find(transition.second)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -1425,7 +1425,7 @@ void DotConverter::transitions(const automaton::VisiblyPushdownDPDA < InputSymbo //Insert into map std::pair<int, int> key(states.find(transition.first.first)->second, states.find(transition.second)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -1450,8 +1450,8 @@ void DotConverter::transitions(const automaton::VisiblyPushdownDPDA < InputSymbo } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -void DotConverter::transitions(const automaton::VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; for (const auto& transition : pda.getCallTransitions()) { std::string symbol; @@ -1472,7 +1472,7 @@ void DotConverter::transitions(const automaton::VisiblyPushdownNPDA < InputSymbo //Insert into map std::pair<int, int> key(states.find(transition.first.first)->second, states.find(to.first)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol2)); @@ -1508,7 +1508,7 @@ void DotConverter::transitions(const automaton::VisiblyPushdownNPDA < InputSymbo //Insert into map std::pair<int, int> key(states.find(std::get<0>(transition.first))->second, states.find(to)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol2)); @@ -1544,7 +1544,7 @@ void DotConverter::transitions(const automaton::VisiblyPushdownNPDA < InputSymbo //Insert into map std::pair<int, int> key(states.find(transition.first.first)->second, states.find(to)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol2)); @@ -1570,8 +1570,8 @@ void DotConverter::transitions(const automaton::VisiblyPushdownNPDA < InputSymbo } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -void DotConverter::transitions(const automaton::RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; for (const auto& transition : pda.getCallTransitions()) { std::string symbol; @@ -1592,7 +1592,7 @@ void DotConverter::transitions(const automaton::RealTimeHeightDeterministicDPDA //Insert into map std::pair<int, int> key(states.find(transition.first.first)->second, states.find(transition.second.first)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -1627,7 +1627,7 @@ void DotConverter::transitions(const automaton::RealTimeHeightDeterministicDPDA //Insert into map std::pair<int, int> key(states.find(std::get<0>(transition.first))->second, states.find(transition.second)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -1662,7 +1662,7 @@ void DotConverter::transitions(const automaton::RealTimeHeightDeterministicDPDA //Insert into map std::pair<int, int> key(states.find(transition.first.first)->second, states.find(transition.second)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); @@ -1687,8 +1687,8 @@ void DotConverter::transitions(const automaton::RealTimeHeightDeterministicDPDA } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -void DotConverter::transitions(const automaton::RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; for (const auto& transition : pda.getCallTransitions()) { std::string symbol; @@ -1712,7 +1712,7 @@ void DotConverter::transitions(const automaton::RealTimeHeightDeterministicNPDA //Insert into map std::pair<int, int> key(states.find(transition.first.first)->second, states.find(to.first)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol2)); @@ -1751,7 +1751,7 @@ void DotConverter::transitions(const automaton::RealTimeHeightDeterministicNPDA //Insert into map std::pair<int, int> key(states.find(std::get<0>(transition.first))->second, states.find(to)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol2)); @@ -1790,7 +1790,7 @@ void DotConverter::transitions(const automaton::RealTimeHeightDeterministicNPDA //Insert into map std::pair<int, int> key(states.find(transition.first.first)->second, states.find(to)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol2)); @@ -1816,8 +1816,8 @@ void DotConverter::transitions(const automaton::RealTimeHeightDeterministicNPDA } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -void DotConverter::transitions(const automaton::NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; for (const auto& transition : pda.getTransitions()) { std::string symbol; @@ -1858,7 +1858,7 @@ void DotConverter::transitions(const automaton::NPDA < InputSymbolType, EpsilonT //Insert into map std::pair<int, int> key(states.find(std::get<0>(transition.first))->second, states.find(to.first)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol2)); @@ -1884,8 +1884,8 @@ void DotConverter::transitions(const automaton::NPDA < InputSymbolType, EpsilonT } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -void DotConverter::transitions(const automaton::SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map<StateType, int>& states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map<StateType, int>& states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; for (const auto& transition : pda.getTransitions()) { std::string symbol; @@ -1919,7 +1919,7 @@ void DotConverter::transitions(const automaton::SinglePopNPDA < InputSymbolType, //Insert into map std::pair<int, int> key(states.find(std::get<0>(transition.first))->second, states.find(to.first)->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol2)); @@ -1945,8 +1945,8 @@ void DotConverter::transitions(const automaton::SinglePopNPDA < InputSymbolType, } template < class SymbolType, class StateType > -void DotConverter::transitions(const automaton::OneTapeDTM < SymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream& out) { - std::map<std::pair<int, int>, std::string> transitions; +void DotConverter::transitions(const automaton::OneTapeDTM < SymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream& out) { + ext::map<std::pair<int, int>, std::string> transitions; for (const auto& transition : tm.getTransitions()) { std::string symbol; @@ -1972,7 +1972,7 @@ void DotConverter::transitions(const automaton::OneTapeDTM < SymbolType, StateTy //Insert into map std::pair<int, int> key(states.find(transition.first.first)->second, states.find(std::get<0>(transition.second))->second); - std::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); + ext::map<std::pair<int, int>, std::string>::iterator mapit = transitions.find(key); if (mapit == transitions.end()) { transitions.insert(std::make_pair(key, symbol)); diff --git a/aconvert2/src/GasTexConverter.cpp b/aconvert2/src/GasTexConverter.cpp index 7c19576782..b03fda176c 100644 --- a/aconvert2/src/GasTexConverter.cpp +++ b/aconvert2/src/GasTexConverter.cpp @@ -8,7 +8,7 @@ #include "GasTexConverter.h" #include <registration/AlgoRegistration.hpp> -void GasTexConverter::printTransitionMap(const std::map<std::pair<std::string, std::string>, std::string> transitionMap, std::ostream& out) { +void GasTexConverter::printTransitionMap(const ext::map<std::pair<std::string, std::string>, std::string> transitionMap, std::ostream& out) { for (const auto& transition : transitionMap) { std::string from = transition.first.first; std::string to = transition.first.second; diff --git a/aconvert2/src/GasTexConverter.h b/aconvert2/src/GasTexConverter.h index 442cb33f00..f2774fef5a 100644 --- a/aconvert2/src/GasTexConverter.h +++ b/aconvert2/src/GasTexConverter.h @@ -48,7 +48,7 @@ #include "common/converterCommon.hpp" class GasTexConverter : public alib::SingleDispatchFirstStaticParam<GasTexConverter, void, std::ostream&, const automaton::AutomatonBase &> { - static void printTransitionMap( const std::map<std::pair<std::string, std::string>, std::string> transitionMap, std::ostream& out); + static void printTransitionMap( const ext::map<std::pair<std::string, std::string>, std::string> transitionMap, std::ostream& out); template < class SymbolType > static std::string getStackSymbols(const ext::vector<SymbolType>& stackSymbols); @@ -879,7 +879,7 @@ std::string GasTexConverter::getStackSymbols(const ext::vector<SymbolType>& stac template<class SymbolType, class EpsilonType, class StateType> void GasTexConverter::transitions(const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : fsm.getTransitions()) { for(const auto& to : transition.second) { std::pair<std::string, std::string> key(replace ( alib::StringDataFactory::toString ( transition.first.first ), "\"", "\\\"" ), replace ( alib::StringDataFactory::toString ( to ), "\"", "\\\"" ) ); @@ -904,7 +904,7 @@ void GasTexConverter::transitions(const automaton::EpsilonNFA < SymbolType, Epsi template<class SymbolType, class StateType> void GasTexConverter::transitions(const automaton::MultiInitialStateNFA < SymbolType, StateType >& fsm, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : fsm.getTransitions()) { for(const auto& to : transition.second) { std::pair<std::string, std::string> key(replace ( alib::StringDataFactory::toString ( transition.first.first ), "\"", "\\\"" ), replace ( alib::StringDataFactory::toString ( to ), "\"", "\\\"" ) ); @@ -924,7 +924,7 @@ void GasTexConverter::transitions(const automaton::MultiInitialStateNFA < Symbol template<class SymbolType, class StateType> void GasTexConverter::transitions(const automaton::NFA < SymbolType, StateType > & fsm, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : fsm.getTransitions()) { for(const auto& to : transition.second) { std::pair<std::string, std::string> key( replace ( alib::StringDataFactory::toString ( transition.first.first ), "\"", "\\\"" ), replace ( alib::StringDataFactory::toString ( to ), "\"", "\\\"" ) ); @@ -944,7 +944,7 @@ void GasTexConverter::transitions(const automaton::NFA < SymbolType, StateType > template<class SymbolType, class StateType> void GasTexConverter::transitions(const automaton::DFA < SymbolType, StateType > & fsm, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : fsm.getTransitions()) { std::pair<std::string, std::string> key( replace ( alib::StringDataFactory::toString ( transition.first.first ), "\"", "\\\"" ), replace ( alib::StringDataFactory::toString ( transition.second ), "\"", "\\\"" ) ); @@ -962,7 +962,7 @@ void GasTexConverter::transitions(const automaton::DFA < SymbolType, StateType > template<class SymbolType, class StateType> void GasTexConverter::transitions(const automaton::ExtendedNFA < SymbolType, StateType > & fsm, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : fsm.getTransitions()) { for(const auto& to : transition.second) { @@ -983,7 +983,7 @@ void GasTexConverter::transitions(const automaton::ExtendedNFA < SymbolType, Sta template<class SymbolType, class StateType> void GasTexConverter::transitions(const automaton::CompactNFA < SymbolType, StateType > & fsm, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : fsm.getTransitions()) { for(const auto& to : transition.second) { @@ -1014,7 +1014,7 @@ void GasTexConverter::transitions(const automaton::DFTA < SymbolType, RankType, template<class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType> void GasTexConverter::transitions(const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : pda.getTransitions()) { std::pair<std::string, std::string> key(replace ( alib::StringDataFactory::toString ( std::get<0>(transition.first ) ), "\"", "\\\"" ), replace ( alib::StringDataFactory::toString ( transition.second.first ), "\"", "\\\"" ) ); @@ -1045,7 +1045,7 @@ void GasTexConverter::transitions(const automaton::DPDA < InputSymbolType, Epsil template<class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType> void GasTexConverter::transitions(const automaton::SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : pda.getTransitions()) { std::pair<std::string, std::string> key(replace ( alib::StringDataFactory::toString ( std::get<0>(transition.first ) ), "\"", "\\\"" ), replace ( alib::StringDataFactory::toString ( transition.second.first ), "\"", "\\\"" ) ); @@ -1076,7 +1076,7 @@ void GasTexConverter::transitions(const automaton::SinglePopDPDA < InputSymbolTy template<class SymbolType, class PushdownStoreSymbolType, class StateType> void GasTexConverter::transitions(const automaton::InputDrivenDPDA < SymbolType, PushdownStoreSymbolType, StateType > & pda, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; const auto& symbolToPDSOperation = pda.getPushdownStoreOperations(); for (const auto& transition : pda.getTransitions()) { @@ -1107,7 +1107,7 @@ void GasTexConverter::transitions(const automaton::InputDrivenDPDA < SymbolType, template<class InputSymbolType, class PushdownStoreSymbolType, class StateType> void GasTexConverter::transitions(const automaton::InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; const auto& symbolToPDSOperation = pda.getPushdownStoreOperations(); for (const auto& transition : pda.getTransitions()) { @@ -1139,7 +1139,7 @@ void GasTexConverter::transitions(const automaton::InputDrivenNPDA < InputSymbol template<class InputSymbolType, class PushdownStoreSymbolType, class StateType> void GasTexConverter::transitions(const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : pda.getCallTransitions()) { std::pair<std::string, std::string> key( replace ( alib::StringDataFactory::toString ( transition.first.first ), "\"", "\\\"" ), replace ( alib::StringDataFactory::toString ( transition.second.first ), "\"", "\\\"" ) ); @@ -1203,7 +1203,7 @@ void GasTexConverter::transitions(const automaton::VisiblyPushdownDPDA < InputSy template<class InputSymbolType, class PushdownStoreSymbolType, class StateType> void GasTexConverter::transitions(const automaton::VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : pda.getCallTransitions()) { for(const auto& to : transition.second) { @@ -1273,7 +1273,7 @@ void GasTexConverter::transitions(const automaton::VisiblyPushdownNPDA < InputSy template<class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType> void GasTexConverter::transitions(const automaton::RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : pda.getCallTransitions()) { std::pair<std::string, std::string> key( replace ( alib::StringDataFactory::toString ( transition.first.first ), "\"", "\\\"" ), replace ( alib::StringDataFactory::toString ( transition.second.first ), "\"", "\\\"" ) ); @@ -1349,7 +1349,7 @@ void GasTexConverter::transitions(const automaton::RealTimeHeightDeterministicDP template<class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType> void GasTexConverter::transitions(const automaton::RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : pda.getCallTransitions()) { for(const auto& to : transition.second) { @@ -1431,7 +1431,7 @@ void GasTexConverter::transitions(const automaton::RealTimeHeightDeterministicNP template<class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType> void GasTexConverter::transitions(const automaton::NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : pda.getTransitions()) { for(const auto& to : transition.second) { @@ -1464,7 +1464,7 @@ void GasTexConverter::transitions(const automaton::NPDA < InputSymbolType, Epsil template<class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType> void GasTexConverter::transitions(const automaton::SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (const auto& transition : pda.getTransitions()) { for(const auto& to : transition.second) { @@ -1497,7 +1497,7 @@ void GasTexConverter::transitions(const automaton::SinglePopNPDA < InputSymbolTy template<class SymbolType, class StateType> void GasTexConverter::transitions(const automaton::OneTapeDTM < SymbolType, StateType > & tm, std::ostream& out) { - std::map<std::pair<std::string, std::string>, std::string> transitionMap; + ext::map<std::pair<std::string, std::string>, std::string> transitionMap; for (auto& transition : tm.getTransitions()) { std::pair<std::string, std::string> key( replace ( alib::StringDataFactory::toString ( transition.first.first ), "\"", "\\\"" ), replace ( alib::StringDataFactory::toString ( std::get<0>(transition.second )), "\"", "\\\"" )); diff --git a/aconvert2/src/TikZConverter.h b/aconvert2/src/TikZConverter.h index c73b0b798a..867235d95e 100644 --- a/aconvert2/src/TikZConverter.h +++ b/aconvert2/src/TikZConverter.h @@ -50,61 +50,61 @@ class TikZConverter : public alib::SingleDispatchFirstStaticParam < TikZConverter, void, std::ostream &, const automaton::AutomatonBase & > { template < class SymbolType, class StateType > - static void transitions(const automaton::DFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::DFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class StateType > - static void transitions(const automaton::NFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::NFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class StateType > - static void transitions(const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class EpsilonType, class StateType > - static void transitions(const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class StateType > - static void transitions(const automaton::ExtendedNFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::ExtendedNFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class StateType > - static void transitions(const automaton::CompactNFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::CompactNFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class RankType, class StateType > - static void transitions(const automaton::NFTA < SymbolType, RankType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::NFTA < SymbolType, RankType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class RankType, class StateType > - static void transitions(const automaton::DFTA < SymbolType, RankType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::DFTA < SymbolType, RankType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > - static void transitions(const automaton::RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); template < class SymbolType, class StateType > - static void transitions(const automaton::OneTapeDTM < SymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out); + static void transitions(const automaton::OneTapeDTM < SymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out); public: static void convert ( std::ostream & out, const automaton::Automaton & a ); @@ -172,7 +172,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::EpsilonNFA < int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -200,7 +200,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::MultiInitialS int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -228,7 +228,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::NFA < SymbolT int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -256,7 +256,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::DFA < SymbolT int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -284,7 +284,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::ExtendedNFA < int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -312,7 +312,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::CompactNFA < int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -340,7 +340,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::NFTA < Symbol int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -365,7 +365,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::DFTA < Symbol int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -390,7 +390,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::DPDA < InputS int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -418,7 +418,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::SinglePopDPDA int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -446,7 +446,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::InputDrivenDP int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -474,7 +474,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::InputDrivenNP int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -502,7 +502,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::VisiblyPushdo int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -530,7 +530,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::VisiblyPushdo int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -558,7 +558,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::RealTimeHeigh int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -586,7 +586,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::RealTimeHeigh int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -614,7 +614,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::NPDA < InputS int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -642,7 +642,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::SinglePopNPDA int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -670,7 +670,7 @@ void TikZConverter::convert ( std::ostream & out, const automaton::OneTapeDTM < int cnt = 1; // Map states to indices - std::map < StateType, int > states; + ext::map < StateType, int > states; for ( const StateType & state : a.getStates ( ) ) states.insert ( std::make_pair ( state, cnt++ ) ); @@ -693,8 +693,8 @@ void TikZConverter::convert ( std::ostream & out, const automaton::OneTapeDTM < } template<class SymbolType, class EpsilonType, class StateType> -void TikZConverter::transitions ( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; // put transitions from automaton to "transitions" for ( const auto & transition : fsm.getTransitions ( ) ) { @@ -707,7 +707,7 @@ void TikZConverter::transitions ( const automaton::EpsilonNFA < SymbolType, Epsi for ( const StateType & to : transition.second ) { std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( to )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -741,8 +741,8 @@ void TikZConverter::transitions ( const automaton::EpsilonNFA < SymbolType, Epsi } template<class SymbolType, class StateType> -void TikZConverter::transitions ( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; // put transitions from automaton to "transitions" for ( const auto & transition : fsm.getTransitions ( ) ) { @@ -750,7 +750,7 @@ void TikZConverter::transitions ( const automaton::MultiInitialStateNFA < Symbol for ( const StateType & to : transition.second ) { std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( to )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -784,8 +784,8 @@ void TikZConverter::transitions ( const automaton::MultiInitialStateNFA < Symbol } template<class SymbolType, class StateType> -void TikZConverter::transitions ( const automaton::NFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::NFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; // put transitions from automaton to "transitions" for ( const auto & transition : fsm.getTransitions ( ) ) { @@ -793,7 +793,7 @@ void TikZConverter::transitions ( const automaton::NFA < SymbolType, StateType > for ( const StateType & to : transition.second ) { std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( to )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -827,15 +827,15 @@ void TikZConverter::transitions ( const automaton::NFA < SymbolType, StateType > } template<class SymbolType, class StateType> -void TikZConverter::transitions ( const automaton::DFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::DFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; // put transitions from automaton to "transitions" for ( const auto & transition : fsm.getTransitions ( ) ) { std::string symbol = replace ( alib::StringDataFactory::toString ( transition.first.second ), "\"", "\\\"" ); std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( transition.second )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -868,8 +868,8 @@ void TikZConverter::transitions ( const automaton::DFA < SymbolType, StateType > } template<class SymbolType, class StateType> -void TikZConverter::transitions ( const automaton::ExtendedNFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::ExtendedNFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; // put transitions from automaton to "transitions" for ( const auto & transition : fsm.getTransitions ( ) ) { @@ -877,7 +877,7 @@ void TikZConverter::transitions ( const automaton::ExtendedNFA < SymbolType, Sta for ( const StateType & to : transition.second ) { std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( to )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -911,8 +911,8 @@ void TikZConverter::transitions ( const automaton::ExtendedNFA < SymbolType, Sta } template<class SymbolType, class StateType> -void TikZConverter::transitions ( const automaton::CompactNFA < SymbolType, StateType > & fsm, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::CompactNFA < SymbolType, StateType > & fsm, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; // put transitions from automaton to "transitions" for ( const auto & transition : fsm.getTransitions ( ) ) { @@ -920,7 +920,7 @@ void TikZConverter::transitions ( const automaton::CompactNFA < SymbolType, Stat for ( const StateType & to : transition.second ) { std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( to )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -954,8 +954,8 @@ void TikZConverter::transitions ( const automaton::CompactNFA < SymbolType, Stat } template<class SymbolType, class RankType, class StateType> -void TikZConverter::transitions ( const automaton::NFTA < SymbolType, RankType, StateType > & fta, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, ext::vector < int > >, std::string > transitions; +void TikZConverter::transitions ( const automaton::NFTA < SymbolType, RankType, StateType > & fta, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, ext::vector < int > >, std::string > transitions; // put transitions from automaton to "transitions" for ( const auto & transition : fta.getTransitions ( ) ) { @@ -968,7 +968,7 @@ void TikZConverter::transitions ( const automaton::NFTA < SymbolType, RankType, for ( const StateType & state : transition.first.second ) key.second.push_back ( states.find ( state )->second ); - std::map < std::pair < int, ext::vector < int > >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, ext::vector < int > >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -1020,8 +1020,8 @@ void TikZConverter::transitions ( const automaton::NFTA < SymbolType, RankType, } template<class SymbolType, class RankType, class StateType> -void TikZConverter::transitions ( const automaton::DFTA < SymbolType, RankType, StateType > & fta, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, ext::vector < int > >, std::string > transitions; +void TikZConverter::transitions ( const automaton::DFTA < SymbolType, RankType, StateType > & fta, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, ext::vector < int > >, std::string > transitions; // put transitions from automaton to "transitions" for ( const auto & transition : fta.getTransitions ( ) ) { @@ -1033,7 +1033,7 @@ void TikZConverter::transitions ( const automaton::DFTA < SymbolType, RankType, for ( const StateType & state : transition.first.second ) key.second.push_back ( states.find ( state )->second ); - std::map < std::pair < int, ext::vector < int > >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, ext::vector < int > >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -1084,8 +1084,8 @@ void TikZConverter::transitions ( const automaton::DFTA < SymbolType, RankType, } template<class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType> -void TikZConverter::transitions ( const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; for ( const auto & transition : pda.getTransitions ( ) ) { std::string symbol; @@ -1116,7 +1116,7 @@ void TikZConverter::transitions ( const automaton::DPDA < InputSymbolType, Epsil // Insert into map std::pair < int, int > key ( states.find ( std::get < 0 > ( transition.first ) )->second, states.find ( transition.second.first )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -1149,8 +1149,8 @@ void TikZConverter::transitions ( const automaton::DPDA < InputSymbolType, Epsil } template<class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType> -void TikZConverter::transitions ( const automaton::SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; for ( const auto & transition : pda.getTransitions ( ) ) { std::string symbol; @@ -1177,7 +1177,7 @@ void TikZConverter::transitions ( const automaton::SinglePopDPDA < InputSymbolTy // Insert into map std::pair < int, int > key ( states.find ( std::get < 0 > ( transition.first ) )->second, states.find ( transition.second.first )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -1210,8 +1210,8 @@ void TikZConverter::transitions ( const automaton::SinglePopDPDA < InputSymbolTy } template<class InputSymbolType, class PushdownStoreSymbolType, class StateType> -void TikZConverter::transitions ( const automaton::InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; const auto & symbolToPDSOperation = pda.getPushdownStoreOperations ( ); @@ -1244,7 +1244,7 @@ void TikZConverter::transitions ( const automaton::InputDrivenDPDA < InputSymbol // Insert into map std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( to )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -1277,8 +1277,8 @@ void TikZConverter::transitions ( const automaton::InputDrivenDPDA < InputSymbol } template<class InputSymbolType, class PushdownStoreSymbolType, class StateType> -void TikZConverter::transitions ( const automaton::InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; const auto & symbolToPDSOperation = pda.getPushdownStoreOperations ( ); @@ -1314,7 +1314,7 @@ void TikZConverter::transitions ( const automaton::InputDrivenNPDA < InputSymbol // Insert into map std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( to )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol2 ) ); @@ -1348,8 +1348,8 @@ void TikZConverter::transitions ( const automaton::InputDrivenNPDA < InputSymbol } template<class InputSymbolType, class PushdownStoreSymbolType, class StateType> -void TikZConverter::transitions ( const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; for ( const auto & transition : pda.getCallTransitions ( ) ) { // input symbol @@ -1365,7 +1365,7 @@ void TikZConverter::transitions ( const automaton::VisiblyPushdownDPDA < InputSy // Insert into map std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( transition.second.first )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -1399,7 +1399,7 @@ void TikZConverter::transitions ( const automaton::VisiblyPushdownDPDA < InputSy // Insert into map std::pair < int, int > key ( states.find ( std::get < 0 > ( transition.first ) )->second, states.find ( transition.second )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -1433,7 +1433,7 @@ void TikZConverter::transitions ( const automaton::VisiblyPushdownDPDA < InputSy // Insert into map std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( transition.second )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -1466,8 +1466,8 @@ void TikZConverter::transitions ( const automaton::VisiblyPushdownDPDA < InputSy } template<class InputSymbolType, class PushdownStoreSymbolType, class StateType> -void TikZConverter::transitions ( const automaton::VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; for ( const auto & transition : pda.getCallTransitions ( ) ) { // input symbol @@ -1487,7 +1487,7 @@ void TikZConverter::transitions ( const automaton::VisiblyPushdownNPDA < InputSy // Insert into map std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( to.first )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol2 ) ); @@ -1526,7 +1526,7 @@ void TikZConverter::transitions ( const automaton::VisiblyPushdownNPDA < InputSy // Insert into map std::pair < int, int > key ( states.find ( std::get < 0 > ( transition.first ) )->second, states.find ( to )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol2 ) ); @@ -1567,7 +1567,7 @@ void TikZConverter::transitions ( const automaton::VisiblyPushdownNPDA < InputSy // Insert into map std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( to )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol2 ) ); @@ -1601,8 +1601,8 @@ void TikZConverter::transitions ( const automaton::VisiblyPushdownNPDA < InputSy } template<class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType> -void TikZConverter::transitions ( const automaton::RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; for ( const auto & transition : pda.getCallTransitions ( ) ) { std::string symbol; @@ -1623,7 +1623,7 @@ void TikZConverter::transitions ( const automaton::RealTimeHeightDeterministicDP // Insert into map std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( transition.second.first )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -1662,7 +1662,7 @@ void TikZConverter::transitions ( const automaton::RealTimeHeightDeterministicDP // Insert into map std::pair < int, int > key ( states.find ( std::get < 0 > ( transition.first ) )->second, states.find ( transition.second )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -1701,7 +1701,7 @@ void TikZConverter::transitions ( const automaton::RealTimeHeightDeterministicDP // Insert into map std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( transition.second )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); @@ -1734,8 +1734,8 @@ void TikZConverter::transitions ( const automaton::RealTimeHeightDeterministicDP } template<class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType> -void TikZConverter::transitions ( const automaton::RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; for ( const auto & transition : pda.getCallTransitions ( ) ) { std::string symbol; @@ -1760,7 +1760,7 @@ void TikZConverter::transitions ( const automaton::RealTimeHeightDeterministicNP // Insert into map std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( to.first )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol2 ) ); @@ -1804,7 +1804,7 @@ void TikZConverter::transitions ( const automaton::RealTimeHeightDeterministicNP // Insert into map std::pair < int, int > key ( states.find ( std::get < 0 > ( transition.first ) )->second, states.find ( to )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol2 ) ); @@ -1848,7 +1848,7 @@ void TikZConverter::transitions ( const automaton::RealTimeHeightDeterministicNP // Insert into map std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( to )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol2 ) ); @@ -1882,8 +1882,8 @@ void TikZConverter::transitions ( const automaton::RealTimeHeightDeterministicNP } template<class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType> -void TikZConverter::transitions ( const automaton::NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; for ( const auto & transition : pda.getTransitions ( ) ) { std::string symbol; @@ -1919,7 +1919,7 @@ void TikZConverter::transitions ( const automaton::NPDA < InputSymbolType, Epsil // Insert into map std::pair < int, int > key ( states.find ( std::get < 0 > ( transition.first ) )->second, states.find ( to.first )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol2 ) ); @@ -1953,8 +1953,8 @@ void TikZConverter::transitions ( const automaton::NPDA < InputSymbolType, Epsil } template<class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType> -void TikZConverter::transitions ( const automaton::SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; for ( const auto & transition : pda.getTransitions ( ) ) { std::string symbol; @@ -1986,7 +1986,7 @@ void TikZConverter::transitions ( const automaton::SinglePopNPDA < InputSymbolTy // Insert into map std::pair < int, int > key ( states.find ( std::get < 0 > ( transition.first ) )->second, states.find ( to.first )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol2 ) ); @@ -2020,8 +2020,8 @@ void TikZConverter::transitions ( const automaton::SinglePopNPDA < InputSymbolTy } template<class SymbolType, class StateType> -void TikZConverter::transitions ( const automaton::OneTapeDTM < SymbolType, StateType > & tm, const std::map < StateType, int > & states, std::ostream & out ) { - std::map < std::pair < int, int >, std::string > transitions; +void TikZConverter::transitions ( const automaton::OneTapeDTM < SymbolType, StateType > & tm, const ext::map < StateType, int > & states, std::ostream & out ) { + ext::map < std::pair < int, int >, std::string > transitions; for ( const auto & transition : tm.getTransitions ( ) ) { std::string symbol; @@ -2052,7 +2052,7 @@ void TikZConverter::transitions ( const automaton::OneTapeDTM < SymbolType, Stat // Insert into map std::pair < int, int > key ( states.find ( transition.first.first )->second, states.find ( std::get < 0 > ( transition.second ) )->second ); - std::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); + ext::map < std::pair < int, int >, std::string >::iterator mapit = transitions.find ( key ); if ( mapit == transitions.end ( ) ) { transitions.insert ( std::make_pair ( key, symbol ) ); diff --git a/alib2algo/src/arbology/exact/BoyerMooreHorspool.h b/alib2algo/src/arbology/exact/BoyerMooreHorspool.h index a00505ff2a..a5f0aac272 100644 --- a/alib2algo/src/arbology/exact/BoyerMooreHorspool.h +++ b/alib2algo/src/arbology/exact/BoyerMooreHorspool.h @@ -57,7 +57,7 @@ ext::set < unsigned > BoyerMooreHorspool::match ( const tree::PrefixRankedBarTre template < class SymbolType, class RankType > ext::set < unsigned > BoyerMooreHorspool::match ( const tree::PrefixRankedBarTree < SymbolType, RankType > & subject, const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ) { ext::set < unsigned > occ; - std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::BadCharacterShiftTable::bcs ( pattern ); //NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::BadCharacterShiftTable::bcs ( pattern ); //NOTE: the subjects alphabet must be a subset or equal to the pattern ext::vector < int > subjectSubtreeJumpTable = tree::properties::SubtreeJumpTable::compute ( subject ); // index to the subject @@ -99,9 +99,9 @@ ext::set < unsigned > BoyerMooreHorspool::match ( const tree::PrefixRankedBarTre template < class SymbolType, class RankType > ext::set < unsigned > BoyerMooreHorspool::match ( const tree::PrefixRankedBarTree < SymbolType, RankType > & subject, const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ) { ext::set < unsigned > occ; - std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::BadCharacterShiftTable::bcs ( pattern ); //NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::BadCharacterShiftTable::bcs ( pattern ); //NOTE: the subjects alphabet must be a subset or equal to the pattern ext::vector < int > subjectSubtreeJumpTable = tree::properties::SubtreeJumpTable::compute ( subject ); - std::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting; + ext::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting; tree::PrefixRankedBarTree < unsigned, RankType > repeats = tree::properties::ExactSubtreeRepeatsNaive::repeats ( subject ); diff --git a/alib2algo/src/arbology/exact/DeadZoneUsingBadCharacterShiftAndBorderArray.h b/alib2algo/src/arbology/exact/DeadZoneUsingBadCharacterShiftAndBorderArray.h index 3244417dee..83d10ccfac 100644 --- a/alib2algo/src/arbology/exact/DeadZoneUsingBadCharacterShiftAndBorderArray.h +++ b/alib2algo/src/arbology/exact/DeadZoneUsingBadCharacterShiftAndBorderArray.h @@ -47,14 +47,14 @@ public: template < class SymbolType, class RankType > static ext::set < unsigned > match ( const tree::PrefixRankedBarTree < SymbolType, RankType > & subject, const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ); template < class SymbolType, class RankType > - static void match_rec ( ext::set < unsigned > & occ, const tree::PrefixRankedBarTree < SymbolType, RankType > & subject, const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern, ext::vector < size_t > & fba, std::map < common::ranked_symbol < SymbolType, RankType >, size_t > & bbcs, ext::vector < int > & subjectSubtreeJumpTable, int low, int high ); + static void match_rec ( ext::set < unsigned > & occ, const tree::PrefixRankedBarTree < SymbolType, RankType > & subject, const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern, ext::vector < size_t > & fba, ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > & bbcs, ext::vector < int > & subjectSubtreeJumpTable, int low, int high ); template < class SymbolType, class RankType > static ext::set < unsigned > match ( const tree::PrefixRankedTree < SymbolType, RankType > & subject, const tree::PrefixRankedTree < SymbolType, RankType > & pattern ); template < class SymbolType, class RankType > static ext::set < unsigned > match ( const tree::PrefixRankedTree < SymbolType, RankType > & subject, const tree::PrefixRankedPattern < SymbolType, RankType > & pattern ); template < class SymbolType, class RankType > - static void match_rec ( ext::set < unsigned > & occ, const tree::PrefixRankedTree < SymbolType, RankType > & subject, const tree::PrefixRankedPattern < SymbolType, RankType > & pattern, ext::vector < size_t > & fba, std::map < common::ranked_symbol < SymbolType, RankType >, size_t > & bbcs, ext::vector < int > & subjectSubtreeJumpTable, int low, int high ); + static void match_rec ( ext::set < unsigned > & occ, const tree::PrefixRankedTree < SymbolType, RankType > & subject, const tree::PrefixRankedPattern < SymbolType, RankType > & pattern, ext::vector < size_t > & fba, ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > & bbcs, ext::vector < int > & subjectSubtreeJumpTable, int low, int high ); }; @@ -66,7 +66,7 @@ ext::set < unsigned > DeadZoneUsingBadCharacterShiftAndBorderArray::match ( cons template < class SymbolType, class RankType > ext::set < unsigned > DeadZoneUsingBadCharacterShiftAndBorderArray::match ( const tree::PrefixRankedBarTree < SymbolType, RankType > & subject, const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ) { ext::set < unsigned > occ; - std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bbcs = tree::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bbcs = tree::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern ext::vector < size_t > fba = tree::properties::BorderArrayNaive::ba ( pattern ); ext::vector < int > subjectSubtreeJumpTable = tree::properties::SubtreeJumpTable::compute ( subject ); @@ -75,7 +75,7 @@ ext::set < unsigned > DeadZoneUsingBadCharacterShiftAndBorderArray::match ( cons } template < class SymbolType, class RankType > -void DeadZoneUsingBadCharacterShiftAndBorderArray::match_rec ( ext::set < unsigned > & occ, const tree::PrefixRankedBarTree < SymbolType, RankType > & subject, const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern, ext::vector < size_t > & fba, std::map < common::ranked_symbol < SymbolType, RankType >, size_t > & bbcs, ext::vector < int > & subjectSubtreeJumpTable, int low, int high ) { +void DeadZoneUsingBadCharacterShiftAndBorderArray::match_rec ( ext::set < unsigned > & occ, const tree::PrefixRankedBarTree < SymbolType, RankType > & subject, const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern, ext::vector < size_t > & fba, ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > & bbcs, ext::vector < int > & subjectSubtreeJumpTable, int low, int high ) { if ( low >= high ) return; int i = ( low + high ) / 2; @@ -115,7 +115,7 @@ ext::set < unsigned > DeadZoneUsingBadCharacterShiftAndBorderArray::match ( cons template < class SymbolType, class RankType > ext::set < unsigned > DeadZoneUsingBadCharacterShiftAndBorderArray::match ( const tree::PrefixRankedTree < SymbolType, RankType > & subject, const tree::PrefixRankedPattern < SymbolType, RankType > & pattern ) { ext::set < unsigned > occ; - std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bbcs = tree::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bbcs = tree::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern ext::vector < size_t > fba = tree::properties::BorderArrayNaive::ba ( pattern ); ext::vector < int > subjectSubtreeJumpTable = tree::properties::SubtreeJumpTable::compute ( subject ); @@ -124,7 +124,7 @@ ext::set < unsigned > DeadZoneUsingBadCharacterShiftAndBorderArray::match ( cons } template < class SymbolType, class RankType > -void DeadZoneUsingBadCharacterShiftAndBorderArray::match_rec ( ext::set < unsigned > & occ, const tree::PrefixRankedTree < SymbolType, RankType > & subject, const tree::PrefixRankedPattern < SymbolType, RankType > & pattern, ext::vector < size_t > & fba, std::map < common::ranked_symbol < SymbolType, RankType >, size_t > & bbcs, ext::vector < int > & subjectSubtreeJumpTable, int low, int high ) { +void DeadZoneUsingBadCharacterShiftAndBorderArray::match_rec ( ext::set < unsigned > & occ, const tree::PrefixRankedTree < SymbolType, RankType > & subject, const tree::PrefixRankedPattern < SymbolType, RankType > & pattern, ext::vector < size_t > & fba, ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > & bbcs, ext::vector < int > & subjectSubtreeJumpTable, int low, int high ) { if ( low >= high ) return; int i = ( low + high ) / 2; diff --git a/alib2algo/src/arbology/exact/ExactPatternMatch.h b/alib2algo/src/arbology/exact/ExactPatternMatch.h index 0d30c4af53..09c89ad0bd 100644 --- a/alib2algo/src/arbology/exact/ExactPatternMatch.h +++ b/alib2algo/src/arbology/exact/ExactPatternMatch.h @@ -70,7 +70,7 @@ private: template < class SymbolType, class RankType > static bool matchHelper ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & subject, const ext::tree < common::ranked_symbol < SymbolType, RankType > > & pattern, const common::ranked_symbol < SymbolType, RankType > & subtreeVariable ); template < class SymbolType, class RankType > - static bool matchHelper ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & subject, const ext::tree < common::ranked_symbol < SymbolType, RankType > > & pattern, const common::ranked_symbol < SymbolType, RankType > & subtreeVariable, const ext::set < common::ranked_symbol < SymbolType, RankType > > & nonlinearVariables, const ext::tree < common::ranked_symbol < unsigned, RankType > > & repeats, std::map < common::ranked_symbol < SymbolType, RankType >, unsigned > & variablesSetting ); + static bool matchHelper ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & subject, const ext::tree < common::ranked_symbol < SymbolType, RankType > > & pattern, const common::ranked_symbol < SymbolType, RankType > & subtreeVariable, const ext::set < common::ranked_symbol < SymbolType, RankType > > & nonlinearVariables, const ext::tree < common::ranked_symbol < unsigned, RankType > > & repeats, ext::map < common::ranked_symbol < SymbolType, RankType >, unsigned > & variablesSetting ); template < class SymbolType > static void matchInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < SymbolType > & subject, const ext::tree < SymbolType > & pattern, const SymbolType & subtreeVariable ); @@ -109,7 +109,7 @@ bool ExactPatternMatch::matchHelper ( const ext::tree < common::ranked_symbol < } template < class SymbolType, class RankType > -bool ExactPatternMatch::matchHelper ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & subject, const ext::tree < common::ranked_symbol < SymbolType, RankType > > & pattern, const common::ranked_symbol < SymbolType, RankType > & subtreeVariable, const ext::set < common::ranked_symbol < SymbolType, RankType > > & nonlinearVariables, const ext::tree < common::ranked_symbol < unsigned, RankType > > & repeats, std::map < common::ranked_symbol < SymbolType, RankType >, unsigned > & variablesSetting ) { +bool ExactPatternMatch::matchHelper ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & subject, const ext::tree < common::ranked_symbol < SymbolType, RankType > > & pattern, const common::ranked_symbol < SymbolType, RankType > & subtreeVariable, const ext::set < common::ranked_symbol < SymbolType, RankType > > & nonlinearVariables, const ext::tree < common::ranked_symbol < unsigned, RankType > > & repeats, ext::map < common::ranked_symbol < SymbolType, RankType >, unsigned > & variablesSetting ) { if ( pattern.getData ( ) == subtreeVariable ) return true; if ( nonlinearVariables.count ( pattern.getData ( ) ) ) { @@ -153,7 +153,7 @@ void ExactPatternMatch::matchInternal ( unsigned & index, ext::set < unsigned > template < class SymbolType, class RankType > void ExactPatternMatch::matchInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < common::ranked_symbol < SymbolType, RankType > > & subject, const ext::tree < common::ranked_symbol < SymbolType, RankType > > & pattern, const common::ranked_symbol < SymbolType, RankType > & subtreeVariable, const ext::set < common::ranked_symbol < SymbolType, RankType > > & nonlinearVariables, const ext::tree < common::ranked_symbol < unsigned, RankType > > & repeats ) { - std::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting; + ext::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting; if ( matchHelper ( subject, pattern, subtreeVariable, nonlinearVariables, repeats, variablesSetting ) ) occ.insert ( index ); @@ -221,7 +221,7 @@ ext::set < unsigned > ExactPatternMatch::match ( const tree::PrefixRankedTree < template < class SymbolType, class RankType > ext::set < unsigned > ExactPatternMatch::match ( const tree::PrefixRankedTree < SymbolType, RankType > & subject, const tree::PrefixRankedNonlinearPattern < SymbolType, RankType > & pattern ) { ext::vector < int > subjectSubtreeJumpTable = tree::properties::SubtreeJumpTable::compute ( subject ); - std::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting; + ext::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting; tree::PrefixRankedTree < unsigned, RankType > repeats = tree::properties::ExactSubtreeRepeatsNaive::repeats ( subject ); @@ -287,7 +287,7 @@ ext::set < unsigned > ExactPatternMatch::match ( const tree::PrefixRankedBarTree template < class SymbolType, class RankType > ext::set < unsigned > ExactPatternMatch::match ( const tree::PrefixRankedBarTree < SymbolType, RankType > & subject, const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ) { ext::vector < int > subjectSubtreeJumpTable = tree::properties::SubtreeJumpTable::compute ( subject ); - std::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting; + ext::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting; tree::PrefixRankedBarTree < unsigned, RankType > repeats = tree::properties::ExactSubtreeRepeatsNaive::repeats ( subject ); diff --git a/alib2algo/src/arbology/exact/ReversedBoyerMooreHorspool.h b/alib2algo/src/arbology/exact/ReversedBoyerMooreHorspool.h index 5995bf3460..6f7f324425 100644 --- a/alib2algo/src/arbology/exact/ReversedBoyerMooreHorspool.h +++ b/alib2algo/src/arbology/exact/ReversedBoyerMooreHorspool.h @@ -66,7 +66,7 @@ ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const tree::PrefixRank template < class SymbolType, class RankType > ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const tree::PrefixRankedBarTree < SymbolType, RankType > & subject, const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ) { ext::set < unsigned > occ; - std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern ext::vector < int > subjectSubtreeJumpTable = tree::properties::SubtreeJumpTable::compute ( subject ); // index to the subject @@ -108,9 +108,9 @@ ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const tree::PrefixRank template < class SymbolType, class RankType > ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const tree::PrefixRankedBarTree < SymbolType, RankType > & subject, const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ) { ext::set < unsigned > occ; - std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern ext::vector < int > subjectSubtreeJumpTable = tree::properties::SubtreeJumpTable::compute ( subject ); - std::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting; + ext::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting; tree::PrefixRankedBarTree < unsigned, RankType > repeats = tree::properties::ExactSubtreeRepeatsNaive::repeats ( subject ); @@ -170,7 +170,7 @@ ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const tree::PrefixRank template < class SymbolType, class RankType > ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const tree::PrefixRankedTree < SymbolType, RankType > & subject, const tree::PrefixRankedPattern < SymbolType, RankType > & pattern ) { ext::set < unsigned > occ; - std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern ext::vector < int > subjectSubtreeJumpTable = tree::properties::SubtreeJumpTable::compute ( subject ); // index to the subject @@ -211,9 +211,9 @@ ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const tree::PrefixRank template < class SymbolType, class RankType > ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const tree::PrefixRankedTree < SymbolType, RankType > & subject, const tree::PrefixRankedNonlinearPattern < SymbolType, RankType > & pattern ) { ext::set < unsigned > occ; - std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs = tree::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern ext::vector < int > subjectSubtreeJumpTable = tree::properties::SubtreeJumpTable::compute ( subject ); - std::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting; + ext::map < common::ranked_symbol < SymbolType, RankType >, unsigned > variablesSetting; tree::PrefixRankedTree < unsigned, RankType > repeats = tree::properties::ExactSubtreeRepeatsNaive::repeats ( subject ); diff --git a/alib2algo/src/arbology/indexing/CompressedBitParallelIndexConstruction.h b/alib2algo/src/arbology/indexing/CompressedBitParallelIndexConstruction.h index 901eb96898..ef63836be9 100644 --- a/alib2algo/src/arbology/indexing/CompressedBitParallelIndexConstruction.h +++ b/alib2algo/src/arbology/indexing/CompressedBitParallelIndexConstruction.h @@ -43,7 +43,7 @@ public: template < class SymbolType, class RankType > indexes::arbology::CompressedBitParallelTreeIndex < common::ranked_symbol < SymbolType, RankType > > CompressedBitParallelIndexConstruction::construct ( const tree::PrefixRankedTree < SymbolType, RankType > & w ) { - std::map < common::ranked_symbol < SymbolType, RankType >, common::SparseBoolVector > res; + ext::map < common::ranked_symbol < SymbolType, RankType >, common::SparseBoolVector > res; for ( const common::ranked_symbol < SymbolType, RankType > & symbol : w.getAlphabet ( ) ) res [ symbol ].resize ( w.getContent ( ).size ( ) ); @@ -56,7 +56,7 @@ indexes::arbology::CompressedBitParallelTreeIndex < common::ranked_symbol < Symb template < class SymbolType, class RankType > indexes::arbology::CompressedBitParallelTreeIndex < common::ranked_symbol < SymbolType, RankType > > CompressedBitParallelIndexConstruction::construct ( const tree::PrefixRankedBarTree < SymbolType, RankType > & w ) { - std::map < common::ranked_symbol < SymbolType, RankType >, common::SparseBoolVector > res; + ext::map < common::ranked_symbol < SymbolType, RankType >, common::SparseBoolVector > res; for ( const common::ranked_symbol < SymbolType, RankType > & symbol : w.getAlphabet ( ) ) res [ symbol ].resize ( w.getContent ( ).size ( ) ); diff --git a/alib2algo/src/arbology/query/CompressedBitParallelismPatterns.h b/alib2algo/src/arbology/query/CompressedBitParallelismPatterns.h index e868546d8d..1b7fc49612 100644 --- a/alib2algo/src/arbology/query/CompressedBitParallelismPatterns.h +++ b/alib2algo/src/arbology/query/CompressedBitParallelismPatterns.h @@ -46,7 +46,7 @@ template < class SymbolType, class RankType > ext::set < unsigned > CompressedBitParallelismPatterns::query ( const indexes::arbology::CompressedBitParallelTreeIndex < common::ranked_symbol < SymbolType, RankType > > & compressedBitParallelIndex, const tree::PrefixRankedPattern < SymbolType, RankType > & pattern ) { auto symbolIter = pattern.getContent ( ).begin ( ); - typename std::map < common::ranked_symbol < SymbolType, RankType >, common::SparseBoolVector >::const_iterator symbolVectorIter = compressedBitParallelIndex.getData ( ).find ( * symbolIter ); + typename ext::map < common::ranked_symbol < SymbolType, RankType >, common::SparseBoolVector >::const_iterator symbolVectorIter = compressedBitParallelIndex.getData ( ).find ( * symbolIter ); if ( symbolVectorIter == compressedBitParallelIndex.getData ( ).end ( ) ) return { }; @@ -84,7 +84,7 @@ template < class SymbolType, class RankType > ext::set < unsigned > CompressedBitParallelismPatterns::query ( const indexes::arbology::CompressedBitParallelTreeIndex < common::ranked_symbol < SymbolType, RankType > > & compressedBitParallelIndex, const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ) { auto symbolIter = pattern.getContent ( ).begin ( ); - typename std::map < common::ranked_symbol < SymbolType, RankType >, common::SparseBoolVector >::const_iterator symbolVectorIter = compressedBitParallelIndex.getData ( ).find ( * symbolIter ); + typename ext::map < common::ranked_symbol < SymbolType, RankType >, common::SparseBoolVector >::const_iterator symbolVectorIter = compressedBitParallelIndex.getData ( ).find ( * symbolIter ); if ( symbolVectorIter == compressedBitParallelIndex.getData ( ).end ( ) ) return { }; diff --git a/alib2algo/src/arbology/query/NonlinearFullAndLinearIndexPatterns.h b/alib2algo/src/arbology/query/NonlinearFullAndLinearIndexPatterns.h index 3ed8abf669..d6b5aeb026 100644 --- a/alib2algo/src/arbology/query/NonlinearFullAndLinearIndexPatterns.h +++ b/alib2algo/src/arbology/query/NonlinearFullAndLinearIndexPatterns.h @@ -72,7 +72,7 @@ public: template < class SymbolType, class RankType > ext::set < unsigned > NonlinearFullAndLinearIndexPatterns::query ( const indexes::arbology::NonlinearFullAndLinearIndex < common::ranked_symbol < SymbolType, RankType > > & fullAndLinearIndex, const tree::PrefixRankedNonlinearPattern < SymbolType, RankType > & pattern ) { - std::map < std::pair < unsigned, common::ranked_symbol < SymbolType, RankType > >, unsigned > nonlinearVariablesMap; + ext::map < std::pair < unsigned, common::ranked_symbol < SymbolType, RankType > >, unsigned > nonlinearVariablesMap; ext::vector < unsigned > rev ( fullAndLinearIndex.getString ( ).size ( ), ( unsigned ) -1 ); ext::vector < ext::vector < common::ranked_symbol < SymbolType, RankType > > > treePatternParts; @@ -118,7 +118,7 @@ ext::set < unsigned > NonlinearFullAndLinearIndexPatterns::query ( const indexes template < class SymbolType, class RankType > ext::set < unsigned > NonlinearFullAndLinearIndexPatterns::query ( const indexes::arbology::NonlinearFullAndLinearIndex < common::ranked_symbol < SymbolType, RankType > > & fullAndLinearIndex, const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ) { - std::map < std::pair < unsigned, common::ranked_symbol < SymbolType, RankType > >, unsigned > nonlinearVariablesMap; + ext::map < std::pair < unsigned, common::ranked_symbol < SymbolType, RankType > >, unsigned > nonlinearVariablesMap; ext::vector < unsigned > rev ( fullAndLinearIndex.getString ( ).size ( ), ( unsigned ) -1 ); ext::vector < ext::vector < common::ranked_symbol < SymbolType, RankType > > > treePatternParts; diff --git a/alib2algo/src/automaton/convert/ToGrammarLeftRG.cpp b/alib2algo/src/automaton/convert/ToGrammarLeftRG.cpp index 5b4eeafbe7..0a58e3c20a 100644 --- a/alib2algo/src/automaton/convert/ToGrammarLeftRG.cpp +++ b/alib2algo/src/automaton/convert/ToGrammarLeftRG.cpp @@ -21,7 +21,7 @@ grammar::LeftRG < > ToGrammarLeftRG::convert(const automaton::Automaton& automat } grammar::LeftRG < > ToGrammarLeftRG::convert(const automaton::NFA < > & automaton) { - std::map<DefaultStateType, DefaultSymbolType> nonterminalMap; + ext::map<DefaultStateType, DefaultSymbolType> nonterminalMap; // step 2 grammar::LeftRG < > grammar(alphabet::InitialSymbol::instance < DefaultSymbolType > ( ) ); @@ -68,7 +68,7 @@ grammar::LeftRG < > ToGrammarLeftRG::convert(const automaton::NFA < > & automato auto ToGrammarLeftRGNFA = registration::OverloadRegister < ToGrammarLeftRG, grammar::LeftRG < >, automaton::NFA < > >(ToGrammarLeftRG::convert); grammar::LeftRG < > ToGrammarLeftRG::convert(const automaton::DFA<>& automaton) { - std::map<DefaultStateType, DefaultSymbolType> nonterminalMap; + ext::map<DefaultStateType, DefaultSymbolType> nonterminalMap; // step 2 grammar::LeftRG < > grammar(alphabet::InitialSymbol::instance < DefaultSymbolType > ( ) ); diff --git a/alib2algo/src/automaton/convert/ToGrammarRightRG.cpp b/alib2algo/src/automaton/convert/ToGrammarRightRG.cpp index 7b89abb3c5..3419ad3938 100644 --- a/alib2algo/src/automaton/convert/ToGrammarRightRG.cpp +++ b/alib2algo/src/automaton/convert/ToGrammarRightRG.cpp @@ -18,7 +18,7 @@ grammar::RightRG < > ToGrammarRightRG::convert(const automaton::Automaton& autom } grammar::RightRG < > ToGrammarRightRG::convert(const automaton::NFA < > & automaton) { - std::map<DefaultStateType, DefaultSymbolType> nonterminalMap; + ext::map<DefaultStateType, DefaultSymbolType> nonterminalMap; const DefaultStateType& initState = automaton.getInitialState(); DefaultSymbolType initSymbol { initState }; @@ -61,7 +61,7 @@ grammar::RightRG < > ToGrammarRightRG::convert(const automaton::NFA < > & automa auto ToGrammarRightRGNFA = registration::OverloadRegister < ToGrammarRightRG, grammar::RightRG < >, automaton::NFA < > >(ToGrammarRightRG::convert); grammar::RightRG < > ToGrammarRightRG::convert(const automaton::DFA<>& automaton) { - std::map<DefaultStateType, DefaultSymbolType> nonterminalMap; + ext::map<DefaultStateType, DefaultSymbolType> nonterminalMap; const DefaultStateType& initState = automaton.getInitialState(); DefaultSymbolType initSymbol { initState }; diff --git a/alib2algo/src/automaton/determinize/DeterminizeNFTAPart.cxx b/alib2algo/src/automaton/determinize/DeterminizeNFTAPart.cxx index 074486bc20..e9e2ce398f 100644 --- a/alib2algo/src/automaton/determinize/DeterminizeNFTAPart.cxx +++ b/alib2algo/src/automaton/determinize/DeterminizeNFTAPart.cxx @@ -37,7 +37,7 @@ DFTA < > Determinize::determinize(const NFTA < > & nfta) { std::deque<DefaultStateType> todo; - //std::map<std::pair<common::ranked_symbol < >, ext::vector<DefaultStateType> >, ext::set<DefaultStateType> > transitions; + //ext::map<std::pair<common::ranked_symbol < >, ext::vector<DefaultStateType> >, ext::set<DefaultStateType> > transitions; for (const auto & transition : nfta.getTransitions()) { DefaultStateType state = createDFAState(transition.second); ext::vector<DefaultStateType> states; diff --git a/alib2algo/src/automaton/determinize/DeterminizeRHDPDAPart.cxx b/alib2algo/src/automaton/determinize/DeterminizeRHDPDAPart.cxx index 4fc7ca72e8..4ba6794983 100644 --- a/alib2algo/src/automaton/determinize/DeterminizeRHDPDAPart.cxx +++ b/alib2algo/src/automaton/determinize/DeterminizeRHDPDAPart.cxx @@ -23,7 +23,7 @@ void addRetTransition(const DefaultStateType& from, const ext::variant<DefaultEp deterministic.addReturnTransition(from, input, dvpdaSymbol, to); } -void retInitial(const DefaultStateType& state, const DefaultSymbolType& pdaSymbol, const ext::variant<DefaultEpsilonType, DefaultSymbolType>& input, const automaton::RealTimeHeightDeterministicNPDA < > & nondeterministic, automaton::RealTimeHeightDeterministicDPDA < > & deterministic, std::map<std::tuple<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>, DefaultSymbolType>, DefaultStateType>& rubbishReturnTransitions) { +void retInitial(const DefaultStateType& state, const DefaultSymbolType& pdaSymbol, const ext::variant<DefaultEpsilonType, DefaultSymbolType>& input, const automaton::RealTimeHeightDeterministicNPDA < > & nondeterministic, automaton::RealTimeHeightDeterministicDPDA < > & deterministic, ext::map<std::tuple<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>, DefaultSymbolType>, DefaultStateType>& rubbishReturnTransitions) { const ext::set<std::pair<DefaultStateType, DefaultStateType>> & S = unpackFromStateLabel(state); ext::set<std::pair<DefaultStateType, DefaultStateType>> S1; @@ -53,7 +53,7 @@ void retInitial(const DefaultStateType& state, const DefaultSymbolType& pdaSymbo } } -void ret(const DefaultStateType& state, const DefaultSymbolType& pdaSymbol, const ext::variant<DefaultEpsilonType, DefaultSymbolType>& input, const automaton::RealTimeHeightDeterministicNPDA < > & nondeterministic, automaton::RealTimeHeightDeterministicDPDA < > & deterministic, std::map<std::tuple<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>, DefaultSymbolType>, DefaultStateType>& rubbishReturnTransitions) { +void ret(const DefaultStateType& state, const DefaultSymbolType& pdaSymbol, const ext::variant<DefaultEpsilonType, DefaultSymbolType>& input, const automaton::RealTimeHeightDeterministicNPDA < > & nondeterministic, automaton::RealTimeHeightDeterministicDPDA < > & deterministic, ext::map<std::tuple<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>, DefaultSymbolType>, DefaultStateType>& rubbishReturnTransitions) { const ext::set<std::pair<DefaultStateType, DefaultStateType>> & S = unpackFromStateLabel(state); const std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>> & pdaSymbolUnpack = unpackFromDRHDPDAStackSymbol(pdaSymbol); const ext::set<std::pair<DefaultStateType, DefaultStateType>>& S1 = unpackFromStateLabel ( pdaSymbolUnpack.first ); @@ -118,7 +118,7 @@ void addCallTransition(const DefaultStateType& from, const ext::variant<DefaultE deterministic.addCallTransition(from, input, to, dvpdaSymbol); } -void call(const DefaultStateType& state, const ext::variant<DefaultEpsilonType, DefaultSymbolType>& input, const automaton::RealTimeHeightDeterministicNPDA < > & nondeterministic, automaton::RealTimeHeightDeterministicDPDA < > & deterministic, std::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions) { +void call(const DefaultStateType& state, const ext::variant<DefaultEpsilonType, DefaultSymbolType>& input, const automaton::RealTimeHeightDeterministicNPDA < > & nondeterministic, automaton::RealTimeHeightDeterministicDPDA < > & deterministic, ext::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions) { const ext::set<std::pair<DefaultStateType, DefaultStateType>> & S = unpackFromStateLabel(state); ext::set<DefaultStateType> R = retrieveDSubSet(S); @@ -154,7 +154,7 @@ void addLocalTransition(const DefaultStateType& from, const ext::variant<Default deterministic.addLocalTransition(from, input, to); } -void local(const DefaultStateType& state, const ext::variant<DefaultEpsilonType, DefaultSymbolType>& input, const automaton::RealTimeHeightDeterministicNPDA < > & nondeterministic, automaton::RealTimeHeightDeterministicDPDA < > & deterministic, std::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, DefaultStateType>& rubbishLocalTransitions ) { +void local(const DefaultStateType& state, const ext::variant<DefaultEpsilonType, DefaultSymbolType>& input, const automaton::RealTimeHeightDeterministicNPDA < > & nondeterministic, automaton::RealTimeHeightDeterministicDPDA < > & deterministic, ext::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, DefaultStateType>& rubbishLocalTransitions ) { const ext::set<std::pair<DefaultStateType, DefaultStateType>> & S = unpackFromStateLabel(state); ext::set<std::pair<DefaultStateType, DefaultStateType>> S1; @@ -214,9 +214,9 @@ automaton::RealTimeHeightDeterministicDPDA < > Determinize::determinize(const au d.setInputAlphabet(n.getInputAlphabet()); ext::set<DefaultStateType> rubbishStates = {DefaultStateType(packToStateLabel({}))}; - std::map<std::tuple<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>, DefaultSymbolType>, DefaultStateType> rubbishReturnTransitions; - std::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, std::pair<DefaultStateType, DefaultSymbolType> > rubbishCallTransitions; - std::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, DefaultStateType> rubbishLocalTransitions; + ext::map<std::tuple<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>, DefaultSymbolType>, DefaultStateType> rubbishReturnTransitions; + ext::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, std::pair<DefaultStateType, DefaultSymbolType> > rubbishCallTransitions; + ext::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, DefaultStateType> rubbishLocalTransitions; for(;;) { ext::set<std::pair<DefaultStateType, DefaultSymbolType>> stateSymbols = existsDirtyStateSymbol(d, rubbishStates, rubbishCallTransitions, rubbishReturnTransitions, n); diff --git a/alib2algo/src/automaton/determinize/DeterminizeVPAPart.cxx b/alib2algo/src/automaton/determinize/DeterminizeVPAPart.cxx index 6f5022bff1..fd888d241a 100644 --- a/alib2algo/src/automaton/determinize/DeterminizeVPAPart.cxx +++ b/alib2algo/src/automaton/determinize/DeterminizeVPAPart.cxx @@ -163,9 +163,9 @@ automaton::VisiblyPushdownDPDA < > Determinize::determinize(const automaton::Vis d.setReturnInputAlphabet(n.getReturnInputAlphabet()); ext::set<DefaultStateType> rubbishStates = {DefaultStateType(packToStateLabel({}))}; - std::map<std::tuple<DefaultStateType, DefaultSymbolType, DefaultSymbolType>, DefaultStateType> rubbishReturnTransitions; - std::map<std::pair<DefaultStateType, DefaultSymbolType>, std::pair<DefaultStateType, DefaultSymbolType> > rubbishCallTransitions; - std::map<std::pair<DefaultStateType, DefaultSymbolType>, DefaultStateType> rubbishLocalTransitions; + ext::map<std::tuple<DefaultStateType, DefaultSymbolType, DefaultSymbolType>, DefaultStateType> rubbishReturnTransitions; + ext::map<std::pair<DefaultStateType, DefaultSymbolType>, std::pair<DefaultStateType, DefaultSymbolType> > rubbishCallTransitions; + ext::map<std::pair<DefaultStateType, DefaultSymbolType>, DefaultStateType> rubbishLocalTransitions; for(;;) { ext::set<std::pair<DefaultStateType, DefaultSymbolType>> stateSymbols = existsDirtyStateSymbol(d, rubbishStates, rubbishCallTransitions, rubbishReturnTransitions, n); diff --git a/alib2algo/src/automaton/determinize/common/RHDPDACommon.cpp b/alib2algo/src/automaton/determinize/common/RHDPDACommon.cpp index 8b8d25c21b..6788b5b0ec 100644 --- a/alib2algo/src/automaton/determinize/common/RHDPDACommon.cpp +++ b/alib2algo/src/automaton/determinize/common/RHDPDACommon.cpp @@ -53,7 +53,7 @@ ext::set<std::pair<DefaultStateType, DefaultStateType>> createIdentity(const ext } template<class T, class S, class R> -ext::set<DefaultStateType> existsDirtyState(const T& d, const ext::set<DefaultStateType>& rubbishStates, const std::map<std::pair<DefaultStateType, S>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const std::map<std::pair<DefaultStateType, S>, DefaultStateType>& rubbishLocalTransitions, const R& n) { +ext::set<DefaultStateType> existsDirtyState(const T& d, const ext::set<DefaultStateType>& rubbishStates, const ext::map<std::pair<DefaultStateType, S>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const ext::map<std::pair<DefaultStateType, S>, DefaultStateType>& rubbishLocalTransitions, const R& n) { ext::set<DefaultStateType> dirtyStates; ext::set<DefaultStateType> states = d.getStates(); @@ -104,8 +104,8 @@ ext::set<DefaultStateType> existsDirtyState(const T& d, const ext::set<DefaultSt return dirtyStates; } -template ext::set<DefaultStateType> existsDirtyState(const automaton::VisiblyPushdownDPDA < > & d, const ext::set<DefaultStateType>& rubbishStates, const std::map<std::pair<DefaultStateType, DefaultSymbolType>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const std::map<std::pair<DefaultStateType, DefaultSymbolType>, DefaultStateType>& rubbishLocalTransitions, const automaton::VisiblyPushdownNPDA < > & n); -template ext::set<DefaultStateType> existsDirtyState(const automaton::RealTimeHeightDeterministicDPDA < > & d, const ext::set<DefaultStateType>& rubbishStates, const std::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const std::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, DefaultStateType>& rubbishLocalTransitions, const automaton::RealTimeHeightDeterministicNPDA < > & n); +template ext::set<DefaultStateType> existsDirtyState(const automaton::VisiblyPushdownDPDA < > & d, const ext::set<DefaultStateType>& rubbishStates, const ext::map<std::pair<DefaultStateType, DefaultSymbolType>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const ext::map<std::pair<DefaultStateType, DefaultSymbolType>, DefaultStateType>& rubbishLocalTransitions, const automaton::VisiblyPushdownNPDA < > & n); +template ext::set<DefaultStateType> existsDirtyState(const automaton::RealTimeHeightDeterministicDPDA < > & d, const ext::set<DefaultStateType>& rubbishStates, const ext::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const ext::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, DefaultStateType>& rubbishLocalTransitions, const automaton::RealTimeHeightDeterministicNPDA < > & n); void localClosure(ext::set<DefaultStateType>& states, const ext::set<DefaultStateType>& oldStates, const automaton::RealTimeHeightDeterministicDPDA < > & d) { ext::set<DefaultStateType> newStates; @@ -172,7 +172,7 @@ void localClosure(ext::set<DefaultStateType>& states, const ext::set<DefaultStat } template<class T, class S, class R> -ext::set<std::pair<DefaultStateType, DefaultSymbolType>> existsDirtyStateSymbol(const T& d, const ext::set<DefaultStateType>& rubbishStates, const std::map<std::pair<DefaultStateType, S>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const std::map<std::tuple<DefaultStateType, S, DefaultSymbolType>, DefaultStateType>& rubbishReturnTransitions, const R& n) { +ext::set<std::pair<DefaultStateType, DefaultSymbolType>> existsDirtyStateSymbol(const T& d, const ext::set<DefaultStateType>& rubbishStates, const ext::map<std::pair<DefaultStateType, S>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const ext::map<std::tuple<DefaultStateType, S, DefaultSymbolType>, DefaultStateType>& rubbishReturnTransitions, const R& n) { ext::set<std::pair<DefaultStateType, DefaultSymbolType>> dirtyStateSymbols; ext::set<DefaultStateType> states = d.getStates(); @@ -225,8 +225,8 @@ ext::set<std::pair<DefaultStateType, DefaultSymbolType>> existsDirtyStateSymbol( return dirtyStateSymbols; } -template ext::set<std::pair<DefaultStateType, DefaultSymbolType>> existsDirtyStateSymbol(const automaton::VisiblyPushdownDPDA < > & d, const ext::set<DefaultStateType>& rubbishStates, const std::map<std::pair<DefaultStateType, DefaultSymbolType>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const std::map<std::tuple<DefaultStateType, DefaultSymbolType, DefaultSymbolType>, DefaultStateType>& rubbishReturnTransitions, const automaton::VisiblyPushdownNPDA < > & n); -template ext::set<std::pair<DefaultStateType, DefaultSymbolType>> existsDirtyStateSymbol(const automaton::RealTimeHeightDeterministicDPDA < > & d, const ext::set<DefaultStateType>& rubbishStates, const std::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const std::map<std::tuple<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>, DefaultSymbolType>, DefaultStateType>& rubbishReturnTransitions, const automaton::RealTimeHeightDeterministicNPDA < > & n); +template ext::set<std::pair<DefaultStateType, DefaultSymbolType>> existsDirtyStateSymbol(const automaton::VisiblyPushdownDPDA < > & d, const ext::set<DefaultStateType>& rubbishStates, const ext::map<std::pair<DefaultStateType, DefaultSymbolType>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const ext::map<std::tuple<DefaultStateType, DefaultSymbolType, DefaultSymbolType>, DefaultStateType>& rubbishReturnTransitions, const automaton::VisiblyPushdownNPDA < > & n); +template ext::set<std::pair<DefaultStateType, DefaultSymbolType>> existsDirtyStateSymbol(const automaton::RealTimeHeightDeterministicDPDA < > & d, const ext::set<DefaultStateType>& rubbishStates, const ext::map<std::pair<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const ext::map<std::tuple<DefaultStateType, ext::variant<DefaultEpsilonType, DefaultSymbolType>, DefaultSymbolType>, DefaultStateType>& rubbishReturnTransitions, const automaton::RealTimeHeightDeterministicNPDA < > & n); } /* namespace automaton */ diff --git a/alib2algo/src/automaton/determinize/common/RHDPDACommon.h b/alib2algo/src/automaton/determinize/common/RHDPDACommon.h index e5ec27ae04..b8ac97a0cb 100644 --- a/alib2algo/src/automaton/determinize/common/RHDPDACommon.h +++ b/alib2algo/src/automaton/determinize/common/RHDPDACommon.h @@ -31,13 +31,13 @@ ext::set<DefaultStateType> retrieveDSubSet(const ext::set<std::pair<DefaultState ext::set<std::pair<DefaultStateType, DefaultStateType>> createIdentity(const ext::set<DefaultStateType>& states); template<class T, class S, class R> -ext::set<DefaultStateType> existsDirtyState(const T& d, const ext::set<DefaultStateType>& rubbishStates, const std::map<std::pair<DefaultStateType, S>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const std::map<std::pair<DefaultStateType, S>, DefaultStateType>& rubbishLocalTransitions, const R& n); +ext::set<DefaultStateType> existsDirtyState(const T& d, const ext::set<DefaultStateType>& rubbishStates, const ext::map<std::pair<DefaultStateType, S>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const ext::map<std::pair<DefaultStateType, S>, DefaultStateType>& rubbishLocalTransitions, const R& n); void localClosure(ext::set<DefaultStateType>& states, const ext::set<DefaultStateType>& oldStates, const automaton::RealTimeHeightDeterministicDPDA < > & d); void localClosure(ext::set<DefaultStateType>& states, const ext::set<DefaultStateType>& oldStates, const automaton::VisiblyPushdownDPDA < > & d); template<class T, class S, class R> -ext::set<std::pair<DefaultStateType, DefaultSymbolType>> existsDirtyStateSymbol(const T& d, const ext::set<DefaultStateType>& rubbishStates, const std::map<std::pair<DefaultStateType, S>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const std::map<std::tuple<DefaultStateType, S, DefaultSymbolType>, DefaultStateType>& rubbishReturnTransitions, const R& n); +ext::set<std::pair<DefaultStateType, DefaultSymbolType>> existsDirtyStateSymbol(const T& d, const ext::set<DefaultStateType>& rubbishStates, const ext::map<std::pair<DefaultStateType, S>, std::pair<DefaultStateType, DefaultSymbolType> >& rubbishCallTransitions, const ext::map<std::tuple<DefaultStateType, S, DefaultSymbolType>, DefaultStateType>& rubbishReturnTransitions, const R& n); } /* namespace determinize */ diff --git a/alib2algo/src/automaton/generate/RandomAutomatonFactory.cpp b/alib2algo/src/automaton/generate/RandomAutomatonFactory.cpp index 42d41ea734..371c3e3199 100644 --- a/alib2algo/src/automaton/generate/RandomAutomatonFactory.cpp +++ b/alib2algo/src/automaton/generate/RandomAutomatonFactory.cpp @@ -135,7 +135,7 @@ automaton::NFA < > RandomAutomatonFactory::LeslieConnectedNFA( size_t n, const s automaton.addTransition( Q[ y ], alphabet [ a ], Q[ z ] ); } - std::map<DefaultSymbolType, bool> alphabetUsage; + ext::map<DefaultSymbolType, bool> alphabetUsage; for( const auto & a : automaton.getInputAlphabet( ) ) alphabetUsage[ a ] = false; for( const auto & t : automaton.getTransitions( ) ) diff --git a/alib2algo/src/automaton/generate/RandomizeAutomaton.h b/alib2algo/src/automaton/generate/RandomizeAutomaton.h index 7c7f701391..3b962f1fd2 100644 --- a/alib2algo/src/automaton/generate/RandomizeAutomaton.h +++ b/alib2algo/src/automaton/generate/RandomizeAutomaton.h @@ -38,7 +38,7 @@ public: template < class SymbolType, class StateType > automaton::DFA < SymbolType, StateType > RandomizeAutomaton::randomize(const automaton::DFA < SymbolType, StateType > & origFSM) { - std::map < StateType, StateType > statePermutationMap = common::Permutation::permutationMap ( origFSM.getStates ( ) ); + ext::map < StateType, StateType > statePermutationMap = common::Permutation::permutationMap ( origFSM.getStates ( ) ); automaton::DFA < SymbolType, StateType > res ( statePermutationMap.find ( origFSM.getInitialState ( ) )->second ); @@ -56,7 +56,7 @@ automaton::DFA < SymbolType, StateType > RandomizeAutomaton::randomize(const aut template < class SymbolType, class StateType > automaton::MultiInitialStateNFA < SymbolType, StateType > RandomizeAutomaton::randomize(const automaton::MultiInitialStateNFA < SymbolType, StateType > & origFSM) { - std::map < StateType, StateType > statePermutationMap = common::Permutation::permutationMap ( origFSM.getStates ( ) ); + ext::map < StateType, StateType > statePermutationMap = common::Permutation::permutationMap ( origFSM.getStates ( ) ); automaton::MultiInitialStateNFA < SymbolType, StateType > res; @@ -78,7 +78,7 @@ automaton::MultiInitialStateNFA < SymbolType, StateType > RandomizeAutomaton::ra template < class SymbolType, class StateType > automaton::NFA < SymbolType, StateType > RandomizeAutomaton::randomize(const automaton::NFA < SymbolType, StateType > & origFSM) { - std::map < StateType, StateType > statePermutationMap = common::Permutation::permutationMap ( origFSM.getStates ( ) ); + ext::map < StateType, StateType > statePermutationMap = common::Permutation::permutationMap ( origFSM.getStates ( ) ); automaton::NFA < SymbolType, StateType > res ( statePermutationMap.find ( origFSM.getInitialState ( ) )->second ); @@ -97,7 +97,7 @@ automaton::NFA < SymbolType, StateType > RandomizeAutomaton::randomize(const aut template < class SymbolType, class EpsilonType, class StateType > automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > RandomizeAutomaton::randomize( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & origFSM ) { - std::map < StateType, StateType > statePermutationMap = common::Permutation::permutationMap ( origFSM.getStates ( ) ); + ext::map < StateType, StateType > statePermutationMap = common::Permutation::permutationMap ( origFSM.getStates ( ) ); automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > res ( statePermutationMap.find ( origFSM.getInitialState ( ) )->second ); diff --git a/alib2algo/src/automaton/properties/AllEpsilonClosure.cpp b/alib2algo/src/automaton/properties/AllEpsilonClosure.cpp index 2de80301c2..0b410f1f64 100644 --- a/alib2algo/src/automaton/properties/AllEpsilonClosure.cpp +++ b/alib2algo/src/automaton/properties/AllEpsilonClosure.cpp @@ -12,14 +12,14 @@ namespace automaton { namespace properties { -auto AllEpsilonClosureEpsilonNFA = registration::OverloadRegister < AllEpsilonClosure, std::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::EpsilonNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); -auto AllEpsilonClosureMultiInitialStateNFA = registration::OverloadRegister < AllEpsilonClosure, std::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::MultiInitialStateNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); -auto AllEpsilonClosureNFA = registration::OverloadRegister < AllEpsilonClosure, std::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::NFA < > > ( AllEpsilonClosure::allEpsilonClosure ); -auto AllEpsilonClosureDFA = registration::OverloadRegister < AllEpsilonClosure, std::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::DFA < > > ( AllEpsilonClosure::allEpsilonClosure ); -auto AllEpsilonClosureExtendedNFA = registration::OverloadRegister < AllEpsilonClosure, std::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::ExtendedNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); -auto AllEpsilonClosureCompactNFA = registration::OverloadRegister < AllEpsilonClosure, std::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::CompactNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); - -std::map < DefaultStateType, ext::set < DefaultStateType > > AllEpsilonClosure::allEpsilonClosure ( const Automaton& automaton ) { +auto AllEpsilonClosureEpsilonNFA = registration::OverloadRegister < AllEpsilonClosure, ext::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::EpsilonNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); +auto AllEpsilonClosureMultiInitialStateNFA = registration::OverloadRegister < AllEpsilonClosure, ext::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::MultiInitialStateNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); +auto AllEpsilonClosureNFA = registration::OverloadRegister < AllEpsilonClosure, ext::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::NFA < > > ( AllEpsilonClosure::allEpsilonClosure ); +auto AllEpsilonClosureDFA = registration::OverloadRegister < AllEpsilonClosure, ext::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::DFA < > > ( AllEpsilonClosure::allEpsilonClosure ); +auto AllEpsilonClosureExtendedNFA = registration::OverloadRegister < AllEpsilonClosure, ext::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::ExtendedNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); +auto AllEpsilonClosureCompactNFA = registration::OverloadRegister < AllEpsilonClosure, ext::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::CompactNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); + +ext::map < DefaultStateType, ext::set < DefaultStateType > > AllEpsilonClosure::allEpsilonClosure ( const Automaton& automaton ) { return dispatch ( automaton.getData ( ) ); } diff --git a/alib2algo/src/automaton/properties/AllEpsilonClosure.h b/alib2algo/src/automaton/properties/AllEpsilonClosure.h index 6ffd89fe01..c121c95c20 100644 --- a/alib2algo/src/automaton/properties/AllEpsilonClosure.h +++ b/alib2algo/src/automaton/properties/AllEpsilonClosure.h @@ -30,30 +30,30 @@ namespace automaton { namespace properties { -class AllEpsilonClosure : public alib::SingleDispatch<AllEpsilonClosure, std::map<DefaultStateType, ext::set<DefaultStateType>>, const automaton::AutomatonBase &> { +class AllEpsilonClosure : public alib::SingleDispatch<AllEpsilonClosure, ext::map<DefaultStateType, ext::set<DefaultStateType>>, const automaton::AutomatonBase &> { public: - static std::map<DefaultStateType, ext::set<DefaultStateType>> allEpsilonClosure( const automaton::Automaton & automaton); + static ext::map<DefaultStateType, ext::set<DefaultStateType>> allEpsilonClosure( const automaton::Automaton & automaton); /** * Computes allEpsilon closure of a state in allEpsilon nonfree automaton */ template < class SymbolType, class EpsilonType, class StateType > - static std::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm); + static ext::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm); template < class SymbolType, class StateType > - static std::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm); + static ext::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm); template < class SymbolType, class StateType > - static std::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::NFA < SymbolType, StateType > & fsm); + static ext::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::NFA < SymbolType, StateType > & fsm); template < class SymbolType, class StateType > - static std::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::DFA < SymbolType, StateType > & fsm); + static ext::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::DFA < SymbolType, StateType > & fsm); template < class SymbolType, class StateType > - static std::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::ExtendedNFA < SymbolType, StateType > & fsm); + static ext::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::ExtendedNFA < SymbolType, StateType > & fsm); template < class SymbolType, class StateType > - static std::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::CompactNFA < SymbolType, StateType > & fsm); + static ext::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::CompactNFA < SymbolType, StateType > & fsm); }; template < class SymbolType, class EpsilonType, class StateType > -std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm) { - std::deque<std::map<StateType, ext::set<StateType>>> Qi; +ext::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm) { + std::deque<ext::map<StateType, ext::set<StateType>>> Qi; Qi.push_back({}); for(const StateType& state : fsm.getStates()) @@ -79,33 +79,33 @@ std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( c } template < class SymbolType, class StateType > -std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm) { - std::map<StateType, ext::set<StateType>> closure; +ext::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm) { + ext::map<StateType, ext::set<StateType>> closure; for(const StateType& state : fsm.getStates()) closure[state].insert(state); return closure; } template < class SymbolType, class StateType > -std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::NFA < SymbolType, StateType > & fsm) { - std::map<StateType, ext::set<StateType>> closure; +ext::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::NFA < SymbolType, StateType > & fsm) { + ext::map<StateType, ext::set<StateType>> closure; for(const StateType& state : fsm.getStates()) closure[state].insert(state); return closure; } template < class SymbolType, class StateType > -std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::DFA < SymbolType, StateType > & fsm) { - std::map<StateType, ext::set<StateType>> closure; +ext::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::DFA < SymbolType, StateType > & fsm) { + ext::map<StateType, ext::set<StateType>> closure; for(const StateType& state : fsm.getStates()) closure[state].insert(state); return closure; } template < class SymbolType, class StateType > -std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::ExtendedNFA < SymbolType, StateType > & fsm) { - std::map<StateType, ext::set<StateType>> res; - std::map<StateType, ext::set<StateType>> step; +ext::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::ExtendedNFA < SymbolType, StateType > & fsm) { + ext::map<StateType, ext::set<StateType>> res; + ext::map<StateType, ext::set<StateType>> step; for(const std::pair<const std::pair<StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set<StateType> >& transition : fsm.getTransitions() ) if( regexp::properties::RegExpEpsilon::languageContainsEpsilon( transition.first.second ) ) @@ -126,9 +126,9 @@ std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( c } template < class SymbolType, class StateType > -std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::CompactNFA < SymbolType, StateType > & fsm) { - std::map<StateType, ext::set<StateType>> res; - std::map<StateType, ext::set<StateType>> step; +ext::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::CompactNFA < SymbolType, StateType > & fsm) { + ext::map<StateType, ext::set<StateType>> res; + ext::map<StateType, ext::set<StateType>> step; for(const std::pair<const std::pair<StateType, ext::vector < SymbolType > >, ext::set<StateType> >& transition : fsm.getTransitions() ) if( transition.first.second.size() == 0 ) diff --git a/alib2algo/src/automaton/properties/EpsilonClosure.h b/alib2algo/src/automaton/properties/EpsilonClosure.h index d061e24bde..6d4b9c0788 100644 --- a/alib2algo/src/automaton/properties/EpsilonClosure.h +++ b/alib2algo/src/automaton/properties/EpsilonClosure.h @@ -58,7 +58,7 @@ ext::set<StateType> EpsilonClosure::epsilonClosure( const automaton::EpsilonNFA ext::set<StateType> closure; std::queue<StateType> queue; - std::map<StateType, bool> visited; + ext::map<StateType, bool> visited; for( const auto & p : fsm.getStates( ) ) visited[ p ] = false; @@ -114,7 +114,7 @@ ext::set<StateType> EpsilonClosure::epsilonClosure( const automaton::ExtendedNFA ext::set<StateType> closure; std::queue<StateType> queue; - std::map<StateType, bool> visited; + ext::map<StateType, bool> visited; for( const auto & p : fsm.getStates( ) ) visited[ p ] = false; @@ -142,7 +142,7 @@ ext::set<StateType> EpsilonClosure::epsilonClosure( const automaton::CompactNFA ext::set<StateType> closure; std::queue<StateType> queue; - std::map<StateType, bool> visited; + ext::map<StateType, bool> visited; for( const auto & p : fsm.getStates( ) ) visited[ p ] = false; diff --git a/alib2algo/src/automaton/simplify/EpsilonRemoverIncoming.h b/alib2algo/src/automaton/simplify/EpsilonRemoverIncoming.h index f472f5b14d..f6b81f441f 100644 --- a/alib2algo/src/automaton/simplify/EpsilonRemoverIncoming.h +++ b/alib2algo/src/automaton/simplify/EpsilonRemoverIncoming.h @@ -62,7 +62,7 @@ automaton::NFA < SymbolType, StateType > EpsilonRemoverIncoming::remove( const a fsm.setStates( origFSM.getStates() ); fsm.setInputAlphabet( origFSM.getInputAlphabet() ); - std::map<std::pair<StateType, SymbolType>, ext::set<StateType>> origTransitions = origFSM.getSymbolTransitions(); + ext::map<std::pair<StateType, SymbolType>, ext::set<StateType>> origTransitions = origFSM.getSymbolTransitions(); /** * Step 1 from Melichar 2.41 diff --git a/alib2algo/src/automaton/simplify/Minimize.h b/alib2algo/src/automaton/simplify/Minimize.h index 6733e2929a..767b83516c 100644 --- a/alib2algo/src/automaton/simplify/Minimize.h +++ b/alib2algo/src/automaton/simplify/Minimize.h @@ -39,7 +39,7 @@ public: private: template < class SymbolType, class StateType > - static void print_progress(const automaton::DFA < SymbolType, StateType >& dfa, const std::map<std::pair<StateType, ext::set<std::pair<SymbolType, StateType> > >, ext::set<StateType> >& minimizedTransitionFunction, size_t iter); + static void print_progress(const automaton::DFA < SymbolType, StateType >& dfa, const ext::map<std::pair<StateType, ext::set<std::pair<SymbolType, StateType> > >, ext::set<StateType> >& minimizedTransitionFunction, size_t iter); }; template < class SymbolType, class StateType > @@ -50,16 +50,16 @@ automaton::DFA < SymbolType, StateType > Minimize::minimize(const automaton::DFA return result; } - std::map<StateType, std::map<SymbolType, StateType > > refactor; + ext::map<StateType, ext::map<SymbolType, StateType > > refactor; for(const StateType& state : dfa.getStates()) - refactor.insert(std::make_pair(state, std::map<SymbolType, StateType>())); + refactor.insert(std::make_pair(state, ext::map<SymbolType, StateType>())); for(const std::pair<const std::pair<StateType, SymbolType>, StateType>& transition : dfa.getTransitions()) refactor[transition.first.first].insert(std::make_pair(transition.first.second, transition.second)); - std::map<StateType, StateType> toEquivalentStates; //original state to equivalent state - std::map<std::pair<StateType, ext::set<std::pair<SymbolType, StateType> > >, ext::set<StateType> > minimizedTransitionFunction; //mapped to the original state + ext::map<StateType, StateType> toEquivalentStates; //original state to equivalent state + ext::map<std::pair<StateType, ext::set<std::pair<SymbolType, StateType> > >, ext::set<StateType> > minimizedTransitionFunction; //mapped to the original state const StateType *firstFinal = NULL, *firstNonfinal = NULL; for(const StateType& state : dfa.getStates()) { @@ -77,7 +77,7 @@ automaton::DFA < SymbolType, StateType > Minimize::minimize(const automaton::DFA size_t delta_iter = 0; unsigned prevSize = 0; while ( true ) { - for(const std::pair<const StateType, std::map<SymbolType, StateType> >& transition : refactor) { + for(const std::pair<const StateType, ext::map<SymbolType, StateType> >& transition : refactor) { const StateType& from = toEquivalentStates.find(transition.first)->second; ext::set<std::pair<SymbolType, StateType> > transitionFunction; @@ -130,17 +130,17 @@ automaton::DFA < SymbolType, StateType > Minimize::minimize(const automaton::DFA #define RESETSS(x) {(x).clear(); (x).str("");} template < class SymbolType, class StateType > -void Minimize::print_progress(const automaton::DFA < SymbolType, StateType >& dfa, const std::map<std::pair<StateType, ext::set<std::pair<SymbolType, StateType> > >, ext::set<StateType> >& minimizedTransitionFunction, size_t iter) { +void Minimize::print_progress(const automaton::DFA < SymbolType, StateType >& dfa, const ext::map<std::pair<StateType, ext::set<std::pair<SymbolType, StateType> > >, ext::set<StateType> >& minimizedTransitionFunction, size_t iter) { std::clog << "delta " << iter << std::endl; - //std::map<std::pair<StateType, ext::set<std::pair<SymbolType, StateType> > >, ext::set<StateType> > minimizedTransitionFunction; //mapped to the original state + //ext::map<std::pair<StateType, ext::set<std::pair<SymbolType, StateType> > >, ext::set<StateType> > minimizedTransitionFunction; //mapped to the original state /* need to restruct this first so we have table like: orig state | new state | trans_symb_1 | trans_symb_2 | ... | trans_symb_n */ // we surely have DFA here (transition map hence) - std::map<std::pair<StateType, StateType>, std::map<SymbolType, StateType>> printMap; + ext::map<std::pair<StateType, StateType>, ext::map<SymbolType, StateType>> printMap; for(const auto& kv: minimizedTransitionFunction) { for(const auto& state : kv.second) { - std::map<SymbolType, StateType> stateTransMap; + ext::map<SymbolType, StateType> stateTransMap; for(const auto& transition : kv.first.second) { stateTransMap.insert(std::make_pair(transition.first, transition.second)); } @@ -149,7 +149,7 @@ void Minimize::print_progress(const automaton::DFA < SymbolType, StateType >& df } size_t stateWidth = 1, stateMapWidth = 1; - std::map<SymbolType, size_t> colWidths; + ext::map<SymbolType, size_t> colWidths; std::ostringstream ss; for(const SymbolType& symbol : dfa.getInputAlphabet()) { @@ -222,7 +222,7 @@ automaton::DFTA < SymbolType, RankType, StateType > Minimize::minimize(const aut typedef std::pair < const std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < StateType > >, StateType > Transition; - std::map<StateType, std::map<Transition, ext::vector<int>>> stateOccurences; + ext::map<StateType, ext::map<Transition, ext::vector<int>>> stateOccurences; for (const auto & state : dfta.getStates()) stateOccurences[state]; @@ -233,8 +233,8 @@ automaton::DFTA < SymbolType, RankType, StateType > Minimize::minimize(const aut stateOccurences[from[i]][transition].push_back(i); } - std::map <StateType, StateType> toEquivalentStates; - std::map<std::pair<StateType, std::map<std::tuple<common::ranked_symbol<SymbolType, RankType>, ext::vector<StateType>, StateType >, ext::set<int> > >, ext::set<StateType> > minimizedTransitionFunction; //mapped to the original states + ext::map <StateType, StateType> toEquivalentStates; + ext::map<std::pair<StateType, ext::map<std::tuple<common::ranked_symbol<SymbolType, RankType>, ext::vector<StateType>, StateType >, ext::set<int> > >, ext::set<StateType> > minimizedTransitionFunction; //mapped to the original states const StateType *firstFinal = NULL, *firstNonfinal = NULL; for (const StateType &state : dfta.getStates()) { if (dfta.getFinalStates().count(state) == 0) { // not a final state @@ -255,7 +255,7 @@ automaton::DFTA < SymbolType, RankType, StateType > Minimize::minimize(const aut for(const auto & occurencesOfState : stateOccurences) { const StateType & state = occurencesOfState.first; const StateType & equivalentState = toEquivalentStates.find(state) -> second; - std::map<std::tuple<common::ranked_symbol<SymbolType, RankType>, ext::vector<StateType>, StateType >, ext::set<int> > keyTransitionsPart; + ext::map<std::tuple<common::ranked_symbol<SymbolType, RankType>, ext::vector<StateType>, StateType >, ext::set<int> > keyTransitionsPart; for(const auto & transitionOccurences : occurencesOfState.second) { const auto & transition = transitionOccurences.first; diff --git a/alib2algo/src/automaton/simplify/Normalize.h b/alib2algo/src/automaton/simplify/Normalize.h index 0b92733709..0f3357eb15 100644 --- a/alib2algo/src/automaton/simplify/Normalize.h +++ b/alib2algo/src/automaton/simplify/Normalize.h @@ -33,7 +33,7 @@ public: template < class SymbolType, class StateType > automaton::DFA < SymbolType, unsigned > Normalize::normalize(const automaton::DFA < SymbolType, StateType > & fsm) { unsigned counter = 0; - std::map < StateType, unsigned > normalizationData; + ext::map < StateType, unsigned > normalizationData; std::deque < StateType > processingData; normalizationData.insert(std::make_pair(fsm.getInitialState(), counter++)); @@ -78,9 +78,9 @@ automaton::DFA < SymbolType, unsigned > Normalize::normalize(const automaton::DF template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > automaton::DPDA < InputSymbolType, EpsilonType, unsigned, unsigned > Normalize::normalize(const automaton::DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType > & pda) { unsigned counterState = 0; - std::map< StateType, unsigned > normalizationDataState; + ext::map< StateType, unsigned > normalizationDataState; unsigned counterSymbol = 0; - std::map < InputSymbolType, unsigned > normalizationDataSymbol; + ext::map < InputSymbolType, unsigned > normalizationDataSymbol; std::deque < StateType > processingData; normalizationDataState.insert(std::make_pair(pda.getInitialState(), counterState++)); @@ -91,7 +91,7 @@ automaton::DPDA < InputSymbolType, EpsilonType, unsigned, unsigned > Normalize:: StateType current = std::move ( processingData.front() ); processingData.pop_front(); - std::map < std::pair < ext::variant < EpsilonType, InputSymbolType >, ext::vector < unsigned > >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > transform; + ext::map < std::pair < ext::variant < EpsilonType, InputSymbolType >, ext::vector < unsigned > >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > transform; bool stateFinished = true; // For each transition from state current for ( const std::pair < const std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > & iter : pda.getTransitionsFromState(current)) { diff --git a/alib2algo/src/automaton/simplify/Rename.cpp b/alib2algo/src/automaton/simplify/Rename.cpp index 3d6546f9f9..5c8c5ecc4c 100644 --- a/alib2algo/src/automaton/simplify/Rename.cpp +++ b/alib2algo/src/automaton/simplify/Rename.cpp @@ -26,7 +26,7 @@ automaton::Automaton Rename::rename(const automaton::Automaton& automaton) { automaton::DFA<> Rename::rename(const automaton::DFA<>& fsm) { int counter = 0; - std::map<DefaultStateType, int > renamingData; + ext::map<DefaultStateType, int > renamingData; for(auto iter = fsm.getStates().begin(); iter != fsm.getStates().end(); iter++) { renamingData.insert(std::make_pair(*iter, counter++)); @@ -55,9 +55,9 @@ auto RenameDFA = registration::OverloadRegister < Rename, automaton::DFA < >, au automaton::DPDA < > Rename::rename(const automaton::DPDA < > & pda) { int counterState = 0; - std::map<DefaultStateType, int > renamingDataState; + ext::map<DefaultStateType, int > renamingDataState; int counterSymbol = 0; - std::map<DefaultSymbolType, int > renamingDataSymbol; + ext::map<DefaultSymbolType, int > renamingDataSymbol; for(const DefaultStateType & state : pda.getStates()) renamingDataState.insert(std::make_pair(state, counterState++)); @@ -97,9 +97,9 @@ auto RenameDPDA = registration::OverloadRegister < Rename, automaton::DPDA < >, automaton::SinglePopDPDA < > Rename::rename(const automaton::SinglePopDPDA < > & pda) { int counterState = 0; - std::map<DefaultStateType, int > renamingDataState; + ext::map<DefaultStateType, int > renamingDataState; int counterSymbol = 0; - std::map<DefaultSymbolType, int > renamingDataSymbol; + ext::map<DefaultSymbolType, int > renamingDataSymbol; for(auto iter = pda.getStates().begin(); iter != pda.getStates().end(); iter++) { renamingDataState.insert(std::make_pair(*iter, counterState++)); @@ -138,9 +138,9 @@ auto RenameSinglePopDPDA = registration::OverloadRegister < Rename, automaton::S automaton::InputDrivenDPDA < > Rename::rename(const automaton::InputDrivenDPDA < > & pda) { int counter = 0; - std::map<DefaultStateType, int > renamingData; + ext::map<DefaultStateType, int > renamingData; int counterSymbol = 0; - std::map<DefaultSymbolType, int > renamingDataSymbol; + ext::map<DefaultSymbolType, int > renamingDataSymbol; for(auto iter = pda.getStates().begin(); iter != pda.getStates().end(); iter++) { renamingData.insert(std::make_pair(*iter, counter++)); @@ -187,9 +187,9 @@ auto RenameInputDrivenDPDA = registration::OverloadRegister < Rename, automaton: automaton::VisiblyPushdownDPDA < > Rename::rename(const automaton::VisiblyPushdownDPDA < > & pda) { int counterState = 0; - std::map<DefaultStateType, int > renamingDataState; + ext::map<DefaultStateType, int > renamingDataState; int counterSymbol = 0; - std::map<DefaultSymbolType, int > renamingDataSymbol; + ext::map<DefaultSymbolType, int > renamingDataSymbol; for(auto iter = pda.getStates().begin(); iter != pda.getStates().end(); iter++) { renamingDataState.insert(std::make_pair(*iter, counterState++)); @@ -234,9 +234,9 @@ auto RenameVisiblyPushdownDPDA = registration::OverloadRegister < Rename, automa automaton::RealTimeHeightDeterministicDPDA < > Rename::rename(const automaton::RealTimeHeightDeterministicDPDA < > & pda) { int counterState = 0; - std::map<DefaultStateType, int > renamingDataState; + ext::map<DefaultStateType, int > renamingDataState; int counterSymbol = 0; - std::map<DefaultSymbolType, int > renamingDataSymbol; + ext::map<DefaultSymbolType, int > renamingDataSymbol; for(auto iter = pda.getStates().begin(); iter != pda.getStates().end(); iter++) { renamingDataState.insert(std::make_pair(*iter, counterState++)); diff --git a/alib2algo/src/automaton/simplify/UnreachableStatesRemover.h b/alib2algo/src/automaton/simplify/UnreachableStatesRemover.h index ff9932cbec..2eafc6e512 100644 --- a/alib2algo/src/automaton/simplify/UnreachableStatesRemover.h +++ b/alib2algo/src/automaton/simplify/UnreachableStatesRemover.h @@ -134,7 +134,7 @@ automaton::DFTA < SymbolType, RankType, StateType > UnreachableStatesRemover::re transitionsUnreachableCount.reserve(dfta.getTransitions().size()); //for a state, transitions with unreachable count (initially all unreachable) and number of occurences of this state (at least 1) - std::map<StateType, std::map<std::pair<const Transition *, int> *, int>> stateOccurences; + ext::map<StateType, ext::map<std::pair<const Transition *, int> *, int>> stateOccurences; std::deque<StateType> queue; for(const auto & transition : dfta.getTransitions()) { if (transition.first.second.empty()) { diff --git a/alib2algo/src/automaton/simplify/UselessStatesRemover.h b/alib2algo/src/automaton/simplify/UselessStatesRemover.h index f8c47556e9..94d5ee7bfe 100644 --- a/alib2algo/src/automaton/simplify/UselessStatesRemover.h +++ b/alib2algo/src/automaton/simplify/UselessStatesRemover.h @@ -142,7 +142,7 @@ automaton::DFTA < SymbolType, RankType, StateType > UselessStatesRemover::remove typedef std::pair < const std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < StateType > >, StateType > Transition; - std::map<StateType, ext::set<const Transition *>> transitionsToState; + ext::map<StateType, ext::set<const Transition *>> transitionsToState; for(const auto & transition : dfta.getTransitions()) { transitionsToState[transition.second].insert(&transition); } diff --git a/alib2algo/src/automaton/transform/Compaction.h b/alib2algo/src/automaton/transform/Compaction.h index bb9dc400d5..30fb99435b 100644 --- a/alib2algo/src/automaton/transform/Compaction.h +++ b/alib2algo/src/automaton/transform/Compaction.h @@ -69,7 +69,7 @@ automaton::CompactNFA < SymbolType, StateType > Compaction::convert(const automa ext::vector < SymbolType > path { symbol }; - ext::range < typename std::map < std::pair < StateType, SymbolType >, StateType >::const_iterator > transitions; + ext::range < typename ext::map < std::pair < StateType, SymbolType >, StateType >::const_iterator > transitions; // only 1 child and nonfinal while((transitions = automaton.getTransitionsFromState(q)).size() == 1 && automaton.getFinalStates().count(q) == 0) { const std::pair<std::pair<StateType, SymbolType>, StateType>& transition = * transitions.begin(); diff --git a/alib2algo/src/automaton/transform/RHPDAToPDA.cpp b/alib2algo/src/automaton/transform/RHPDAToPDA.cpp index 5698f1eee8..338524400c 100644 --- a/alib2algo/src/automaton/transform/RHPDAToPDA.cpp +++ b/alib2algo/src/automaton/transform/RHPDAToPDA.cpp @@ -26,7 +26,7 @@ namespace automaton { template < class T > -void constructTransitions ( const std::tuple < DefaultStateType, DefaultSymbolType, ext::vector < DefaultSymbolType > > & stFirst, const std::map < DefaultStateType, ext::set < std::tuple < ext::vector < DefaultSymbolType >, DefaultStateType, ext::vector < DefaultSymbolType > > > > & epsilonTransitions, const DefaultStateType & toState, ext::vector < DefaultSymbolType > pops, ext::vector < DefaultSymbolType > pushes, T & res ) { +void constructTransitions ( const std::tuple < DefaultStateType, DefaultSymbolType, ext::vector < DefaultSymbolType > > & stFirst, const ext::map < DefaultStateType, ext::set < std::tuple < ext::vector < DefaultSymbolType >, DefaultStateType, ext::vector < DefaultSymbolType > > > > & epsilonTransitions, const DefaultStateType & toState, ext::vector < DefaultSymbolType > pops, ext::vector < DefaultSymbolType > pushes, T & res ) { auto epsIter = epsilonTransitions.find ( toState ); if ( ( epsIter != epsilonTransitions.end ( ) ) && !epsIter->second.empty ( ) ) { @@ -57,8 +57,8 @@ void constructTransitions ( const std::tuple < DefaultStateType, DefaultSymbolTy } automaton::DPDA < > RHPDAToPDA::convert ( const automaton::RealTimeHeightDeterministicDPDA < > & pda ) { - std::map < std::tuple < DefaultStateType, DefaultSymbolType, ext::vector < DefaultSymbolType > >, ext::set < std::pair < DefaultStateType, ext::vector < DefaultSymbolType > > > > readingTransitions; - std::map < DefaultStateType, ext::set < std::tuple < ext::vector < DefaultSymbolType >, DefaultStateType, ext::vector < DefaultSymbolType > > > > epsilonTransitions; + ext::map < std::tuple < DefaultStateType, DefaultSymbolType, ext::vector < DefaultSymbolType > >, ext::set < std::pair < DefaultStateType, ext::vector < DefaultSymbolType > > > > readingTransitions; + ext::map < DefaultStateType, ext::set < std::tuple < ext::vector < DefaultSymbolType >, DefaultStateType, ext::vector < DefaultSymbolType > > > > epsilonTransitions; for ( const auto & transition : pda.getCallTransitions ( ) ) { if ( std::get < 1 > ( transition.first ).is < DefaultEpsilonType > ( ) ) { @@ -160,8 +160,8 @@ auto RHPDAToPDARealTimeHeightDeterministicDPDA = registration::OverloadRegister // This may not work correctly -- generation of initial state and initial symbol automaton::NPDA < > RHPDAToPDA::convert ( const automaton::RealTimeHeightDeterministicNPDA < > & pda ) { - std::map < std::tuple < DefaultStateType, DefaultSymbolType, ext::vector < DefaultSymbolType > >, ext::set < std::pair < DefaultStateType, ext::vector < DefaultSymbolType > > > > readingTransitions; - std::map < DefaultStateType, ext::set < std::tuple < ext::vector < DefaultSymbolType >, DefaultStateType, ext::vector < DefaultSymbolType > > > > epsilonTransitions; + ext::map < std::tuple < DefaultStateType, DefaultSymbolType, ext::vector < DefaultSymbolType > >, ext::set < std::pair < DefaultStateType, ext::vector < DefaultSymbolType > > > > readingTransitions; + ext::map < DefaultStateType, ext::set < std::tuple < ext::vector < DefaultSymbolType >, DefaultStateType, ext::vector < DefaultSymbolType > > > > epsilonTransitions; for ( const auto & transition : pda.getCallTransitions ( ) ) { if ( std::get < 1 > ( transition.first ).is < DefaultEpsilonType > ( ) ) { diff --git a/alib2algo/src/common/Permutation.hpp b/alib2algo/src/common/Permutation.hpp index 950cd6c900..6a4209cc44 100644 --- a/alib2algo/src/common/Permutation.hpp +++ b/alib2algo/src/common/Permutation.hpp @@ -22,11 +22,11 @@ namespace common { class Permutation { public: template < class T > - static std::map < T, T > permutationMap ( const ext::set < T > & data ) { + static ext::map < T, T > permutationMap ( const ext::set < T > & data ) { ext::vector < T > dataVector ( data.begin ( ), data.end ( ) ); std::shuffle ( dataVector.begin ( ), dataVector.end ( ), ext::random_devices::semirandom ); - std::map < T, T > permutation; + ext::map < T, T > permutation; for ( const std::tuple < const T &, const T & > & fromToPair : ext::make_tuple_foreach ( data, dataVector ) ) { permutation.insert ( std::make_pair ( std::get < 0 > ( fromToPair ), std::get < 1 > ( fromToPair ) ) ); } diff --git a/alib2algo/src/equations/RegularEquationSolver.h b/alib2algo/src/equations/RegularEquationSolver.h index fd61ebb992..5fe447c2bf 100644 --- a/alib2algo/src/equations/RegularEquationSolver.h +++ b/alib2algo/src/equations/RegularEquationSolver.h @@ -95,12 +95,12 @@ protected: /** * Stores transitions from nonterminal to nonterminal, eg A = 2A + 2B + 1C */ - std::map<std::pair<SymbolType, SymbolType>, regexp::UnboundedRegExpAlternation < SymbolType > > equationTransition; + ext::map<std::pair<SymbolType, SymbolType>, regexp::UnboundedRegExpAlternation < SymbolType > > equationTransition; /** * Stores equation not going to particular nonterminal, eg A = 01* */ - std::map<SymbolType, regexp::UnboundedRegExpAlternation < SymbolType > > equationFinal; + ext::map<SymbolType, regexp::UnboundedRegExpAlternation < SymbolType > > equationFinal; /** * Set of symbols @@ -192,7 +192,7 @@ void RegularEquationSolver < SymbolType >::addEquation(const SymbolType& from, c template < class SymbolType > void RegularEquationSolver < SymbolType >::sortSymbolsByDepth(const SymbolType& solveFor) { - std::map<SymbolType, bool> visited; + ext::map<SymbolType, bool> visited; std::queue<SymbolType> queue; for(const auto& symbol : nonterminalSymbols) { diff --git a/alib2algo/src/grammar/convert/ToAutomaton.cpp b/alib2algo/src/grammar/convert/ToAutomaton.cpp index af88133022..a4e335f234 100644 --- a/alib2algo/src/grammar/convert/ToAutomaton.cpp +++ b/alib2algo/src/grammar/convert/ToAutomaton.cpp @@ -21,7 +21,7 @@ automaton::Automaton ToAutomaton::convert(const grammar::Grammar& grammar) { } automaton::NFA < > ToAutomaton::convert(const grammar::LeftRG < > & grammar) { - std::map<DefaultSymbolType, DefaultStateType> stateMap; + ext::map<DefaultSymbolType, DefaultStateType> stateMap; ext::set<DefaultStateType> states; // step 2 @@ -64,7 +64,7 @@ automaton::NFA < > ToAutomaton::convert(const grammar::LeftRG < > & grammar) { auto ToAutomatonLeftRG = registration::OverloadRegister < ToAutomaton, automaton::NFA < >, grammar::LeftRG < > > ( ToAutomaton::convert ); automaton::NFA < > ToAutomaton::convert(const grammar::RightRG < > & grammar) { - std::map<DefaultSymbolType, DefaultStateType> stateMap; + ext::map<DefaultSymbolType, DefaultStateType> stateMap; ext::set<DefaultStateType> states; // step2 diff --git a/alib2algo/src/grammar/convert/ToAutomatonBottomUp.h b/alib2algo/src/grammar/convert/ToAutomatonBottomUp.h index 9a37fd2d08..206898013c 100644 --- a/alib2algo/src/grammar/convert/ToAutomatonBottomUp.h +++ b/alib2algo/src/grammar/convert/ToAutomatonBottomUp.h @@ -57,7 +57,7 @@ automaton::NPDA < SymbolType, EpsilonType, SymbolType, StateType > ToAutomatonBo for(const SymbolType& symbol : grammar.getTerminalAlphabet()) automaton.addTransition(automaton.getInitialState(), symbol, ext::vector<SymbolType>{}, automaton.getInitialState(), ext::vector<SymbolType>{symbol}); - //for(const std::map<SymbolType, ext::set<ext::vector<SymbolType>>>& kv : grammar.getRules()) + //for(const ext::map<SymbolType, ext::set<ext::vector<SymbolType>>>& kv : grammar.getRules()) for(const auto& kv : grammar.getRules()) for(const ext::vector<SymbolType>& rhs : kv.second) automaton.addTransition(automaton.getInitialState(), rhs, automaton.getInitialState(), ext::vector<SymbolType>{kv.first}); diff --git a/alib2algo/src/grammar/generate/GenerateUpToLength.h b/alib2algo/src/grammar/generate/GenerateUpToLength.h index 80e15e879f..0cd2ae45bf 100644 --- a/alib2algo/src/grammar/generate/GenerateUpToLength.h +++ b/alib2algo/src/grammar/generate/GenerateUpToLength.h @@ -40,7 +40,7 @@ template < class T, class SymbolType > ext::set < string::LinearString < SymbolType > > GenerateUpToLength::generate ( const T & grammar, unsigned length ) { ext::set < string::LinearString < SymbolType > > res; - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > rules = grammar.getRawRules(); + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > rules = grammar.getRawRules(); if ( grammar.getGeneratesEpsilon ( ) ) { res.insert ( string::LinearString < SymbolType > { } ); rules [ grammar.getInitialSymbol ( ) ].erase ( ext::vector < SymbolType > { } ); diff --git a/alib2algo/src/grammar/generate/RandomizeGrammar.h b/alib2algo/src/grammar/generate/RandomizeGrammar.h index 5220e51a27..7b8c580b86 100644 --- a/alib2algo/src/grammar/generate/RandomizeGrammar.h +++ b/alib2algo/src/grammar/generate/RandomizeGrammar.h @@ -42,7 +42,7 @@ public: template < class SymbolType > grammar::LeftRG < SymbolType > RandomizeGrammar::randomize ( const grammar::LeftRG < SymbolType > & gram ) { - std::map < SymbolType, SymbolType > symbolPermutationMap = common::Permutation::permutationMap ( gram.getNonterminalAlphabet ( ) ); + ext::map < SymbolType, SymbolType > symbolPermutationMap = common::Permutation::permutationMap ( gram.getNonterminalAlphabet ( ) ); grammar::LeftRG < SymbolType > res ( symbolPermutationMap.find ( gram.getInitialSymbol ( ) )->second ); @@ -61,7 +61,7 @@ grammar::LeftRG < SymbolType > RandomizeGrammar::randomize ( const grammar::Left template < class SymbolType > grammar::LeftLG < SymbolType > RandomizeGrammar::randomize ( const grammar::LeftLG < SymbolType > & gram ) { - std::map < SymbolType, SymbolType > symbolPermutationMap = common::Permutation::permutationMap ( gram.getNonterminalAlphabet ( ) ); + ext::map < SymbolType, SymbolType > symbolPermutationMap = common::Permutation::permutationMap ( gram.getNonterminalAlphabet ( ) ); grammar::LeftLG < SymbolType > res ( symbolPermutationMap.find ( gram.getInitialSymbol ( ) )->second ); @@ -80,7 +80,7 @@ grammar::LeftLG < SymbolType > RandomizeGrammar::randomize ( const grammar::Left template < class SymbolType > grammar::RightRG < SymbolType > RandomizeGrammar::randomize ( const grammar::RightRG < SymbolType > & gram ) { - std::map < SymbolType, SymbolType > symbolPermutationMap = common::Permutation::permutationMap ( gram.getNonterminalAlphabet ( ) ); + ext::map < SymbolType, SymbolType > symbolPermutationMap = common::Permutation::permutationMap ( gram.getNonterminalAlphabet ( ) ); grammar::RightRG < SymbolType > res ( symbolPermutationMap.find ( gram.getInitialSymbol ( ) )->second ); @@ -99,7 +99,7 @@ grammar::RightRG < SymbolType > RandomizeGrammar::randomize ( const grammar::Rig template < class SymbolType > grammar::RightLG < SymbolType > RandomizeGrammar::randomize ( const grammar::RightLG < SymbolType > & gram ) { - std::map < SymbolType, SymbolType > symbolPermutationMap = common::Permutation::permutationMap ( gram.getNonterminalAlphabet ( ) ); + ext::map < SymbolType, SymbolType > symbolPermutationMap = common::Permutation::permutationMap ( gram.getNonterminalAlphabet ( ) ); grammar::RightLG < SymbolType > res ( symbolPermutationMap.find ( gram.getInitialSymbol ( ) )->second ); @@ -118,7 +118,7 @@ grammar::RightLG < SymbolType > RandomizeGrammar::randomize ( const grammar::Rig template < class SymbolType > grammar::CFG < SymbolType > RandomizeGrammar::randomize ( const grammar::CFG < SymbolType > & gram ) { - std::map < SymbolType, SymbolType > symbolPermutationMap = common::Permutation::permutationMap ( gram.getNonterminalAlphabet ( ) ); + ext::map < SymbolType, SymbolType > symbolPermutationMap = common::Permutation::permutationMap ( gram.getNonterminalAlphabet ( ) ); grammar::CFG < SymbolType > res ( symbolPermutationMap.find ( gram.getInitialSymbol ( ) )->second ); diff --git a/alib2algo/src/grammar/simplify/Rename.cpp b/alib2algo/src/grammar/simplify/Rename.cpp index 68b15334f6..304615439e 100644 --- a/alib2algo/src/grammar/simplify/Rename.cpp +++ b/alib2algo/src/grammar/simplify/Rename.cpp @@ -29,7 +29,7 @@ grammar::Grammar Rename::rename ( const grammar::Grammar & grammar ) { grammar::RightRG < > Rename::rename ( const grammar::RightRG < > & rrg ) { int counter = 0; - std::map < DefaultSymbolType, DefaultSymbolType > renamingData; + ext::map < DefaultSymbolType, DefaultSymbolType > renamingData; for ( auto iter = rrg.getNonterminalAlphabet ( ).begin ( ); iter != rrg.getNonterminalAlphabet ( ).end ( ); iter++ ) renamingData.insert ( std::make_pair ( * iter, DefaultSymbolType ( ext::toBase26 ( counter++ ) ) ) ); @@ -67,7 +67,7 @@ auto RenameRightRG = registration::OverloadRegister < Rename, grammar::RightRG < grammar::LeftRG < > Rename::rename ( const grammar::LeftRG < > & rrg ) { int counter = 0; - std::map < DefaultSymbolType, DefaultSymbolType > renamingData; + ext::map < DefaultSymbolType, DefaultSymbolType > renamingData; for ( auto iter = rrg.getNonterminalAlphabet ( ).begin ( ); iter != rrg.getNonterminalAlphabet ( ).end ( ); iter++ ) renamingData.insert ( std::make_pair ( * iter, DefaultSymbolType ( ext::toBase26 ( counter++ ) ) ) ); diff --git a/alib2algo/src/grammar/simplify/ToCNF.cpp b/alib2algo/src/grammar/simplify/ToCNF.cpp index 83aca501c8..5149a0cdf5 100644 --- a/alib2algo/src/grammar/simplify/ToCNF.cpp +++ b/alib2algo/src/grammar/simplify/ToCNF.cpp @@ -19,7 +19,7 @@ namespace grammar { namespace simplify { template<class T> -std::pair<DefaultSymbolType, DefaultSymbolType> splitToPairs(T& grammar, const ext::vector<DefaultSymbolType>& rhs, unsigned from, unsigned size, std::map<DefaultSymbolType, DefaultSymbolType>& createdSymbols) { +std::pair<DefaultSymbolType, DefaultSymbolType> splitToPairs(T& grammar, const ext::vector<DefaultSymbolType>& rhs, unsigned from, unsigned size, ext::map<DefaultSymbolType, DefaultSymbolType>& createdSymbols) { if(size == 2) { return std::make_pair(rhs[from], rhs[from + 1]); } else if(size == 3) { @@ -62,7 +62,7 @@ grammar::CNF < > convertInternal( const T & origGrammar ) { grammarTmp.setNonterminalAlphabet(origGrammar.getNonterminalAlphabet() ); grammarTmp.setTerminalAlphabet( origGrammar.getTerminalAlphabet() ); - std::map<DefaultSymbolType, DefaultSymbolType> createdSymbols; + ext::map<DefaultSymbolType, DefaultSymbolType> createdSymbols; auto origRules = origGrammar.getRawRules(); for( const auto & origRule : origRules ) { for( const auto& origRhs : origRule.second ) { @@ -83,7 +83,7 @@ grammar::CNF < > convertInternal( const T & origGrammar ) { grammar.setNonterminalAlphabet( grammarTmp.getNonterminalAlphabet() ); grammar.setTerminalAlphabet( grammarTmp.getTerminalAlphabet() ); - std::map<DefaultSymbolType, DefaultSymbolType> terminalToShadowNonterminal; + ext::map<DefaultSymbolType, DefaultSymbolType> terminalToShadowNonterminal; for( const auto & symbol : grammarTmp.getTerminalAlphabet() ) { DefaultSymbolType shadowSymbol = common::createUnique(symbol, grammar.getTerminalAlphabet(), grammar.getNonterminalAlphabet()); terminalToShadowNonterminal.insert( std::make_pair( symbol, shadowSymbol )); diff --git a/alib2algo/src/grammar/simplify/ToGNF.h b/alib2algo/src/grammar/simplify/ToGNF.h index 6fd0f8ed5d..a5c432d1ac 100644 --- a/alib2algo/src/grammar/simplify/ToGNF.h +++ b/alib2algo/src/grammar/simplify/ToGNF.h @@ -106,7 +106,7 @@ grammar::GNF < SymbolType > ToGNF::convertInternal( const grammar::EpsilonFreeCF res.setTerminalAlphabet(step.getTerminalAlphabet()); res.setNonterminalAlphabet(step.getNonterminalAlphabet()); res.setGeneratesEpsilon(step.getGeneratesEpsilon()); - std::map<SymbolType, SymbolType> terminalToPrimed; + ext::map<SymbolType, SymbolType> terminalToPrimed; for(const SymbolType& terminal : step.getTerminalAlphabet()) { SymbolType primed = common::createUnique(terminal, res.getTerminalAlphabet(), res.getNonterminalAlphabet()); terminalToPrimed.insert(std::make_pair(terminal, primed)); diff --git a/alib2algo/src/regexp/convert/ToAutomatonDerivation.cpp b/alib2algo/src/regexp/convert/ToAutomatonDerivation.cpp index ae7de0b79b..8d6def7e9a 100644 --- a/alib2algo/src/regexp/convert/ToAutomatonDerivation.cpp +++ b/alib2algo/src/regexp/convert/ToAutomatonDerivation.cpp @@ -62,7 +62,7 @@ automaton::DFA<> ToAutomatonDerivation::convert(const T& regexp) { i += 1; } - std::map<regexp::RegExp, DefaultStateType> stateMap; + ext::map<regexp::RegExp, DefaultStateType> stateMap; int stateId = 0; for(const auto& r : Q) { diff --git a/alib2algo/src/regexp/convert/ToGrammarRightRGDerivation.cpp b/alib2algo/src/regexp/convert/ToGrammarRightRGDerivation.cpp index a6f62b4d28..7339d3f809 100644 --- a/alib2algo/src/regexp/convert/ToGrammarRightRGDerivation.cpp +++ b/alib2algo/src/regexp/convert/ToGrammarRightRGDerivation.cpp @@ -65,7 +65,7 @@ grammar::RightRG < > ToGrammarRightRGDerivation::convert(const T& regexp) { // 3. int nonterminalId = 0; - std::map<regexp::RegExp, DefaultSymbolType> nonterminalMap; + ext::map<regexp::RegExp, DefaultSymbolType> nonterminalMap; DefaultSymbolType ntV(nonterminalId++); nonterminalMap.insert(std::make_pair(V, ntV)); diff --git a/alib2algo/src/rte/convert/ToPostfixPushdownAutomatonGlushkov.cpp b/alib2algo/src/rte/convert/ToPostfixPushdownAutomatonGlushkov.cpp index 140fefe3e6..2ca12a3f59 100644 --- a/alib2algo/src/rte/convert/ToPostfixPushdownAutomatonGlushkov.cpp +++ b/alib2algo/src/rte/convert/ToPostfixPushdownAutomatonGlushkov.cpp @@ -47,7 +47,7 @@ automaton::NPDA < > ToPostfixPushdownAutomatonGlushkov::convert ( const rte::For const ext::set < common::ranked_symbol < > > firstSet = rte::GlushkovFirst::first ( indexedRTE ); // - follow set for every element of (non-indexed) RTE alphabet element - std::map < common::ranked_symbol < >, ext::set < ext::vector < common::ranked_symbol < > > > > followSet; + ext::map < common::ranked_symbol < >, ext::set < ext::vector < common::ranked_symbol < > > > > followSet; for ( const common::ranked_symbol < > & symbol : indexedRTE.getAlphabet ( ) ) followSet.insert ( std::make_pair ( symbol, rte::GlushkovFollow::follow ( indexedRTE, symbol ) ) ); diff --git a/alib2algo/src/rte/glushkov/GlushkovFollow.h b/alib2algo/src/rte/glushkov/GlushkovFollow.h index bfd0ef1ee5..aece7eddd0 100644 --- a/alib2algo/src/rte/glushkov/GlushkovFollow.h +++ b/alib2algo/src/rte/glushkov/GlushkovFollow.h @@ -26,9 +26,9 @@ namespace rte { class GlushkovFollow { template < class SymbolType, class RankType > - static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > replaceConstants ( const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, const ext::vector < common::ranked_symbol < SymbolType, RankType > > & follow, const std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap2 ); + static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > replaceConstants ( const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, const ext::vector < common::ranked_symbol < SymbolType, RankType > > & follow, const ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap2 ); template < class SymbolType, class RankType > - static void preprocessSubMap ( const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap ); + static void preprocessSubMap ( const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap ); template < class T > static ext::vector < ext::vector < T > > cartesian ( const ext::vector < ext::vector < T > > & input ); template < class T > @@ -45,19 +45,19 @@ public: template < class SymbolType, class RankType > class Formal { public: - static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTEElement < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); - static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTEAlternation < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); - static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTESubstitution < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); - static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTEIteration < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); - static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTESymbolAlphabet < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); - static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTESymbolSubst < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); - static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTEEmpty < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); + static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTEElement < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); + static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTEAlternation < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); + static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTESubstitution < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); + static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTEIteration < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); + static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTESymbolAlphabet < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); + static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTESymbolSubst < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); + static ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > visit ( const rte::FormalRTEEmpty < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbol, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subM ); }; }; template < class SymbolType, class RankType > ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::follow ( const rte::FormalRTE < SymbolType, RankType > & rte, const common::ranked_symbol < SymbolType, RankType > & symbol ) { - std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > subMap; + ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > subMap; /* Init substitution map, ie \forall a \in K: sub[a] = \emptyset */ for ( const common::ranked_symbol < SymbolType, RankType > & ssymb : rte.getSubstitutionAlphabet ( ) ) @@ -92,7 +92,7 @@ ext::vector < ext::vector < T > > GlushkovFollow::cartesian ( const ext::vector } template < class SymbolType, class RankType > -void GlushkovFollow::preprocessSubMap ( const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap ) { +void GlushkovFollow::preprocessSubMap ( const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap ) { for ( bool change = true; change; change = false ) for ( std::pair < const common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & kv : subMap ) { ext::set < common::ranked_symbol < SymbolType, RankType > > & substSet = kv.second; @@ -112,8 +112,8 @@ void GlushkovFollow::preprocessSubMap ( const ext::set < common::ranked_symbol < } template < class SymbolType, class RankType > -ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::replaceConstants ( const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, const ext::vector < common::ranked_symbol < SymbolType, RankType > > & follow, const std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap2 ) { - std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > subMap ( subMap2 ); +ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::replaceConstants ( const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, const ext::vector < common::ranked_symbol < SymbolType, RankType > > & follow, const ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap2 ) { + ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > subMap ( subMap2 ); preprocessSubMap ( alphabetK, subMap ); ext::vector < ext::vector < common::ranked_symbol < SymbolType, RankType > > > input; @@ -133,7 +133,7 @@ ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > Glus // ----------------------------------------------------------------------------- template < class SymbolType, class RankType > -ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::Formal < SymbolType, RankType >::visit ( const rte::FormalRTEAlternation < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbolF, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap ) { +ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::Formal < SymbolType, RankType >::visit ( const rte::FormalRTEAlternation < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbolF, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap ) { ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > ret, tmp; tmp = node.getLeftElement ( ).template accept < ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > >, GlushkovFollow::Formal < SymbolType, RankType > > ( symbolF, alphabetK, subMap ); @@ -146,9 +146,9 @@ ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > Glus } template < class SymbolType, class RankType > -ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::Formal < SymbolType, RankType >::visit ( const rte::FormalRTESubstitution < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbolF, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap ) { +ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::Formal < SymbolType, RankType >::visit ( const rte::FormalRTESubstitution < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbolF, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap ) { - std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > subMap2 ( subMap ); + ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > subMap2 ( subMap ); auto itMap = subMap2.find ( node.getSubstitutionSymbol ( ).getSymbol ( ) ); itMap->second.clear ( ); @@ -169,7 +169,7 @@ ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > Glus } template < class SymbolType, class RankType > -ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::Formal < SymbolType, RankType >::visit ( const rte::FormalRTEIteration < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbolF, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap ) { +ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::Formal < SymbolType, RankType >::visit ( const rte::FormalRTEIteration < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbolF, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap ) { ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > ret; @@ -180,7 +180,7 @@ ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > Glus } template < class SymbolType, class RankType > -ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::Formal < SymbolType, RankType >::visit ( const rte::FormalRTESymbolAlphabet < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbolF, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap ) { +ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::Formal < SymbolType, RankType >::visit ( const rte::FormalRTESymbolAlphabet < SymbolType, RankType > & node, const common::ranked_symbol < SymbolType, RankType > & symbolF, const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabetK, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & subMap ) { ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > ret, tmp; @@ -202,12 +202,12 @@ ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > Glus } template < class SymbolType, class RankType > -ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::Formal < SymbolType, RankType >::visit ( const rte::FormalRTESymbolSubst < SymbolType, RankType > & /* node */, const common::ranked_symbol < SymbolType, RankType > & /* symbolF */, const ext::set < common::ranked_symbol < SymbolType, RankType > > & /* alphabetK */, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & /* subMap */ ) { +ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::Formal < SymbolType, RankType >::visit ( const rte::FormalRTESymbolSubst < SymbolType, RankType > & /* node */, const common::ranked_symbol < SymbolType, RankType > & /* symbolF */, const ext::set < common::ranked_symbol < SymbolType, RankType > > & /* alphabetK */, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & /* subMap */ ) { return ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > ( ); } template < class SymbolType, class RankType > -ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::Formal < SymbolType, RankType >::visit ( const rte::FormalRTEEmpty < SymbolType, RankType > & /* node */, const common::ranked_symbol < SymbolType, RankType > & /* symbolF */, const ext::set < common::ranked_symbol < SymbolType, RankType > > & /* alphabetK */, std::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & /* subMap */ ) { +ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > GlushkovFollow::Formal < SymbolType, RankType >::visit ( const rte::FormalRTEEmpty < SymbolType, RankType > & /* node */, const common::ranked_symbol < SymbolType, RankType > & /* symbolF */, const ext::set < common::ranked_symbol < SymbolType, RankType > > & /* alphabetK */, ext::map < common::ranked_symbol < SymbolType, RankType >, ext::set < common::ranked_symbol < SymbolType, RankType > > > & /* subMap */ ) { return ext::set < ext::vector < common::ranked_symbol < SymbolType, RankType > > > ( ); } diff --git a/alib2algo/src/string/properties/BadCharacterShiftTable.cpp b/alib2algo/src/string/properties/BadCharacterShiftTable.cpp index 0237803dca..99a3fdff80 100644 --- a/alib2algo/src/string/properties/BadCharacterShiftTable.cpp +++ b/alib2algo/src/string/properties/BadCharacterShiftTable.cpp @@ -12,11 +12,11 @@ namespace string { namespace properties { -std::map<DefaultSymbolType, size_t> BadCharacterShiftTable::bcs(const string::String& pattern) { +ext::map<DefaultSymbolType, size_t> BadCharacterShiftTable::bcs(const string::String& pattern) { return dispatch(pattern.getData()); } -auto BadCharacterShiftTableLinearString = registration::OverloadRegister < BadCharacterShiftTable, std::map < DefaultSymbolType, size_t >, string::LinearString < > > ( BadCharacterShiftTable::bcs ); +auto BadCharacterShiftTableLinearString = registration::OverloadRegister < BadCharacterShiftTable, ext::map < DefaultSymbolType, size_t >, string::LinearString < > > ( BadCharacterShiftTable::bcs ); } /* namespace properties */ diff --git a/alib2algo/src/string/properties/BadCharacterShiftTable.h b/alib2algo/src/string/properties/BadCharacterShiftTable.h index 71f8bc6c67..710333e73d 100644 --- a/alib2algo/src/string/properties/BadCharacterShiftTable.h +++ b/alib2algo/src/string/properties/BadCharacterShiftTable.h @@ -25,23 +25,23 @@ namespace properties { * Computation of BCS table for BMH from MI(E+\eps)-EVY course 2014 * To get rid of zeros in BCS table we ignore last haystack character */ -class BadCharacterShiftTable : public alib::SingleDispatch < BadCharacterShiftTable, std::map < DefaultSymbolType, size_t >, const string::StringBase & > { +class BadCharacterShiftTable : public alib::SingleDispatch < BadCharacterShiftTable, ext::map < DefaultSymbolType, size_t >, const string::StringBase & > { public: /** * Search for pattern in linear string. * @return set set of occurences */ - static std::map < DefaultSymbolType, size_t > bcs ( const string::String & pattern ); + static ext::map < DefaultSymbolType, size_t > bcs ( const string::String & pattern ); template < class SymbolType > - static std::map < SymbolType, size_t > bcs ( const string::LinearString < SymbolType > & pattern ); + static ext::map < SymbolType, size_t > bcs ( const string::LinearString < SymbolType > & pattern ); }; template < class SymbolType > -std::map<SymbolType, size_t> BadCharacterShiftTable::bcs(const string::LinearString < SymbolType >& pattern) { +ext::map<SymbolType, size_t> BadCharacterShiftTable::bcs(const string::LinearString < SymbolType >& pattern) { const ext::set<SymbolType>& alphabet = pattern.getAlphabet(); - std::map<SymbolType, size_t> bcs; + ext::map<SymbolType, size_t> bcs; /* Initialization of BCS to the length of the needle. */ for(const auto& symbol : alphabet) diff --git a/alib2algo/src/string/properties/ReversedBadCharacterShiftTable.cpp b/alib2algo/src/string/properties/ReversedBadCharacterShiftTable.cpp index 295d9862ce..b7f63c3fb0 100644 --- a/alib2algo/src/string/properties/ReversedBadCharacterShiftTable.cpp +++ b/alib2algo/src/string/properties/ReversedBadCharacterShiftTable.cpp @@ -12,11 +12,11 @@ namespace string { namespace properties { -std::map < DefaultSymbolType, size_t > ReversedBadCharacterShiftTable::bcs ( const string::String & pattern ) { +ext::map < DefaultSymbolType, size_t > ReversedBadCharacterShiftTable::bcs ( const string::String & pattern ) { return dispatch ( pattern.getData ( ) ); } -auto ReversedBadCharacterShiftTableLinearString = registration::OverloadRegister < ReversedBadCharacterShiftTable, std::map < DefaultSymbolType, size_t >, string::LinearString < > > ( ReversedBadCharacterShiftTable::bcs ); +auto ReversedBadCharacterShiftTableLinearString = registration::OverloadRegister < ReversedBadCharacterShiftTable, ext::map < DefaultSymbolType, size_t >, string::LinearString < > > ( ReversedBadCharacterShiftTable::bcs ); } /* namespace properties */ diff --git a/alib2algo/src/string/properties/ReversedBadCharacterShiftTable.h b/alib2algo/src/string/properties/ReversedBadCharacterShiftTable.h index 455dac5a7c..9577100ee5 100644 --- a/alib2algo/src/string/properties/ReversedBadCharacterShiftTable.h +++ b/alib2algo/src/string/properties/ReversedBadCharacterShiftTable.h @@ -25,23 +25,23 @@ namespace properties { * Computation of BCS table for BMH from MI(E+\eps)-EVY course 2014 * To get rid of zeros in BCS table we ignore last haystack character */ -class ReversedBadCharacterShiftTable : public alib::SingleDispatch < ReversedBadCharacterShiftTable, std::map < DefaultSymbolType, size_t >, const string::StringBase & > { +class ReversedBadCharacterShiftTable : public alib::SingleDispatch < ReversedBadCharacterShiftTable, ext::map < DefaultSymbolType, size_t >, const string::StringBase & > { public: /** * Search for pattern in linear string. * @return set set of occurences */ - static std::map < DefaultSymbolType, size_t > bcs ( const string::String & pattern ); + static ext::map < DefaultSymbolType, size_t > bcs ( const string::String & pattern ); template < class SymbolType > - static std::map < SymbolType, size_t > bcs ( const string::LinearString < SymbolType > & pattern ); + static ext::map < SymbolType, size_t > bcs ( const string::LinearString < SymbolType > & pattern ); }; template < class SymbolType > -std::map < SymbolType, size_t > ReversedBadCharacterShiftTable::bcs ( const string::LinearString < SymbolType > & pattern ) { +ext::map < SymbolType, size_t > ReversedBadCharacterShiftTable::bcs ( const string::LinearString < SymbolType > & pattern ) { const ext::set < SymbolType > & alphabet = pattern.getAlphabet ( ); - std::map < SymbolType, size_t > bcs; + ext::map < SymbolType, size_t > bcs; /* Initialization of BCS to the length of the needle. */ for ( const auto & symbol : alphabet ) diff --git a/alib2algo/src/string/simplify/NormalizeAlphabet.h b/alib2algo/src/string/simplify/NormalizeAlphabet.h index 11109b0edf..3705ad7fa2 100644 --- a/alib2algo/src/string/simplify/NormalizeAlphabet.h +++ b/alib2algo/src/string/simplify/NormalizeAlphabet.h @@ -31,7 +31,7 @@ public: template < class SymbolType > string::LinearString < SymbolType > NormalizeAlphabet::normalize(const string::LinearString < SymbolType > & string) { int counter = 0; - std::map<SymbolType, char > normalizationData; + ext::map<SymbolType, char > normalizationData; for(const SymbolType& symbol : string.getContent()) { if(normalizationData.find(symbol) == normalizationData.end()) { diff --git a/alib2algo/src/stringology/exact/BoyerMoore.h b/alib2algo/src/stringology/exact/BoyerMoore.h index dbbdfcd7af..eca142fa61 100644 --- a/alib2algo/src/stringology/exact/BoyerMoore.h +++ b/alib2algo/src/stringology/exact/BoyerMoore.h @@ -47,7 +47,7 @@ ext::set<unsigned> BoyerMoore::match(const string::LinearString < SymbolType >& ext::set<unsigned> occ; measurements::start ( "Preprocess", measurements::Type::PREPROCESS ); - std::map<SymbolType, size_t> bcs = string::properties::BadCharacterShiftTable::bcs(pattern); //NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map<SymbolType, size_t> bcs = string::properties::BadCharacterShiftTable::bcs(pattern); //NOTE: the subjects alphabet must be a subset or equal to the pattern ext::vector<size_t> gss = string::properties::GoodSuffixShiftTable::gss(pattern); measurements::end ( ); diff --git a/alib2algo/src/stringology/exact/BoyerMooreHorspool.h b/alib2algo/src/stringology/exact/BoyerMooreHorspool.h index 9f3b42c015..698b42d89e 100644 --- a/alib2algo/src/stringology/exact/BoyerMooreHorspool.h +++ b/alib2algo/src/stringology/exact/BoyerMooreHorspool.h @@ -46,7 +46,7 @@ ext::set<unsigned> BoyerMooreHorspool::match(const string::LinearString < Symbol ext::set<unsigned> occ; measurements::start ( "Preprocess", measurements::Type::PREPROCESS ); - std::map<SymbolType, size_t> bcs = string::properties::BadCharacterShiftTable::bcs(pattern); //NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map<SymbolType, size_t> bcs = string::properties::BadCharacterShiftTable::bcs(pattern); //NOTE: the subjects alphabet must be a subset or equal to the pattern measurements::end ( ); measurements::start ( "Algorithm", measurements::Type::ALGORITHM ); diff --git a/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.h b/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.h index c923824f57..dfbce317ed 100644 --- a/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.h +++ b/alib2algo/src/stringology/exact/DeadZoneUsingBadCharacterShift.h @@ -28,7 +28,7 @@ namespace exact { */ class DeadZoneUsingBadCharacterShift : public alib::DoubleDispatch < DeadZoneUsingBadCharacterShift, ext::set < unsigned >, const string::StringBase &, const string::StringBase & > { template < class SymbolType > - static void match_rec ( ext::set < unsigned > & occ, const string::LinearString < SymbolType > & string, const string::LinearString < SymbolType > & pattern, std::map < SymbolType, size_t > & fbcs, std::map < SymbolType, size_t > & bbcs, int low, int high ); + static void match_rec ( ext::set < unsigned > & occ, const string::LinearString < SymbolType > & string, const string::LinearString < SymbolType > & pattern, ext::map < SymbolType, size_t > & fbcs, ext::map < SymbolType, size_t > & bbcs, int low, int high ); public: /** @@ -44,15 +44,15 @@ public: template < class SymbolType > ext::set < unsigned > DeadZoneUsingBadCharacterShift::match ( const string::LinearString < SymbolType > & string, const string::LinearString < SymbolType > & pattern ) { ext::set < unsigned > occ; - std::map < SymbolType, size_t > fbcs = string::properties::BadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern - std::map < SymbolType, size_t > bbcs = string::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map < SymbolType, size_t > fbcs = string::properties::BadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map < SymbolType, size_t > bbcs = string::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern match_rec ( occ, string, pattern, fbcs, bbcs, 0, string.getContent ( ).size ( ) - pattern.getContent ( ).size ( ) + 1 ); return occ; } template < class SymbolType > -void DeadZoneUsingBadCharacterShift::match_rec ( ext::set < unsigned > & occ, const string::LinearString < SymbolType > & string, const string::LinearString < SymbolType > & pattern, std::map < SymbolType, size_t > & fbcs, std::map < SymbolType, size_t > & bbcs, int low, int high ) { +void DeadZoneUsingBadCharacterShift::match_rec ( ext::set < unsigned > & occ, const string::LinearString < SymbolType > & string, const string::LinearString < SymbolType > & pattern, ext::map < SymbolType, size_t > & fbcs, ext::map < SymbolType, size_t > & bbcs, int low, int high ) { if ( low >= high ) return; int middle = ( low + high ) / 2; diff --git a/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.h b/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.h index acc42f07b5..b2fbd1884b 100644 --- a/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.h +++ b/alib2algo/src/stringology/exact/ReversedBoyerMooreHorspool.h @@ -43,7 +43,7 @@ public: template < class SymbolType > ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const string::LinearString < SymbolType > & string, const string::LinearString < SymbolType > & pattern ) { ext::set < unsigned > occ; - std::map < SymbolType, size_t > bcs = string::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern + ext::map < SymbolType, size_t > bcs = string::properties::ReversedBadCharacterShiftTable::bcs ( pattern ); // NOTE: the subjects alphabet must be a subset or equal to the pattern int haystack_offset = string.getContent ( ).size ( ) - pattern.getContent ( ).size ( ); diff --git a/alib2algo/src/stringology/indexing/BitParallelIndexConstruction.h b/alib2algo/src/stringology/indexing/BitParallelIndexConstruction.h index bbff334f5d..80fb7c4e65 100644 --- a/alib2algo/src/stringology/indexing/BitParallelIndexConstruction.h +++ b/alib2algo/src/stringology/indexing/BitParallelIndexConstruction.h @@ -39,7 +39,7 @@ public: template < class SymbolType > indexes::stringology::BitParallelIndex < SymbolType > BitParallelIndexConstruction::construct ( const string::LinearString < SymbolType > & w ) { - std::map < SymbolType, ext::vector < bool > > res; + ext::map < SymbolType, ext::vector < bool > > res; for ( const SymbolType & symbol : w.getAlphabet ( ) ) res [ symbol ].resize ( w.getContent ( ).size ( ) ); diff --git a/alib2algo/src/stringology/indexing/CompressedBitParallelIndexConstruction.h b/alib2algo/src/stringology/indexing/CompressedBitParallelIndexConstruction.h index 2b143eb6ab..a68439ffe6 100644 --- a/alib2algo/src/stringology/indexing/CompressedBitParallelIndexConstruction.h +++ b/alib2algo/src/stringology/indexing/CompressedBitParallelIndexConstruction.h @@ -39,7 +39,7 @@ public: template < class SymbolType > indexes::stringology::CompressedBitParallelIndex < SymbolType > CompressedBitParallelIndexConstruction::construct ( const string::LinearString < SymbolType > & w ) { - std::map < SymbolType, common::SparseBoolVector > res; + ext::map < SymbolType, common::SparseBoolVector > res; for ( const SymbolType & symbol : w.getAlphabet ( ) ) res [ symbol ].resize ( w.getContent ( ).size ( ) ); diff --git a/alib2algo/src/stringology/indexing/ExactFactorOracleAutomaton.cpp b/alib2algo/src/stringology/indexing/ExactFactorOracleAutomaton.cpp index 63ba8fdf81..cfdbbe32e0 100644 --- a/alib2algo/src/stringology/indexing/ExactFactorOracleAutomaton.cpp +++ b/alib2algo/src/stringology/indexing/ExactFactorOracleAutomaton.cpp @@ -19,7 +19,7 @@ automaton::DFA < > ExactFactorOracleAutomaton::construct ( const string::LinearS oracle.addFinalState ( oracle.getInitialState ( ) ); - std::map < DefaultStateType, DefaultStateType > supplyFunction { { DefaultStateType ( 0 ), DefaultStateType ( -1 ) } }; + ext::map < DefaultStateType, DefaultStateType > supplyFunction { { DefaultStateType ( 0 ), DefaultStateType ( -1 ) } }; oracle.setInputAlphabet ( pattern.getAlphabet ( ) ); @@ -29,7 +29,7 @@ automaton::DFA < > ExactFactorOracleAutomaton::construct ( const string::LinearS return oracle; } -void ExactFactorOracleAutomaton::oracleAddLetter ( automaton::DFA < > & oracle, const DefaultSymbolType & symbol, std::map < DefaultStateType, DefaultStateType > & supplyFunction ) { +void ExactFactorOracleAutomaton::oracleAddLetter ( automaton::DFA < > & oracle, const DefaultSymbolType & symbol, ext::map < DefaultStateType, DefaultStateType > & supplyFunction ) { int m = ( int ) oracle.getStates ( ).size ( ) - 1; DefaultStateType lastState = DefaultStateType ( m ); diff --git a/alib2algo/src/stringology/indexing/ExactFactorOracleAutomaton.h b/alib2algo/src/stringology/indexing/ExactFactorOracleAutomaton.h index f9f3fe73d4..c5b9572acd 100644 --- a/alib2algo/src/stringology/indexing/ExactFactorOracleAutomaton.h +++ b/alib2algo/src/stringology/indexing/ExactFactorOracleAutomaton.h @@ -17,7 +17,7 @@ namespace indexing { class ExactFactorOracleAutomaton : public alib::SingleDispatch < ExactFactorOracleAutomaton, automaton::Automaton, const string::StringBase & > { private: - static void oracleAddLetter ( automaton::DFA < > & oracle, const DefaultSymbolType & symbol, std::map < DefaultStateType, DefaultStateType > & supplyFunction ); + static void oracleAddLetter ( automaton::DFA < > & oracle, const DefaultSymbolType & symbol, ext::map < DefaultStateType, DefaultStateType > & supplyFunction ); public: /** diff --git a/alib2algo/src/stringology/indexing/ExactSubsequenceAutomaton.h b/alib2algo/src/stringology/indexing/ExactSubsequenceAutomaton.h index 8553524e10..8a7a695e6c 100644 --- a/alib2algo/src/stringology/indexing/ExactSubsequenceAutomaton.h +++ b/alib2algo/src/stringology/indexing/ExactSubsequenceAutomaton.h @@ -32,7 +32,7 @@ public: template < class SymbolType > automaton::DFA < SymbolType, unsigned > ExactSubsequenceAutomaton::construct ( const string::LinearString < SymbolType > & text ) { - std::map < SymbolType, unsigned > f; + ext::map < SymbolType, unsigned > f; for(const SymbolType & symbol : text.getAlphabet ( ) ) { f[symbol] = 0; } diff --git a/alib2algo/src/stringology/indexing/ExactSuffixAutomaton.cpp b/alib2algo/src/stringology/indexing/ExactSuffixAutomaton.cpp index 59f5f5706a..014e68ddc1 100644 --- a/alib2algo/src/stringology/indexing/ExactSuffixAutomaton.cpp +++ b/alib2algo/src/stringology/indexing/ExactSuffixAutomaton.cpp @@ -18,7 +18,7 @@ automaton::DFA < > ExactSuffixAutomaton::construct ( const string::LinearString suffixAutomaton.setInputAlphabet ( pattern.getAlphabet ( ) ); - std::map < DefaultStateType, std::pair < DefaultStateType, int > > suffixLinks = { { DefaultStateType ( 0 ), { DefaultStateType ( -1 ), 0 } } }; + ext::map < DefaultStateType, std::pair < DefaultStateType, int > > suffixLinks = { { DefaultStateType ( 0 ), { DefaultStateType ( -1 ), 0 } } }; DefaultStateType lastState = DefaultStateType ( 0 ); for ( const DefaultSymbolType & symbol : pattern.getContent ( ) ) @@ -32,7 +32,7 @@ automaton::DFA < > ExactSuffixAutomaton::construct ( const string::LinearString return suffixAutomaton; } -void ExactSuffixAutomaton::suffixAutomatonAddSymbol ( automaton::DFA < > & suffixAutomaton, const DefaultSymbolType & symbol, std::map < DefaultStateType, std::pair < DefaultStateType, int > > & suffixLinks, DefaultStateType & lastState ) { +void ExactSuffixAutomaton::suffixAutomatonAddSymbol ( automaton::DFA < > & suffixAutomaton, const DefaultSymbolType & symbol, ext::map < DefaultStateType, std::pair < DefaultStateType, int > > & suffixLinks, DefaultStateType & lastState ) { DefaultStateType newState = DefaultStateType ( ( int ) suffixAutomaton.getStates ( ).size ( ) ); suffixAutomaton.addState ( newState ); diff --git a/alib2algo/src/stringology/indexing/ExactSuffixAutomaton.h b/alib2algo/src/stringology/indexing/ExactSuffixAutomaton.h index 79b5494255..c98dbcf162 100644 --- a/alib2algo/src/stringology/indexing/ExactSuffixAutomaton.h +++ b/alib2algo/src/stringology/indexing/ExactSuffixAutomaton.h @@ -17,7 +17,7 @@ namespace indexing { class ExactSuffixAutomaton : public alib::SingleDispatch < ExactSuffixAutomaton, automaton::Automaton, const string::StringBase & > { private: - static void suffixAutomatonAddSymbol ( automaton::DFA < > & suffixAutomaton, const DefaultSymbolType & symbol, std::map < DefaultStateType, std::pair<DefaultStateType, int > > & suffixLinks, DefaultStateType & lastState ); + static void suffixAutomatonAddSymbol ( automaton::DFA < > & suffixAutomaton, const DefaultSymbolType & symbol, ext::map < DefaultStateType, std::pair<DefaultStateType, int > > & suffixLinks, DefaultStateType & lastState ); public: /** diff --git a/alib2algo/src/stringology/matching/BNDMMatcherConstruction.h b/alib2algo/src/stringology/matching/BNDMMatcherConstruction.h index 401bc06d62..9ada90fcdb 100644 --- a/alib2algo/src/stringology/matching/BNDMMatcherConstruction.h +++ b/alib2algo/src/stringology/matching/BNDMMatcherConstruction.h @@ -41,7 +41,7 @@ template < class SymbolType, size_t BitmaskBitCount > indexes::stringology::BNDMMatcher < SymbolType, BitmaskBitCount > BNDMMatcherConstruction::construct ( const string::LinearString < SymbolType > & w ) { size_t bitmaskLength = std::min ( w.getContent ( ).size ( ), BitmaskBitCount ); - std::map < SymbolType, std::bitset < BitmaskBitCount > > res; + ext::map < SymbolType, std::bitset < BitmaskBitCount > > res; for ( const SymbolType & symbol : w.getAlphabet ( ) ) res [ symbol ] = std::bitset < BitmaskBitCount > ( 0 ); diff --git a/alib2algo/src/stringology/matching/WideBNDMMatcherConstruction.h b/alib2algo/src/stringology/matching/WideBNDMMatcherConstruction.h index 640ddef7bc..21cebb7d7b 100644 --- a/alib2algo/src/stringology/matching/WideBNDMMatcherConstruction.h +++ b/alib2algo/src/stringology/matching/WideBNDMMatcherConstruction.h @@ -39,7 +39,7 @@ public: template < class SymbolType > indexes::stringology::BitParallelIndex < SymbolType > WideBNDMMatcherConstruction::construct ( const string::LinearString < SymbolType > & w ) { - std::map < SymbolType, ext::vector < bool > > res; + ext::map < SymbolType, ext::vector < bool > > res; for ( const SymbolType & symbol : w.getAlphabet ( ) ) res [ symbol ].resize ( w.getContent ( ).size ( ) ); diff --git a/alib2algo/src/stringology/properties/BackboneLength.h b/alib2algo/src/stringology/properties/BackboneLength.h index 32c1a57351..54805a3e31 100644 --- a/alib2algo/src/stringology/properties/BackboneLength.h +++ b/alib2algo/src/stringology/properties/BackboneLength.h @@ -45,7 +45,7 @@ public: template < class SymbolType, class StateType > unsigned BackboneLength::length ( const automaton::DFA < SymbolType, StateType > & automaton ) { std::priority_queue < std::pair < StateType, unsigned >, ext::vector < std::pair < StateType, unsigned > >, BackboneLengthLess < StateType > > open; - std::map < StateType, unsigned > closed; + ext::map < StateType, unsigned > closed; unsigned max = 0; open.push ( std::make_pair ( automaton.getInitialState ( ), max ) ); diff --git a/alib2algo/src/stringology/query/BNDMOccurrences.h b/alib2algo/src/stringology/query/BNDMOccurrences.h index 8c93769068..5f7de481eb 100644 --- a/alib2algo/src/stringology/query/BNDMOccurrences.h +++ b/alib2algo/src/stringology/query/BNDMOccurrences.h @@ -61,7 +61,7 @@ ext::set < unsigned > BNDMOccurrences::query ( const indexes::stringology::BNDMM currentBitmask.set ( ); while ( posInPattern > 0 && currentBitmask.any ( ) ) { - typename std::map < SymbolType, std::bitset < BitmaskBitCount > >::const_iterator symbolVectorIter = pattern.getData ( ).find ( subject.getContent ( ).at ( posInSubject + posInPattern - 1 ) ); + typename ext::map < SymbolType, std::bitset < BitmaskBitCount > >::const_iterator symbolVectorIter = pattern.getData ( ).find ( subject.getContent ( ).at ( posInSubject + posInPattern - 1 ) ); if ( symbolVectorIter == pattern.getData ( ).end ( ) ) break; diff --git a/alib2algo/src/stringology/query/BitParallelismFactors.h b/alib2algo/src/stringology/query/BitParallelismFactors.h index 979cef98c9..9792b5206a 100644 --- a/alib2algo/src/stringology/query/BitParallelismFactors.h +++ b/alib2algo/src/stringology/query/BitParallelismFactors.h @@ -51,7 +51,7 @@ ext::set < unsigned > BitParallelismFactors::query ( const indexes::stringology: } auto symbolIter = string.getContent ( ).begin ( ); - typename std::map < SymbolType, ext::vector < bool > >::const_iterator symbolVectorIter = bitParallelIndex.getData ( ).find ( * symbolIter ); + typename ext::map < SymbolType, ext::vector < bool > >::const_iterator symbolVectorIter = bitParallelIndex.getData ( ).find ( * symbolIter ); if ( symbolVectorIter == bitParallelIndex.getData ( ).end ( ) ) return { }; diff --git a/alib2algo/src/stringology/query/CompressedBitParallelismFactors.h b/alib2algo/src/stringology/query/CompressedBitParallelismFactors.h index c5ba7cf8fb..1636724356 100644 --- a/alib2algo/src/stringology/query/CompressedBitParallelismFactors.h +++ b/alib2algo/src/stringology/query/CompressedBitParallelismFactors.h @@ -50,7 +50,7 @@ ext::set < unsigned > CompressedBitParallelismFactors::query ( const indexes::st } auto symbolIter = string.getContent ( ).begin ( ); - typename std::map < SymbolType, common::SparseBoolVector >::const_iterator symbolVectorIter = compressedBitParallelIndex.getData ( ).find ( * symbolIter ); + typename ext::map < SymbolType, common::SparseBoolVector >::const_iterator symbolVectorIter = compressedBitParallelIndex.getData ( ).find ( * symbolIter ); if ( symbolVectorIter == compressedBitParallelIndex.getData ( ).end ( ) ) return { }; diff --git a/alib2algo/src/stringology/query/WideBNDMOccurrences.h b/alib2algo/src/stringology/query/WideBNDMOccurrences.h index a29a1f6e5f..d4b3fb10bc 100644 --- a/alib2algo/src/stringology/query/WideBNDMOccurrences.h +++ b/alib2algo/src/stringology/query/WideBNDMOccurrences.h @@ -61,7 +61,7 @@ ext::set < unsigned > WideBNDMOccurrences::query ( const indexes::stringology::B ext::fill ( currentBitmask ); while ( posInPattern > 0 && ext::any ( currentBitmask ) ) { - typename std::map < SymbolType, ext::vector < bool > >::const_iterator symbolVectorIter = pattern.getData ( ).find ( subject.getContent ( ).at ( posInSubject + posInPattern - 1 ) ); + typename ext::map < SymbolType, ext::vector < bool > >::const_iterator symbolVectorIter = pattern.getData ( ).find ( subject.getContent ( ).at ( posInSubject + posInPattern - 1 ) ); if ( symbolVectorIter == pattern.getData ( ).end ( ) ) break; diff --git a/alib2algo/src/tree/NormalizeTreeLabels.h b/alib2algo/src/tree/NormalizeTreeLabels.h index db61544454..91bd25f382 100644 --- a/alib2algo/src/tree/NormalizeTreeLabels.h +++ b/alib2algo/src/tree/NormalizeTreeLabels.h @@ -30,7 +30,7 @@ namespace tree { */ class NormalizeTreeLabels : public alib::SingleDispatch < NormalizeTreeLabels, tree::Tree, const tree::TreeBase & > { template < class SymbolType, class RankType > - static ext::tree < common::ranked_symbol < unsigned, RankType > > normalize ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & tree, std::map < common::ranked_symbol < SymbolType, RankType >, unsigned > & mapping, unsigned & counter ); + static ext::tree < common::ranked_symbol < unsigned, RankType > > normalize ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & tree, ext::map < common::ranked_symbol < SymbolType, RankType >, unsigned > & mapping, unsigned & counter ); public: /** @@ -49,7 +49,7 @@ public: }; template < class SymbolType, class RankType > -ext::tree < common::ranked_symbol < unsigned, RankType > > NormalizeTreeLabels::normalize ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & tree, std::map < common::ranked_symbol < SymbolType, RankType >, unsigned > & mapping, unsigned & counter ) { +ext::tree < common::ranked_symbol < unsigned, RankType > > NormalizeTreeLabels::normalize ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & tree, ext::map < common::ranked_symbol < SymbolType, RankType >, unsigned > & mapping, unsigned & counter ) { ext::vector < ext::tree < common::ranked_symbol < unsigned, RankType > > > children; @@ -74,7 +74,7 @@ ext::tree < common::ranked_symbol < unsigned, RankType > > NormalizeTreeLabels:: template < class SymbolType, class RankType > tree::RankedTree < unsigned, RankType > NormalizeTreeLabels::normalize ( const tree::RankedTree < SymbolType, RankType > & tree ) { - std::map < common::ranked_symbol < SymbolType, RankType >, unsigned > mapping; + ext::map < common::ranked_symbol < SymbolType, RankType >, unsigned > mapping; unsigned counter = 1; return tree::RankedTree < unsigned, RankType > ( normalize ( tree.getContent ( ), mapping, counter ) ); diff --git a/alib2algo/src/tree/generate/RandomTreeFactory.cpp b/alib2algo/src/tree/generate/RandomTreeFactory.cpp index d90d52bdbf..173ecb5921 100644 --- a/alib2algo/src/tree/generate/RandomTreeFactory.cpp +++ b/alib2algo/src/tree/generate/RandomTreeFactory.cpp @@ -83,7 +83,7 @@ struct Node { } } - void generateRankedSymbols ( const std::map < int, ext::vector < char > > rankedAlphabet ) { + void generateRankedSymbols ( const ext::map < int, ext::vector < char > > rankedAlphabet ) { const ext::vector < char > & alphabet = rankedAlphabet.at ( rank ); symbol = alphabet[ext::random_devices::semirandom ( ) % alphabet.size ( )]; @@ -95,7 +95,7 @@ struct Node { } } - void fillRanks ( std::map < int, ext::vector < char > > & rankedAlphabet ) { + void fillRanks ( ext::map < int, ext::vector < char > > & rankedAlphabet ) { rankedAlphabet[rank]; Node * nextChild = child; @@ -216,7 +216,7 @@ ext::vector < char > generateUnrankedAlphabet ( int maxAlphabetSize, bool random return ext::vector < char > ( symbols.begin ( ), symbols.begin ( ) + maxAlphabetSize ); } -void generateRankedAlphabet ( std::map < int, ext::vector < char > > & rankedAlphabet, int maxAlphabetSize, bool randomizedAlphabet ) { +void generateRankedAlphabet ( ext::map < int, ext::vector < char > > & rankedAlphabet, int maxAlphabetSize, bool randomizedAlphabet ) { int ranksCount = rankedAlphabet.size ( ); ext::vector < char > unrankedAlphabet = generateUnrankedAlphabet ( maxAlphabetSize > ranksCount ? maxAlphabetSize : ranksCount, randomizedAlphabet ); @@ -229,7 +229,7 @@ void generateRankedAlphabet ( std::map < int, ext::vector < char > > & rankedAlp ext::set < int >::iterator it = rankSeparators.begin ( ); - for ( std::map < int, ext::vector < char > >::iterator i = rankedAlphabet.begin ( ); i != rankedAlphabet.end ( ); ++i ) { + for ( ext::map < int, ext::vector < char > >::iterator i = rankedAlphabet.begin ( ); i != rankedAlphabet.end ( ); ++i ) { ext::set < int >::iterator prevIt = it++; i->second.insert ( i->second.begin ( ), unrankedAlphabet.begin ( ) + * prevIt, unrankedAlphabet.begin ( ) + * it ); } @@ -318,7 +318,7 @@ UnrankedPattern < > RandomTreeFactory::generateUnrankedPattern ( int depth, int RankedTree < > RandomTreeFactory::generateRankedTree ( int depth, int nodesCount, int maxAlphabetSize, bool randomizedAlphabet, int maxRank ) { Node * root = generateTreeStructure ( depth, nodesCount, maxRank ); - std::map < int, ext::vector < char > > rankedAlphabet; + ext::map < int, ext::vector < char > > rankedAlphabet; root->fillRanks ( rankedAlphabet ); generateRankedAlphabet ( rankedAlphabet, maxAlphabetSize, randomizedAlphabet ); @@ -337,7 +337,7 @@ RankedTree < > RandomTreeFactory::generateRankedTree ( int depth, int nodesCount RankedPattern < > RandomTreeFactory::generateRankedPattern ( int depth, int nodesCount, int maxAlphabetSize, bool randomizedAlphabet, int maxRank ) { Node * root = generateTreeStructure ( depth, nodesCount, maxRank ); - std::map < int, ext::vector < char > > rankedAlphabet; + ext::map < int, ext::vector < char > > rankedAlphabet; root->fillRanks ( rankedAlphabet ); generateRankedAlphabet ( rankedAlphabet, maxAlphabetSize, randomizedAlphabet ); @@ -358,7 +358,7 @@ RankedPattern < > RandomTreeFactory::generateRankedPattern ( int depth, int node RankedNonlinearPattern < > RandomTreeFactory::generateRankedNonlinearPattern ( int depth, int nodesCount, int maxAlphabetSize, bool randomizedAlphabet, bool singleNonlinearVariable, int maxRank ) { Node * root = generateTreeStructure ( depth, nodesCount, maxRank ); - std::map < int, ext::vector < char > > rankedAlphabet; + ext::map < int, ext::vector < char > > rankedAlphabet; root->fillRanks ( rankedAlphabet ); generateRankedAlphabet ( rankedAlphabet, maxAlphabetSize, randomizedAlphabet ); diff --git a/alib2algo/src/tree/properties/BadCharacterShiftTable.cpp b/alib2algo/src/tree/properties/BadCharacterShiftTable.cpp index a34bfdb9d1..51e5cba802 100644 --- a/alib2algo/src/tree/properties/BadCharacterShiftTable.cpp +++ b/alib2algo/src/tree/properties/BadCharacterShiftTable.cpp @@ -15,12 +15,12 @@ namespace tree { namespace properties { -std::map < common::ranked_symbol < >, size_t > BadCharacterShiftTable::bcs ( const tree::RankedTreeWrapper & pattern ) { +ext::map < common::ranked_symbol < >, size_t > BadCharacterShiftTable::bcs ( const tree::RankedTreeWrapper & pattern ) { return dispatch ( pattern.getData ( ) ); } -auto BadCharacterShiftTablePrefixRankedBarPattern = registration::OverloadRegister < BadCharacterShiftTable, std::map < common::ranked_symbol < >, size_t >, tree::PrefixRankedBarPattern < > > ( BadCharacterShiftTable::bcs ); -auto BadCharacterShiftTablePrefixRankedBarNonlinearPattern = registration::OverloadRegister < BadCharacterShiftTable, std::map < common::ranked_symbol < >, size_t >, tree::PrefixRankedBarNonlinearPattern < > > ( BadCharacterShiftTable::bcs ); +auto BadCharacterShiftTablePrefixRankedBarPattern = registration::OverloadRegister < BadCharacterShiftTable, ext::map < common::ranked_symbol < >, size_t >, tree::PrefixRankedBarPattern < > > ( BadCharacterShiftTable::bcs ); +auto BadCharacterShiftTablePrefixRankedBarNonlinearPattern = registration::OverloadRegister < BadCharacterShiftTable, ext::map < common::ranked_symbol < >, size_t >, tree::PrefixRankedBarNonlinearPattern < > > ( BadCharacterShiftTable::bcs ); } /* namespace properties */ diff --git a/alib2algo/src/tree/properties/BadCharacterShiftTable.h b/alib2algo/src/tree/properties/BadCharacterShiftTable.h index bcf34f9a28..e6ad376657 100644 --- a/alib2algo/src/tree/properties/BadCharacterShiftTable.h +++ b/alib2algo/src/tree/properties/BadCharacterShiftTable.h @@ -24,31 +24,31 @@ namespace properties { * Computation of BCS table for BMH from MI(E+\eps)-EVY course 2014 * To get rid of zeros in BCS table we ignore last haystack character */ -class BadCharacterShiftTable : public alib::SingleDispatch < BadCharacterShiftTable, std::map < common::ranked_symbol < >, size_t >, const tree::RankedTreeBase & > { +class BadCharacterShiftTable : public alib::SingleDispatch < BadCharacterShiftTable, ext::map < common::ranked_symbol < >, size_t >, const tree::RankedTreeBase & > { public: /** * Search for pattern in linear string. * @return set set of occurences */ - static std::map < common::ranked_symbol < >, size_t > bcs ( const tree::RankedTreeWrapper & pattern ); + static ext::map < common::ranked_symbol < >, size_t > bcs ( const tree::RankedTreeWrapper & pattern ); template < class SymbolType, class RankType > - static std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs ( const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ); + static ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs ( const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ); template < class SymbolType, class RankType > - static std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs ( const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ); + static ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs ( const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ); }; template < class SymbolType, class RankType > -std::map < common::ranked_symbol < SymbolType, RankType >, size_t > BadCharacterShiftTable::bcs ( const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ) { +ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > BadCharacterShiftTable::bcs ( const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ) { return bcs ( tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > ( pattern ) ); } template < class SymbolType, class RankType > -std::map < common::ranked_symbol < SymbolType, RankType >, size_t > BadCharacterShiftTable::bcs ( const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ) { +ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > BadCharacterShiftTable::bcs ( const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ) { const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabet = pattern.getAlphabet ( ); - std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs; + ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs; // initialisation of bcs table to the size of the pattern for ( const common::ranked_symbol < SymbolType, RankType > & symbol : alphabet ) { diff --git a/alib2algo/src/tree/properties/ExactSubtreeRepeats.h b/alib2algo/src/tree/properties/ExactSubtreeRepeats.h index 3aa247b4f0..7b94c38ad9 100644 --- a/alib2algo/src/tree/properties/ExactSubtreeRepeats.h +++ b/alib2algo/src/tree/properties/ExactSubtreeRepeats.h @@ -153,7 +153,7 @@ ExactSubtreeRepeats::ExactSubtreeRepeatsAux::ExactSubtreeRepeatsAux ( const ext: template < class SymbolType, class RankType > void ExactSubtreeRepeats::ExactSubtreeRepeatsAux::buildMu ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols ) { // Build mapping mu_map((Symb, Rank) -> Number) and construct array mu from it - std::map < std::pair < SymbolType, RankType >, unsigned > mu_map; + ext::map < std::pair < SymbolType, RankType >, unsigned > mu_map; this->alphabetSize = 0; for ( auto it = symbols.begin ( ); it != symbols.end ( ); it++ ) { diff --git a/alib2algo/src/tree/properties/ExactSubtreeRepeatsNaive.h b/alib2algo/src/tree/properties/ExactSubtreeRepeatsNaive.h index fb9cb02906..8830357f8c 100644 --- a/alib2algo/src/tree/properties/ExactSubtreeRepeatsNaive.h +++ b/alib2algo/src/tree/properties/ExactSubtreeRepeatsNaive.h @@ -35,13 +35,13 @@ namespace properties { */ class ExactSubtreeRepeatsNaive : public alib::SingleDispatch < ExactSubtreeRepeatsNaive, tree::Tree, const tree::TreeBase & > { template < class SymbolType, class RankType > - static ext::tree < common::ranked_symbol < unsigned, RankType > > repeats ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & node, std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId ); + static ext::tree < common::ranked_symbol < unsigned, RankType > > repeats ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & node, ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId ); template < class SymbolType, class RankType > - static common::ranked_symbol < unsigned, RankType > repeatsPrefixRanked ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols, ext::vector < common::ranked_symbol < unsigned, RankType > > & res, std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId, int & index ); + static common::ranked_symbol < unsigned, RankType > repeatsPrefixRanked ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols, ext::vector < common::ranked_symbol < unsigned, RankType > > & res, ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId, int & index ); template < class SymbolType, class RankType > - static common::ranked_symbol < unsigned, RankType > repeatsPostfixRanked ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols, ext::vector < common::ranked_symbol < unsigned, RankType > > & res, std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId, int & index ); + static common::ranked_symbol < unsigned, RankType > repeatsPostfixRanked ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols, ext::vector < common::ranked_symbol < unsigned, RankType > > & res, ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId, int & index ); template < class SymbolType, class RankType > - static common::ranked_symbol < unsigned, RankType > repeatsPrefixRankedBar ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols, ext::vector < common::ranked_symbol < unsigned, RankType > > & res, std::map < std::pair < common::ranked_symbol <SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId, unsigned barId, int & index ); + static common::ranked_symbol < unsigned, RankType > repeatsPrefixRankedBar ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols, ext::vector < common::ranked_symbol < unsigned, RankType > > & res, ext::map < std::pair < common::ranked_symbol <SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId, unsigned barId, int & index ); public: /** @@ -66,7 +66,7 @@ public: }; template < class SymbolType, class RankType > -ext::tree < common::ranked_symbol < unsigned, RankType > > ExactSubtreeRepeatsNaive::repeats ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & node, std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId ) { +ext::tree < common::ranked_symbol < unsigned, RankType > > ExactSubtreeRepeatsNaive::repeats ( const ext::tree < common::ranked_symbol < SymbolType, RankType > > & node, ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId ) { ext::vector < ext::tree < common::ranked_symbol < unsigned, RankType > > > children; std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > > childRepeatsKey ( node.getData ( ), ext::vector < common::ranked_symbol < unsigned, RankType > > ( ) ); @@ -85,13 +85,13 @@ ext::tree < common::ranked_symbol < unsigned, RankType > > ExactSubtreeRepeatsNa template < class SymbolType, class RankType > tree::RankedTree < unsigned, RankType > ExactSubtreeRepeatsNaive::repeats ( const tree::RankedTree < SymbolType, RankType > & tree ) { unsigned minId = 1; - std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > data; + ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > data; return tree::RankedTree < unsigned, RankType > ( repeats ( tree.getContent ( ), data, minId ) ); } template < class SymbolType, class RankType > -common::ranked_symbol < unsigned, RankType > ExactSubtreeRepeatsNaive::repeatsPrefixRanked ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols, ext::vector < common::ranked_symbol < unsigned, RankType > > & res, std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId, int & index ) { +common::ranked_symbol < unsigned, RankType > ExactSubtreeRepeatsNaive::repeatsPrefixRanked ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols, ext::vector < common::ranked_symbol < unsigned, RankType > > & res, ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId, int & index ) { int begin = index; std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > > childRepeatsKey ( symbols[begin], ext::vector < common::ranked_symbol < unsigned, RankType > > ( ) ); @@ -115,14 +115,14 @@ tree::PrefixRankedTree < unsigned, RankType > ExactSubtreeRepeatsNaive::repeats unsigned minId = 1; int index = 0; ext::vector < common::ranked_symbol < unsigned, RankType > > res; - std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > data; + ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > data; repeatsPrefixRanked ( tree.getContent ( ), res, data, minId, index ); return tree::PrefixRankedTree < unsigned, RankType > ( res ); } template < class SymbolType, class RankType > -common::ranked_symbol < unsigned, RankType > ExactSubtreeRepeatsNaive::repeatsPostfixRanked ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols, ext::vector < common::ranked_symbol < unsigned, RankType > > & res, std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId, int & index ) { +common::ranked_symbol < unsigned, RankType > ExactSubtreeRepeatsNaive::repeatsPostfixRanked ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols, ext::vector < common::ranked_symbol < unsigned, RankType > > & res, ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId, int & index ) { int begin = index; std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > > childRepeatsKey ( symbols[begin], ext::vector < common::ranked_symbol < unsigned, RankType > > ( ) ); @@ -148,7 +148,7 @@ tree::PostfixRankedTree < unsigned, RankType > ExactSubtreeRepeatsNaive::repeats int index = tree.getContent ( ).size ( ) - 1; ext::vector < common::ranked_symbol < unsigned, RankType > > res; - std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > data; + ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > data; repeatsPostfixRanked ( tree.getContent ( ), res, data, minId, index ); return tree::PostfixRankedTree < unsigned, RankType > ( res ); @@ -156,7 +156,7 @@ tree::PostfixRankedTree < unsigned, RankType > ExactSubtreeRepeatsNaive::repeats template < class SymbolType, class RankType > -common::ranked_symbol < unsigned, RankType > ExactSubtreeRepeatsNaive::repeatsPrefixRankedBar ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols, ext::vector < common::ranked_symbol < unsigned, RankType > > & res, std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId, unsigned barId, int & index ) { +common::ranked_symbol < unsigned, RankType > ExactSubtreeRepeatsNaive::repeatsPrefixRankedBar ( const ext::vector < common::ranked_symbol < SymbolType, RankType > > & symbols, ext::vector < common::ranked_symbol < unsigned, RankType > > & res, ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > & data, unsigned & minId, unsigned barId, int & index ) { int begin = index; std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > > childRepeatsKey ( symbols[begin], ext::vector < common::ranked_symbol < unsigned, RankType > > ( ) ); @@ -184,7 +184,7 @@ tree::PrefixRankedBarTree < unsigned, RankType > ExactSubtreeRepeatsNaive::repea unsigned minId = barId + 1; int index = 0; ext::vector < common::ranked_symbol < unsigned, RankType > > res; - std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > data; + ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > data; repeatsPrefixRankedBar ( tree.getContent ( ), res, data, minId, barId, index ); diff --git a/alib2algo/src/tree/properties/ReversedBadCharacterShiftTable.cpp b/alib2algo/src/tree/properties/ReversedBadCharacterShiftTable.cpp index 710489c57d..c602b8692d 100644 --- a/alib2algo/src/tree/properties/ReversedBadCharacterShiftTable.cpp +++ b/alib2algo/src/tree/properties/ReversedBadCharacterShiftTable.cpp @@ -12,14 +12,14 @@ namespace tree { namespace properties { -std::map < common::ranked_symbol < >, size_t > ReversedBadCharacterShiftTable::bcs ( const tree::RankedTreeWrapper & pattern ) { +ext::map < common::ranked_symbol < >, size_t > ReversedBadCharacterShiftTable::bcs ( const tree::RankedTreeWrapper & pattern ) { return dispatch ( pattern.getData ( ) ); } -auto ReversedBadCharacterShiftTablePrefixRankedBarPattern = registration::OverloadRegister < ReversedBadCharacterShiftTable, std::map < common::ranked_symbol < >, size_t >, tree::PrefixRankedBarPattern < > > ( ReversedBadCharacterShiftTable::bcs ); -auto ReversedBadCharacterShiftTablePrefixRankedBarNonlinearPattern = registration::OverloadRegister < ReversedBadCharacterShiftTable, std::map < common::ranked_symbol < >, size_t >, tree::PrefixRankedBarNonlinearPattern < > > ( ReversedBadCharacterShiftTable::bcs ); -auto ReversedBadCharacterShiftTablePrefixRankedPattern = registration::OverloadRegister < ReversedBadCharacterShiftTable, std::map < common::ranked_symbol < >, size_t >, tree::PrefixRankedPattern < > > ( ReversedBadCharacterShiftTable::bcs ); -auto ReversedBadCharacterShiftTablePrefixRankedNonlinearPattern = registration::OverloadRegister < ReversedBadCharacterShiftTable, std::map < common::ranked_symbol < >, size_t >, tree::PrefixRankedNonlinearPattern < > > ( ReversedBadCharacterShiftTable::bcs ); +auto ReversedBadCharacterShiftTablePrefixRankedBarPattern = registration::OverloadRegister < ReversedBadCharacterShiftTable, ext::map < common::ranked_symbol < >, size_t >, tree::PrefixRankedBarPattern < > > ( ReversedBadCharacterShiftTable::bcs ); +auto ReversedBadCharacterShiftTablePrefixRankedBarNonlinearPattern = registration::OverloadRegister < ReversedBadCharacterShiftTable, ext::map < common::ranked_symbol < >, size_t >, tree::PrefixRankedBarNonlinearPattern < > > ( ReversedBadCharacterShiftTable::bcs ); +auto ReversedBadCharacterShiftTablePrefixRankedPattern = registration::OverloadRegister < ReversedBadCharacterShiftTable, ext::map < common::ranked_symbol < >, size_t >, tree::PrefixRankedPattern < > > ( ReversedBadCharacterShiftTable::bcs ); +auto ReversedBadCharacterShiftTablePrefixRankedNonlinearPattern = registration::OverloadRegister < ReversedBadCharacterShiftTable, ext::map < common::ranked_symbol < >, size_t >, tree::PrefixRankedNonlinearPattern < > > ( ReversedBadCharacterShiftTable::bcs ); } /* namespace properties */ diff --git a/alib2algo/src/tree/properties/ReversedBadCharacterShiftTable.h b/alib2algo/src/tree/properties/ReversedBadCharacterShiftTable.h index a847063464..fe75ef9755 100644 --- a/alib2algo/src/tree/properties/ReversedBadCharacterShiftTable.h +++ b/alib2algo/src/tree/properties/ReversedBadCharacterShiftTable.h @@ -29,35 +29,35 @@ namespace properties { * Computation of BCS table for BMH from MI(E+\eps)-EVY course 2014 * To get rid of zeros in BCS table we ignore last haystack character */ -class ReversedBadCharacterShiftTable : public alib::SingleDispatch < ReversedBadCharacterShiftTable, std::map < common::ranked_symbol < >, size_t >, const tree::RankedTreeBase & > { +class ReversedBadCharacterShiftTable : public alib::SingleDispatch < ReversedBadCharacterShiftTable, ext::map < common::ranked_symbol < >, size_t >, const tree::RankedTreeBase & > { public: /** * Search for pattern in linear string. * @return set set of occurences */ - static std::map < common::ranked_symbol < >, size_t > bcs ( const tree::RankedTreeWrapper & pattern ); + static ext::map < common::ranked_symbol < >, size_t > bcs ( const tree::RankedTreeWrapper & pattern ); template < class SymbolType, class RankType > - static std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs ( const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ); + static ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs ( const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ); template < class SymbolType, class RankType > - static std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs ( const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ); + static ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs ( const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ); template < class SymbolType, class RankType > - static std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs ( const tree::PrefixRankedPattern < SymbolType, RankType > & pattern ); + static ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs ( const tree::PrefixRankedPattern < SymbolType, RankType > & pattern ); template < class SymbolType, class RankType > - static std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs ( const tree::PrefixRankedNonlinearPattern < SymbolType, RankType > & pattern ); + static ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs ( const tree::PrefixRankedNonlinearPattern < SymbolType, RankType > & pattern ); }; template < class SymbolType, class RankType > -std::map < common::ranked_symbol < SymbolType, RankType >, size_t > ReversedBadCharacterShiftTable::bcs ( const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ) { +ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > ReversedBadCharacterShiftTable::bcs ( const tree::PrefixRankedBarPattern < SymbolType, RankType > & pattern ) { return bcs ( tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > ( pattern ) ); } template < class SymbolType, class RankType > -std::map < common::ranked_symbol < SymbolType, RankType >, size_t > ReversedBadCharacterShiftTable::bcs ( const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ) { +ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > ReversedBadCharacterShiftTable::bcs ( const tree::PrefixRankedBarNonlinearPattern < SymbolType, RankType > & pattern ) { const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabet = pattern.getAlphabet ( ); - std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs; + ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs; // initialisation of bcs table to the size of the pattern for ( const common::ranked_symbol < SymbolType, RankType > & symbol : alphabet ) { @@ -109,15 +109,15 @@ std::map < common::ranked_symbol < SymbolType, RankType >, size_t > ReversedBadC } template < class SymbolType, class RankType > -std::map < common::ranked_symbol < SymbolType, RankType >, size_t > ReversedBadCharacterShiftTable::bcs ( const tree::PrefixRankedPattern < SymbolType, RankType > & pattern ) { +ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > ReversedBadCharacterShiftTable::bcs ( const tree::PrefixRankedPattern < SymbolType, RankType > & pattern ) { return bcs ( tree::PrefixRankedNonlinearPattern < SymbolType, RankType > ( pattern ) ); } template < class SymbolType, class RankType > -std::map < common::ranked_symbol < SymbolType, RankType >, size_t > ReversedBadCharacterShiftTable::bcs ( const tree::PrefixRankedNonlinearPattern < SymbolType, RankType > & pattern ) { +ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > ReversedBadCharacterShiftTable::bcs ( const tree::PrefixRankedNonlinearPattern < SymbolType, RankType > & pattern ) { const ext::set < common::ranked_symbol < SymbolType, RankType > > & alphabet = pattern.getAlphabet ( ); - std::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs; + ext::map < common::ranked_symbol < SymbolType, RankType >, size_t > bcs; // initialisation of bcs table to the size of the pattern for ( const common::ranked_symbol < SymbolType, RankType > & symbol : alphabet ) { diff --git a/alib2algo/test-src/automaton/properties/EpsilonClosureTest.cpp b/alib2algo/test-src/automaton/properties/EpsilonClosureTest.cpp index 8bd2f6bf22..6e8de6b68b 100644 --- a/alib2algo/test-src/automaton/properties/EpsilonClosureTest.cpp +++ b/alib2algo/test-src/automaton/properties/EpsilonClosureTest.cpp @@ -38,7 +38,7 @@ void EpsilonClosureTest::testEpsilonClosure() { automaton.addTransition(q6, q1); automaton.addTransition(q8, q8); - std::map<DefaultStateType, ext::set<DefaultStateType>> allClosures = automaton::properties::AllEpsilonClosure::allEpsilonClosure(automaton); + ext::map<DefaultStateType, ext::set<DefaultStateType>> allClosures = automaton::properties::AllEpsilonClosure::allEpsilonClosure(automaton); for(const DefaultStateType& state : automaton.getStates()) { CPPUNIT_ASSERT(automaton::properties::EpsilonClosure::epsilonClosure(automaton, state) == allClosures[state]); diff --git a/alib2algo_experimental/src/grammar/parsing/AbsorbTerminalSymbol.cpp b/alib2algo_experimental/src/grammar/parsing/AbsorbTerminalSymbol.cpp index f891593a3f..f74be84276 100644 --- a/alib2algo_experimental/src/grammar/parsing/AbsorbTerminalSymbol.cpp +++ b/alib2algo_experimental/src/grammar/parsing/AbsorbTerminalSymbol.cpp @@ -15,7 +15,7 @@ namespace grammar { namespace parsing { -void AbsorbTerminalSymbol::handleAbsobtion ( const grammar::CFG < > & orig, grammar::CFG < > & res, const DefaultSymbolType & terminal, const ext::set < DefaultSymbolType > & nonterminals, const std::map < DefaultSymbolType, DefaultSymbolType > & nonterminalsPrimed ) { +void AbsorbTerminalSymbol::handleAbsobtion ( const grammar::CFG < > & orig, grammar::CFG < > & res, const DefaultSymbolType & terminal, const ext::set < DefaultSymbolType > & nonterminals, const ext::map < DefaultSymbolType, DefaultSymbolType > & nonterminalsPrimed ) { for ( const DefaultSymbolType & nonterminal : nonterminals ) for ( const ext::vector < DefaultSymbolType > & rhs : orig.getRules ( ).find ( nonterminal )->second ) { ext::vector < DefaultSymbolType > newRHS; @@ -47,7 +47,7 @@ void AbsorbTerminalSymbol::absorbTerminalSymbol ( grammar::CFG < > & grammar, co res.setNonterminalAlphabet ( grammar.getNonterminalAlphabet ( ) ); res.setTerminalAlphabet ( grammar.getTerminalAlphabet ( ) ); - std::map < DefaultSymbolType, DefaultSymbolType > nonterminalsPrimed; // terminal is fixed in particular calls + ext::map < DefaultSymbolType, DefaultSymbolType > nonterminalsPrimed; // terminal is fixed in particular calls for ( const DefaultSymbolType & nonterminal : nonterminals ) { DefaultSymbolType newSymbol = common::createUnique ( DefaultSymbolType ( DefaultSymbolsPairType ( std::make_pair ( nonterminal, terminal ) ) ), res.getTerminalAlphabet ( ), res.getNonterminalAlphabet ( ) ); diff --git a/alib2algo_experimental/src/grammar/parsing/AbsorbTerminalSymbol.h b/alib2algo_experimental/src/grammar/parsing/AbsorbTerminalSymbol.h index 89ad1c3455..a3185f7803 100644 --- a/alib2algo_experimental/src/grammar/parsing/AbsorbTerminalSymbol.h +++ b/alib2algo_experimental/src/grammar/parsing/AbsorbTerminalSymbol.h @@ -19,7 +19,7 @@ namespace parsing { class AbsorbTerminalSymbol { public: - static void handleAbsobtion ( const grammar::CFG < > & orig, grammar::CFG < > & res, const DefaultSymbolType & terminal, const ext::set < DefaultSymbolType > & nonterminals, const std::map < DefaultSymbolType, DefaultSymbolType > & nonterminalPrimed ); + static void handleAbsobtion ( const grammar::CFG < > & orig, grammar::CFG < > & res, const DefaultSymbolType & terminal, const ext::set < DefaultSymbolType > & nonterminals, const ext::map < DefaultSymbolType, DefaultSymbolType > & nonterminalPrimed ); static void absorbTerminalSymbol ( grammar::CFG < > & grammar, const DefaultSymbolType & terminal, const ext::set < DefaultSymbolType > & nonterminals ); }; diff --git a/alib2algo_experimental/src/grammar/parsing/DeterministicLL1Grammar.cpp b/alib2algo_experimental/src/grammar/parsing/DeterministicLL1Grammar.cpp index ea2710ddce..5fa6eef91f 100644 --- a/alib2algo_experimental/src/grammar/parsing/DeterministicLL1Grammar.cpp +++ b/alib2algo_experimental/src/grammar/parsing/DeterministicLL1Grammar.cpp @@ -31,7 +31,7 @@ grammar::CFG < > DeterministicLL1Grammar::convert ( const grammar::CFG < > & par grammar::CFG < > grammar = param; while ( true ) { - std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > parseTable = LL1ParseTable::parseTable ( grammar ); + ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > parseTable = LL1ParseTable::parseTable ( grammar ); bool deterministic = true; diff --git a/alib2algo_experimental/src/grammar/parsing/DeterministicLL1ParseTable.cpp b/alib2algo_experimental/src/grammar/parsing/DeterministicLL1ParseTable.cpp index 673417aabe..3c090ff546 100644 --- a/alib2algo_experimental/src/grammar/parsing/DeterministicLL1ParseTable.cpp +++ b/alib2algo_experimental/src/grammar/parsing/DeterministicLL1ParseTable.cpp @@ -13,13 +13,13 @@ namespace grammar { namespace parsing { -std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::vector < DefaultSymbolType > > DeterministicLL1ParseTable::parseTable ( const std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > & parseTable ) { +ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::vector < DefaultSymbolType > > DeterministicLL1ParseTable::parseTable ( const ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > & parseTable ) { for ( const std::pair < const std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > & elem : parseTable ) if ( elem.second.size ( ) > 1 ) throw exception::CommonException ( "Cant handle conflict in epsilon" ); - std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::vector < DefaultSymbolType > > res; + ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::vector < DefaultSymbolType > > res; for ( const std::pair < const std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > & elem : parseTable ) if ( elem.second.size ( ) == 1 ) diff --git a/alib2algo_experimental/src/grammar/parsing/DeterministicLL1ParseTable.h b/alib2algo_experimental/src/grammar/parsing/DeterministicLL1ParseTable.h index d9914bc474..4b24791bec 100644 --- a/alib2algo_experimental/src/grammar/parsing/DeterministicLL1ParseTable.h +++ b/alib2algo_experimental/src/grammar/parsing/DeterministicLL1ParseTable.h @@ -21,7 +21,7 @@ namespace parsing { class DeterministicLL1ParseTable { public: - static std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::vector < DefaultSymbolType > > parseTable ( const std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > & parseTable ); + static ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::vector < DefaultSymbolType > > parseTable ( const ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > & parseTable ); }; } /* namespace parsing */ diff --git a/alib2algo_experimental/src/grammar/parsing/First.cpp b/alib2algo_experimental/src/grammar/parsing/First.cpp index 2ea393a2aa..a24385baa7 100644 --- a/alib2algo_experimental/src/grammar/parsing/First.cpp +++ b/alib2algo_experimental/src/grammar/parsing/First.cpp @@ -23,7 +23,7 @@ namespace grammar { namespace parsing { -ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > First::first ( const ext::set < DefaultSymbolType > & terminals, const ext::set < DefaultSymbolType > & nonterminals, const std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > & firstOfNonterminal, const ext::vector < DefaultSymbolType > & rhs ) { +ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > First::first ( const ext::set < DefaultSymbolType > & terminals, const ext::set < DefaultSymbolType > & nonterminals, const ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > & firstOfNonterminal, const ext::vector < DefaultSymbolType > & rhs ) { // 1. FIRST(\varepsilon) = { \varepsilon } if ( rhs.size ( ) == 0 ) { return { string::Epsilon < >::EPSILON }; @@ -52,7 +52,7 @@ ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > First::firs } } -std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > First::first ( const ext::set < DefaultSymbolType > & terminals, const ext::set < DefaultSymbolType > & nonterminals, const std::map < DefaultSymbolType, ext::set < ext::vector < DefaultSymbolType > > > & rules ) { +ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > First::first ( const ext::set < DefaultSymbolType > & terminals, const ext::set < DefaultSymbolType > & nonterminals, const ext::map < DefaultSymbolType, ext::set < ext::vector < DefaultSymbolType > > > & rules ) { /* * * 1. foreach A \in N: first(A) = \emptyset @@ -61,12 +61,12 @@ std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, strin * 3. repeat step 2 if at least one set first(A) has changed * */ - std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > firstOfNonterminal1; + ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > firstOfNonterminal1; for ( const DefaultSymbolType & nonterminal : nonterminals ) firstOfNonterminal1[nonterminal]; - std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > firstOfNonterminal2 = firstOfNonterminal1; + ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > firstOfNonterminal2 = firstOfNonterminal1; do { for ( const std::pair < const DefaultSymbolType, ext::set < ext::vector < DefaultSymbolType > > > & rule : rules ) @@ -86,10 +86,10 @@ std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, strin } template < class T > -std::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > First::first ( const T & grammar ) { - std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > firstNt = first ( grammar.getTerminalAlphabet ( ), grammar.getNonterminalAlphabet ( ), grammar.getRawRules ( ) ); +ext::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > First::first ( const T & grammar ) { + ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > firstNt = first ( grammar.getTerminalAlphabet ( ), grammar.getNonterminalAlphabet ( ), grammar.getRawRules ( ) ); - std::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > res; + ext::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > res; for ( const std::pair < const DefaultSymbolType, ext::set < ext::vector < DefaultSymbolType > > > & rule : grammar.getRawRules ( ) ) for ( const ext::vector < DefaultSymbolType > & rhs : rule.second ) @@ -100,7 +100,7 @@ std::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultS template < class T > ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > First::first ( const T & grammar, const ext::vector < DefaultSymbolType > & rhs ) { - std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > firstNt = first ( grammar.getTerminalAlphabet ( ), grammar.getNonterminalAlphabet ( ), grammar.getRawRules ( ) ); + ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > firstNt = first ( grammar.getTerminalAlphabet ( ), grammar.getNonterminalAlphabet ( ), grammar.getRawRules ( ) ); return first ( grammar.getTerminalAlphabet ( ), grammar.getNonterminalAlphabet ( ), firstNt, rhs ); } @@ -115,7 +115,7 @@ auto FirstLeftRG = registration::OverloadRegister < FirstBase1, FirstResult1, gr auto FirstRightLG = registration::OverloadRegister < FirstBase1, FirstResult1, grammar::RightLG < > > ( First::first ); auto FirstRightRG = registration::OverloadRegister < FirstBase1, FirstResult1, grammar::RightRG < > > ( First::first ); -std::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > First::first ( const grammar::Grammar & grammar ) { +ext::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > First::first ( const grammar::Grammar & grammar ) { return FirstBase1::dispatch ( grammar.getData ( ) ); } diff --git a/alib2algo_experimental/src/grammar/parsing/First.h b/alib2algo_experimental/src/grammar/parsing/First.h index c24da18f44..b63bf80963 100644 --- a/alib2algo_experimental/src/grammar/parsing/First.h +++ b/alib2algo_experimental/src/grammar/parsing/First.h @@ -22,16 +22,16 @@ namespace parsing { class First; -typedef std::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > FirstResult1; +typedef ext::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > FirstResult1; typedef alib::SingleDispatch < First, FirstResult1, const grammar::GrammarBase & > FirstBase1; typedef ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > FirstResult2; typedef alib::SingleDispatch < First, FirstResult2, const grammar::GrammarBase &, const ext::vector < DefaultSymbolType > & > FirstBase2; class First : public FirstBase1, public FirstBase2 { - static ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > first ( const ext::set < DefaultSymbolType > & terminals, const ext::set < DefaultSymbolType > & nonterminals, const std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > & firstOfNonterminal, const ext::vector < DefaultSymbolType > & rhs ); + static ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > first ( const ext::set < DefaultSymbolType > & terminals, const ext::set < DefaultSymbolType > & nonterminals, const ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > & firstOfNonterminal, const ext::vector < DefaultSymbolType > & rhs ); - static std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > first ( const ext::set < DefaultSymbolType > & terminals, const ext::set < DefaultSymbolType > & nonterminals, const std::map < DefaultSymbolType, ext::set < ext::vector < DefaultSymbolType > > > & rules ); + static ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > first ( const ext::set < DefaultSymbolType > & terminals, const ext::set < DefaultSymbolType > & nonterminals, const ext::map < DefaultSymbolType, ext::set < ext::vector < DefaultSymbolType > > > & rules ); public: template < class T > diff --git a/alib2algo_experimental/src/grammar/parsing/Follow.cpp b/alib2algo_experimental/src/grammar/parsing/Follow.cpp index 03112baff5..fd1345a495 100644 --- a/alib2algo_experimental/src/grammar/parsing/Follow.cpp +++ b/alib2algo_experimental/src/grammar/parsing/Follow.cpp @@ -28,7 +28,7 @@ namespace grammar { namespace parsing { template < class T > -void Follow::follow ( const T & grammar, std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > & followSet ) { +void Follow::follow ( const T & grammar, ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > & followSet ) { for ( const std::pair < const DefaultSymbolType, ext::set < ext::vector < DefaultSymbolType > > > & rule : grammar.getRawRules ( ) ) { const DefaultSymbolType & X = rule.first; @@ -53,7 +53,7 @@ void Follow::follow ( const T & grammar, std::map < DefaultSymbolType, ext::set } template < class T > -std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > Follow::follow ( const T & grammar ) { +ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > Follow::follow ( const T & grammar ) { /* * 1. Follow(S) = { \varepsilon } * Follow(A) = {} forall A \in N, A \neq S @@ -65,14 +65,14 @@ std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, strin * 3. goto 2 if any follow set was changed in prev step. */ - std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > followSet1; + ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > followSet1; for ( const DefaultSymbolType & symb : grammar.getNonterminalAlphabet ( ) ) followSet1[symb]; followSet1[grammar.getInitialSymbol ( )] = { string::Epsilon < >::EPSILON }; - std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > followSet2 = followSet1; + ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > followSet2 = followSet1; do { follow ( grammar, followSet2 ); @@ -103,7 +103,7 @@ auto FollowLeftRG = registration::OverloadRegister < FollowBase1, FollowResult1, auto FollowRightLG = registration::OverloadRegister < FollowBase1, FollowResult1, grammar::RightLG < > > ( Follow::follow ); auto FollowRightRG = registration::OverloadRegister < FollowBase1, FollowResult1, grammar::RightRG < > > ( Follow::follow ); -std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > Follow::follow ( const grammar::Grammar & grammar ) { +ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > Follow::follow ( const grammar::Grammar & grammar ) { return FollowBase1::dispatch ( grammar.getData ( ) ); } diff --git a/alib2algo_experimental/src/grammar/parsing/Follow.h b/alib2algo_experimental/src/grammar/parsing/Follow.h index 4da7fc24d2..958517999e 100644 --- a/alib2algo_experimental/src/grammar/parsing/Follow.h +++ b/alib2algo_experimental/src/grammar/parsing/Follow.h @@ -22,7 +22,7 @@ namespace parsing { class Follow; -typedef std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > FollowResult1; +typedef ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > FollowResult1; typedef alib::SingleDispatch < Follow, FollowResult1, const grammar::GrammarBase & > FollowBase1; typedef ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > FollowResult2; @@ -30,7 +30,7 @@ typedef alib::SingleDispatch < Follow, FollowResult2, const grammar::GrammarBase class Follow : public FollowBase1, public FollowBase2 { template < class T > - static void follow ( const T & grammar, std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > & followSet ); + static void follow ( const T & grammar, ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > & followSet ); static Follow & getInstance ( ) { static Follow res; diff --git a/alib2algo_experimental/src/grammar/parsing/LL1ParseTable.cpp b/alib2algo_experimental/src/grammar/parsing/LL1ParseTable.cpp index 314180eb80..6dd7092f12 100644 --- a/alib2algo_experimental/src/grammar/parsing/LL1ParseTable.cpp +++ b/alib2algo_experimental/src/grammar/parsing/LL1ParseTable.cpp @@ -25,11 +25,11 @@ namespace grammar { namespace parsing { template < class T > -std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > LL1ParseTable::parseTable ( const T & grammar ) { - std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > res; +ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > LL1ParseTable::parseTable ( const T & grammar ) { + ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > res; - std::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > first = First::first ( grammar ); - std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > follow = Follow::follow ( grammar ); + ext::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > first = First::first ( grammar ); + ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > follow = Follow::follow ( grammar ); for ( const std::pair < const DefaultSymbolType, ext::set < ext::vector < DefaultSymbolType > > > & transition : grammar.getRawRules ( ) ) { const DefaultSymbolType & lhs = transition.first; @@ -51,17 +51,17 @@ std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, return res; } -auto LL1ParseTableCFG = registration::OverloadRegister < LL1ParseTable, std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::CFG < > > ( LL1ParseTable::parseTable ); -auto LL1ParseTableEpsilonFreeCFG = registration::OverloadRegister < LL1ParseTable, std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::EpsilonFreeCFG < > > ( LL1ParseTable::parseTable ); -auto LL1ParseTableGNF = registration::OverloadRegister < LL1ParseTable, std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::GNF < > > ( LL1ParseTable::parseTable ); -auto LL1ParseTableCNF = registration::OverloadRegister < LL1ParseTable, std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::CNF < > > ( LL1ParseTable::parseTable ); -auto LL1ParseTableLG = registration::OverloadRegister < LL1ParseTable, std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::LG < > > ( LL1ParseTable::parseTable ); -auto LL1ParseTableLeftLG = registration::OverloadRegister < LL1ParseTable, std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::LeftLG < > > ( LL1ParseTable::parseTable ); -auto LL1ParseTableLeftRG = registration::OverloadRegister < LL1ParseTable, std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::LeftRG < > > ( LL1ParseTable::parseTable ); -auto LL1ParseTableRightLG = registration::OverloadRegister < LL1ParseTable, std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::RightLG < > > ( LL1ParseTable::parseTable ); -auto LL1ParseTableRightRG = registration::OverloadRegister < LL1ParseTable, std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::RightRG < > > ( LL1ParseTable::parseTable ); - -std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > LL1ParseTable::parseTable ( const grammar::Grammar & grammar ) { +auto LL1ParseTableCFG = registration::OverloadRegister < LL1ParseTable, ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::CFG < > > ( LL1ParseTable::parseTable ); +auto LL1ParseTableEpsilonFreeCFG = registration::OverloadRegister < LL1ParseTable, ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::EpsilonFreeCFG < > > ( LL1ParseTable::parseTable ); +auto LL1ParseTableGNF = registration::OverloadRegister < LL1ParseTable, ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::GNF < > > ( LL1ParseTable::parseTable ); +auto LL1ParseTableCNF = registration::OverloadRegister < LL1ParseTable, ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::CNF < > > ( LL1ParseTable::parseTable ); +auto LL1ParseTableLG = registration::OverloadRegister < LL1ParseTable, ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::LG < > > ( LL1ParseTable::parseTable ); +auto LL1ParseTableLeftLG = registration::OverloadRegister < LL1ParseTable, ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::LeftLG < > > ( LL1ParseTable::parseTable ); +auto LL1ParseTableLeftRG = registration::OverloadRegister < LL1ParseTable, ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::LeftRG < > > ( LL1ParseTable::parseTable ); +auto LL1ParseTableRightLG = registration::OverloadRegister < LL1ParseTable, ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::RightLG < > > ( LL1ParseTable::parseTable ); +auto LL1ParseTableRightRG = registration::OverloadRegister < LL1ParseTable, ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, grammar::RightRG < > > ( LL1ParseTable::parseTable ); + +ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > LL1ParseTable::parseTable ( const grammar::Grammar & grammar ) { return dispatch ( grammar.getData ( ) ); } diff --git a/alib2algo_experimental/src/grammar/parsing/LL1ParseTable.h b/alib2algo_experimental/src/grammar/parsing/LL1ParseTable.h index daa0016e17..b0eddc3e95 100644 --- a/alib2algo_experimental/src/grammar/parsing/LL1ParseTable.h +++ b/alib2algo_experimental/src/grammar/parsing/LL1ParseTable.h @@ -21,12 +21,12 @@ namespace grammar { namespace parsing { -class LL1ParseTable : public alib::SingleDispatch < LL1ParseTable, std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, const grammar::GrammarBase & > { +class LL1ParseTable : public alib::SingleDispatch < LL1ParseTable, ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > >, const grammar::GrammarBase & > { public: template < class T > - static std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > parseTable ( const T & grammar ); + static ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > parseTable ( const T & grammar ); - static std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > parseTable ( const grammar::Grammar & grammar ); + static ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > parseTable ( const grammar::Grammar & grammar ); }; diff --git a/alib2algo_experimental/src/grammar/parsing/LR0Parser.cpp b/alib2algo_experimental/src/grammar/parsing/LR0Parser.cpp index e126421357..9824f028af 100644 --- a/alib2algo_experimental/src/grammar/parsing/LR0Parser.cpp +++ b/alib2algo_experimental/src/grammar/parsing/LR0Parser.cpp @@ -30,7 +30,7 @@ LR0Items LR0Parser::getClosure ( LR0Items items, grammar::CFG < > originalGramma if ( position == rightHandSide.size ( ) ) continue; - std::map < DefaultSymbolType, ext::set < ext::vector < DefaultSymbolType > > >::const_iterator rulesIterator = originalGrammar.getRules ( ) . find(rightHandSide[position]); + ext::map < DefaultSymbolType, ext::set < ext::vector < DefaultSymbolType > > >::const_iterator rulesIterator = originalGrammar.getRules ( ) . find(rightHandSide[position]); if ( rulesIterator == originalGrammar.getRules ( ) . end ( ) ) continue; @@ -71,7 +71,7 @@ LR0Items LR0Parser::getNextStateItems ( LR0Items items, DefaultSymbolType symbol automaton::DFA<> LR0Parser::getAutomaton ( grammar::CFG < > originalGrammar ) { grammar::CFG < > augmentedGrammar = LRParser::getAugmentedGrammar ( originalGrammar ); DefaultSymbolType initialSymbol = augmentedGrammar.getInitialSymbol ( ); - const std::map < DefaultSymbolType, ext::set < ext::vector < DefaultSymbolType > > > & rules = augmentedGrammar.getRules ( ); + const ext::map < DefaultSymbolType, ext::set < ext::vector < DefaultSymbolType > > > & rules = augmentedGrammar.getRules ( ); LR0Items initialItems; initialItems[initialSymbol].insert ( { 0, *rules.find ( initialSymbol ) -> second.begin ( ) } ); diff --git a/alib2algo_experimental/src/grammar/parsing/SLR1ParseTable.cpp b/alib2algo_experimental/src/grammar/parsing/SLR1ParseTable.cpp index 21dcc1e948..7cdff9b11a 100644 --- a/alib2algo_experimental/src/grammar/parsing/SLR1ParseTable.cpp +++ b/alib2algo_experimental/src/grammar/parsing/SLR1ParseTable.cpp @@ -31,8 +31,8 @@ LRActionTable SLR1ParseTable::getActionTable ( grammar::CFG < > originalGrammar automaton::DFA<> parsingAutomaton = LR0Parser::getAutomaton ( originalGrammar ); for ( const DefaultStateType & state : parsingAutomaton.getStates ( ) ) { LR0Items items = static_cast < const label::LR0ItemsLabel & > ( state . getData ( ) ) . getItems ( ); - ext::range < std::map < std::pair < DefaultStateType, DefaultSymbolType >, DefaultStateType >::const_iterator > transitionsFromCurrentStateRange = parsingAutomaton.getTransitionsFromState ( state ); - std::map < std::pair < DefaultStateType, DefaultSymbolType >, DefaultStateType > transitionsFromCurrentState ( transitionsFromCurrentStateRange.begin ( ), transitionsFromCurrentStateRange.end ( ) ); + ext::range < ext::map < std::pair < DefaultStateType, DefaultSymbolType >, DefaultStateType >::const_iterator > transitionsFromCurrentStateRange = parsingAutomaton.getTransitionsFromState ( state ); + ext::map < std::pair < DefaultStateType, DefaultSymbolType >, DefaultStateType > transitionsFromCurrentState ( transitionsFromCurrentStateRange.begin ( ), transitionsFromCurrentStateRange.end ( ) ); for ( const LR0Items::value_type & nonterminalItems : items ) { DefaultSymbolType leftHandSide = nonterminalItems.first; for ( const std::pair < unsigned, ext::vector < DefaultSymbolType > > & item : nonterminalItems.second ) { @@ -73,10 +73,10 @@ LRGotoTable SLR1ParseTable::getGotoTable ( grammar::CFG < > originalGrammar ) { grammar::CFG < > augmentedGrammar = LRParser::getAugmentedGrammar ( originalGrammar ); automaton::DFA<> parsingAutomaton = LR0Parser::getAutomaton ( originalGrammar ); for ( const DefaultStateType & state : parsingAutomaton.getStates ( ) ) { - ext::range < std::map < std::pair < DefaultStateType, DefaultSymbolType >, DefaultStateType >::const_iterator > transitionsFromCurrentStateRange = parsingAutomaton.getTransitionsFromState ( state ); - std::map < std::pair < DefaultStateType, DefaultSymbolType >, DefaultStateType > transitionsFromCurrentState ( transitionsFromCurrentStateRange.begin ( ), transitionsFromCurrentStateRange.end ( ) ); + ext::range < ext::map < std::pair < DefaultStateType, DefaultSymbolType >, DefaultStateType >::const_iterator > transitionsFromCurrentStateRange = parsingAutomaton.getTransitionsFromState ( state ); + ext::map < std::pair < DefaultStateType, DefaultSymbolType >, DefaultStateType > transitionsFromCurrentState ( transitionsFromCurrentStateRange.begin ( ), transitionsFromCurrentStateRange.end ( ) ); for ( const DefaultSymbolType & nonterminal : augmentedGrammar.getNonterminalAlphabet ( ) ) { - std::map < std::pair<DefaultStateType, DefaultSymbolType >, DefaultStateType >::iterator transitionIterator = transitionsFromCurrentState.find ( { state, nonterminal } ); + ext::map < std::pair<DefaultStateType, DefaultSymbolType >, DefaultStateType >::iterator transitionIterator = transitionsFromCurrentState.find ( { state, nonterminal } ); if ( transitionIterator != transitionsFromCurrentState.end ( ) ) { gotoTable.insert ( { { state, nonterminal }, transitionIterator->second } ); } diff --git a/alib2algo_experimental/test-src/grammar/parsing/FirstTest.cpp b/alib2algo_experimental/test-src/grammar/parsing/FirstTest.cpp index 882afaacea..0f9fb8a7c5 100644 --- a/alib2algo_experimental/test-src/grammar/parsing/FirstTest.cpp +++ b/alib2algo_experimental/test-src/grammar/parsing/FirstTest.cpp @@ -44,7 +44,7 @@ void FirstTest::testFirst ( ) { grammar.addRule ( nF, rhsF2 ); // -------------------------------------------------- - std::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > first; + ext::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > first; first[rhsE1] = ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > { tA, tL @@ -67,7 +67,7 @@ void FirstTest::testFirst ( ) { // -------------------------------------------------- - std::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > firstAlgo; + ext::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > firstAlgo; for ( const auto & rule : grammar.getRawRules ( ) ) for ( const auto & rhs : rule.second ) @@ -126,7 +126,7 @@ void FirstTest::testFirst ( ) { grammar.addRule ( nF, rhsF2 ); // -------------------------------------------------- - std::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > first; + ext::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > first; first[rhsS1] = ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > { tA, tB @@ -173,7 +173,7 @@ void FirstTest::testFirst ( ) { // -------------------------------------------------- - std::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > firstAlgo; + ext::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > firstAlgo; for ( const auto & rule : grammar.getRawRules ( ) ) for ( const auto & rhs : rule.second ) @@ -197,7 +197,7 @@ void FirstTest::testFirst2 ( ) { grammar.addRule ( A, ext::vector < DefaultSymbolType > { A, c } ); grammar.addRule ( A, ext::vector < DefaultSymbolType > { d } ); - std::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > res = { { { d }, { d } }, { { A, c }, { d } } }; + ext::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > res = { { { d }, { d } }, { { A, c }, { d } } }; CPPUNIT_ASSERT ( res == grammar::parsing::First::first ( grammar ) ); } @@ -224,7 +224,7 @@ void FirstTest::testFirst3 ( ) { grammar.addRule ( B, ext::vector < DefaultSymbolType > { f, S } ); grammar.addRule ( B, ext::vector < DefaultSymbolType > { } ); - std::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > res = + ext::map < ext::vector < DefaultSymbolType >, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > res = { { { A, a }, { c, f, a } }, { { b, S }, { b } }, { { c, A, d }, { c } }, { { B }, { f, string::Epsilon < >::EPSILON } }, { { f, S }, { f } }, { { }, { string::Epsilon < >::EPSILON } } }; diff --git a/alib2algo_experimental/test-src/grammar/parsing/FollowTest.cpp b/alib2algo_experimental/test-src/grammar/parsing/FollowTest.cpp index f98c58d0a1..384615b4ac 100644 --- a/alib2algo_experimental/test-src/grammar/parsing/FollowTest.cpp +++ b/alib2algo_experimental/test-src/grammar/parsing/FollowTest.cpp @@ -44,7 +44,7 @@ void FollowTest::testFollow ( ) { grammar.addRule ( nF, rhsF2 ); // -------------------------------------------------- - std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > follow; + ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > follow; follow[nE] = ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > { string::Epsilon < >::EPSILON, tP, tR @@ -58,7 +58,7 @@ void FollowTest::testFollow ( ) { // -------------------------------------------------- - std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > followAlgo; + ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > followAlgo; for ( const auto & nt : grammar.getNonterminalAlphabet ( ) ) followAlgo[nt] = grammar::parsing::Follow::follow ( grammar, nt ); @@ -118,7 +118,7 @@ void FollowTest::testFollow ( ) { grammar.addRule ( nF, rhsF2 ); // -------------------------------------------------- - std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > follow; + ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > follow; follow[nS] = ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > { string::Epsilon < >::EPSILON @@ -144,7 +144,7 @@ void FollowTest::testFollow ( ) { // -------------------------------------------------- - std::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > followAlgo; + ext::map < DefaultSymbolType, ext::set < ext::variant < DefaultSymbolType, string::Epsilon < > > > > followAlgo; for ( const auto & nt : grammar.getNonterminalAlphabet ( ) ) followAlgo[nt] = grammar::parsing::Follow::follow ( grammar, nt ); diff --git a/alib2algo_experimental/test-src/grammar/parsing/LL1ParseTable.cpp b/alib2algo_experimental/test-src/grammar/parsing/LL1ParseTable.cpp index 501927bdad..157d3aded4 100644 --- a/alib2algo_experimental/test-src/grammar/parsing/LL1ParseTable.cpp +++ b/alib2algo_experimental/test-src/grammar/parsing/LL1ParseTable.cpp @@ -50,7 +50,7 @@ void LL1ParseTable::testLL1Table ( ) { grammar.addRule ( nF, rhsF2 ); // -------------------------------------------------- - std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > parseTable; + ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > parseTable; parseTable[std::make_pair ( tA, nE )].insert ( rhsE1 ); parseTable[std::make_pair ( tL, nE )].insert ( rhsE1 ); @@ -72,7 +72,7 @@ void LL1ParseTable::testLL1Table ( ) { // -------------------------------------------------- - std::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > parseTableAlgo = grammar::parsing::LL1ParseTable::parseTable ( grammar ); + ext::map < std::pair < ext::variant < DefaultSymbolType, string::Epsilon < > >, DefaultSymbolType >, ext::set < ext::vector < DefaultSymbolType > > > parseTableAlgo = grammar::parsing::LL1ParseTable::parseTable ( grammar ); std::cout << parseTable << std::endl; std::cout << parseTableAlgo << std::endl; diff --git a/alib2cli/src/environment/Environment.h b/alib2cli/src/environment/Environment.h index c991fa2226..60a64c7ffc 100644 --- a/alib2cli/src/environment/Environment.h +++ b/alib2cli/src/environment/Environment.h @@ -7,8 +7,8 @@ namespace cli { class Environment { - std::map < std::string, std::string > m_bindings; - std::map < std::string, std::shared_ptr < abstraction::OperationAbstraction > > m_variables; + ext::map < std::string, std::string > m_bindings; + ext::map < std::string, std::shared_ptr < abstraction::OperationAbstraction > > m_variables; std::unique_ptr < Environment > m_upper; public: diff --git a/alib2common/src/abstraction/AlgorithmRegistry.hpp b/alib2common/src/abstraction/AlgorithmRegistry.hpp index 5bdbea1120..336fa8f245 100644 --- a/alib2common/src/abstraction/AlgorithmRegistry.hpp +++ b/alib2common/src/abstraction/AlgorithmRegistry.hpp @@ -61,8 +61,8 @@ class AlgorithmRegistry { virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; - static std::map < std::string, std::map < ext::vector < std::type_index >, std::unique_ptr < Entry > > > & getEntries ( ) { - static std::map < std::string, std::map < ext::vector < std::type_index >, std::unique_ptr < Entry > > > algorithmGroups; + static ext::map < std::string, ext::map < ext::vector < std::type_index >, std::unique_ptr < Entry > > > & getEntries ( ) { + static ext::map < std::string, ext::map < ext::vector < std::type_index >, std::unique_ptr < Entry > > > algorithmGroups; return algorithmGroups; }; @@ -104,7 +104,7 @@ public: } static void listGroup ( const std::string & group ) { - for ( const std::pair < const std::string, std::map < ext::vector < std::type_index >, std::unique_ptr < Entry > > > & entry : getEntries ( ) ) { + for ( const std::pair < const std::string, ext::map < ext::vector < std::type_index >, std::unique_ptr < Entry > > > & entry : getEntries ( ) ) { if ( entry.first.find ( group ) == 0 ) //found at the begining std::cout << entry.first << std::endl; } @@ -123,7 +123,7 @@ public: } static void list ( ) { - for ( const std::pair < const std::string, std::map < ext::vector < std::type_index >, std::unique_ptr < Entry > > > & entry : getEntries ( ) ) { + for ( const std::pair < const std::string, ext::map < ext::vector < std::type_index >, std::unique_ptr < Entry > > > & entry : getEntries ( ) ) { std::cout << entry.first << std::endl; } } diff --git a/alib2common/src/abstraction/CastRegistry.hpp b/alib2common/src/abstraction/CastRegistry.hpp index d98fe5d7db..00c2041cf4 100644 --- a/alib2common/src/abstraction/CastRegistry.hpp +++ b/alib2common/src/abstraction/CastRegistry.hpp @@ -42,8 +42,8 @@ class CastRegistry { virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; - static std::map < std::pair < std::string, std::string >, std::unique_ptr < Entry > > & getEntries ( ) { - static std::map < std::pair < std::string, std::string >, std::unique_ptr < Entry > > casts; + static ext::map < std::pair < std::string, std::string >, std::unique_ptr < Entry > > & getEntries ( ) { + static ext::map < std::pair < std::string, std::string >, std::unique_ptr < Entry > > casts; return casts; }; diff --git a/alib2common/src/abstraction/DowncastRegistry.hpp b/alib2common/src/abstraction/DowncastRegistry.hpp index 8d06eb4423..838370f719 100644 --- a/alib2common/src/abstraction/DowncastRegistry.hpp +++ b/alib2common/src/abstraction/DowncastRegistry.hpp @@ -32,8 +32,8 @@ class DowncastRegistry { virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; - static std::map < std::pair < std::string, std::string >, std::unique_ptr < Entry > > & getEntries ( ) { - static std::map < std::pair < std::string, std::string >, std::unique_ptr < Entry > > fileWriters; + static ext::map < std::pair < std::string, std::string >, std::unique_ptr < Entry > > & getEntries ( ) { + static ext::map < std::pair < std::string, std::string >, std::unique_ptr < Entry > > fileWriters; return fileWriters; } diff --git a/alib2common/src/abstraction/ImmediateRegistry.hpp b/alib2common/src/abstraction/ImmediateRegistry.hpp index 2c4e2a6101..79c3313bb4 100644 --- a/alib2common/src/abstraction/ImmediateRegistry.hpp +++ b/alib2common/src/abstraction/ImmediateRegistry.hpp @@ -34,8 +34,8 @@ class ImmediateRegistry { virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( std::string value ) const override; }; - static std::map < std::string, std::unique_ptr < Entry > > & getEntries ( ) { - static std::map < std::string, std::unique_ptr < Entry > > fileWriters; + static ext::map < std::string, std::unique_ptr < Entry > > & getEntries ( ) { + static ext::map < std::string, std::unique_ptr < Entry > > fileWriters; return fileWriters; } diff --git a/alib2common/src/abstraction/NormalizeRegistry.hpp b/alib2common/src/abstraction/NormalizeRegistry.hpp index 8bc3c093b0..c5e1ae84a1 100644 --- a/alib2common/src/abstraction/NormalizeRegistry.hpp +++ b/alib2common/src/abstraction/NormalizeRegistry.hpp @@ -32,8 +32,8 @@ class NormalizeRegistry { virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; - static std::map < std::string, std::unique_ptr < Entry > > & getEntries ( ) { - static std::map < std::string, std::unique_ptr < Entry > > fileWriters; + static ext::map < std::string, std::unique_ptr < Entry > > & getEntries ( ) { + static ext::map < std::string, std::unique_ptr < Entry > > fileWriters; return fileWriters; } diff --git a/alib2common/src/abstraction/ValuePrinterRegistry.hpp b/alib2common/src/abstraction/ValuePrinterRegistry.hpp index 3f87c784b2..3a3b5d79be 100644 --- a/alib2common/src/abstraction/ValuePrinterRegistry.hpp +++ b/alib2common/src/abstraction/ValuePrinterRegistry.hpp @@ -32,8 +32,8 @@ class ValuePrinterRegistry { virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( ) const override; }; - static std::map < std::string, std::unique_ptr < Entry > > & getEntries ( ) { - static std::map < std::string, std::unique_ptr < Entry > > fileWriters; + static ext::map < std::string, std::unique_ptr < Entry > > & getEntries ( ) { + static ext::map < std::string, std::unique_ptr < Entry > > fileWriters; return fileWriters; } diff --git a/alib2common/src/abstraction/XmlFileWriterRegistry.hpp b/alib2common/src/abstraction/XmlFileWriterRegistry.hpp index fcf1f7fcae..238ffb911c 100644 --- a/alib2common/src/abstraction/XmlFileWriterRegistry.hpp +++ b/alib2common/src/abstraction/XmlFileWriterRegistry.hpp @@ -32,8 +32,8 @@ class XmlFileWriterRegistry { virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( std::string filename ) const override; }; - static std::map < std::string, std::unique_ptr < Entry > > & getEntries ( ) { - static std::map < std::string, std::unique_ptr < Entry > > fileWriters; + static ext::map < std::string, std::unique_ptr < Entry > > & getEntries ( ) { + static ext::map < std::string, std::unique_ptr < Entry > > fileWriters; return fileWriters; } diff --git a/alib2common/src/abstraction/XmlParserRegistry.hpp b/alib2common/src/abstraction/XmlParserRegistry.hpp index d71bda9166..5ef19c5fad 100644 --- a/alib2common/src/abstraction/XmlParserRegistry.hpp +++ b/alib2common/src/abstraction/XmlParserRegistry.hpp @@ -32,8 +32,8 @@ class XmlParserRegistry { virtual std::shared_ptr < abstraction::OperationAbstraction > getAbstraction ( std::deque < sax::Token > data ) const override; }; - static std::map < std::string, std::unique_ptr < Entry > > & getEntries ( ) { - static std::map < std::string, std::unique_ptr < Entry > > parsers; + static ext::map < std::string, std::unique_ptr < Entry > > & getEntries ( ) { + static ext::map < std::string, std::unique_ptr < Entry > > parsers; return parsers; } diff --git a/alib2common/src/allocator/StealthTypes.hpp b/alib2common/src/allocator/StealthTypes.hpp index acdbd76e91..62164412ef 100644 --- a/alib2common/src/allocator/StealthTypes.hpp +++ b/alib2common/src/allocator/StealthTypes.hpp @@ -23,7 +23,7 @@ template < typename T > using stealth_vector = ext::vector < T, stealth_allocator < T > >; template < class Key, class T, class Compare = std::less < Key > > -using stealth_map = std::map < Key, T, Compare, stealth_allocator < std::pair < const Key, T > > >; +using stealth_map = ext::map < Key, T, Compare, stealth_allocator < std::pair < const Key, T > > >; } #endif /* STEALTH_TYPES_HPP_ */ diff --git a/alib2common/src/container/ObjectsMap.h b/alib2common/src/container/ObjectsMap.h index 6395913592..9cc1452961 100644 --- a/alib2common/src/container/ObjectsMap.h +++ b/alib2common/src/container/ObjectsMap.h @@ -28,9 +28,9 @@ namespace container { * Contains reason why the container occured. */ template < class KeyType, class ValueType > -class ObjectsMap final : public std::map < KeyType, ValueType >, public ContainerBase { +class ObjectsMap final : public ext::map < KeyType, ValueType >, public ContainerBase { public: - explicit ObjectsMap ( std::map < KeyType, ValueType > ); + explicit ObjectsMap ( ext::map < KeyType, ValueType > ); explicit ObjectsMap ( ); virtual ContainerBase * clone ( ) const; @@ -56,15 +56,15 @@ public: } static ObjectsMap parse ( std::deque < sax::Token >::iterator & input ); - static std::map < KeyType, ValueType > parseRaw ( std::deque < sax::Token >::iterator & input ); + static ext::map < KeyType, ValueType > parseRaw ( std::deque < sax::Token >::iterator & input ); void compose ( std::deque < sax::Token > & out ) const; - static void compose ( std::deque < sax::Token > & out, const std::map < KeyType, ValueType > & input ); + static void compose ( std::deque < sax::Token > & out, const ext::map < KeyType, ValueType > & input ); virtual alib::ObjectBase * inc ( ) &&; - static std::map < alib::Object, alib::Object > normalizeRaw ( std::map < KeyType, ValueType > && source ) { - std::map < alib::Object, alib::Object > res; + static ext::map < alib::Object, alib::Object > normalizeRaw ( ext::map < KeyType, ValueType > && source ) { + ext::map < alib::Object, alib::Object > res; for ( std::pair < KeyType, ValueType > && element : ext::make_moveable_map ( source ) ) { res.insert ( ObjectsPair < KeyType, ValueType >::normalizeRaw ( std::move ( element ) ) ); } @@ -79,12 +79,12 @@ public: }; template < class KeyType, class ValueType > -ObjectsMap<KeyType, ValueType>::ObjectsMap ( std::map < KeyType, ValueType > raw ) : std::map < KeyType, ValueType > ( std::move ( raw ) ) { +ObjectsMap<KeyType, ValueType>::ObjectsMap ( ext::map < KeyType, ValueType > raw ) : ext::map < KeyType, ValueType > ( std::move ( raw ) ) { } template < class KeyType, class ValueType > -ObjectsMap<KeyType, ValueType>::ObjectsMap() : std::map<KeyType, ValueType>() { +ObjectsMap<KeyType, ValueType>::ObjectsMap() : ext::map<KeyType, ValueType>() { } @@ -100,13 +100,13 @@ ContainerBase* ObjectsMap<KeyType, ValueType>::plunder() && { template < class KeyType, class ValueType > int ObjectsMap<KeyType, ValueType>::compare(const ObjectsMap& other) const { - static ext::compare<std::map<KeyType, ValueType>> comp; - return comp ( static_cast < const std::map < KeyType, ValueType > & > ( * this ), static_cast < const std::map < KeyType, ValueType > & > ( other ) ); + static ext::compare<ext::map<KeyType, ValueType>> comp; + return comp ( static_cast < const ext::map < KeyType, ValueType > & > ( * this ), static_cast < const ext::map < KeyType, ValueType > & > ( other ) ); } template < class KeyType, class ValueType > void ObjectsMap<KeyType, ValueType>::operator>>(std::ostream& os) const { - os << "(ObjectsMap " << static_cast < const std::map < KeyType, ValueType > & > ( * this ) << ")"; + os << "(ObjectsMap " << static_cast < const ext::map < KeyType, ValueType > & > ( * this ) << ")"; } template < class KeyType, class ValueType > @@ -127,10 +127,10 @@ void ObjectsMap<KeyType, ValueType>::compose(std::deque<sax::Token>& out) const } template < class KeyType, class ValueType > -std::map < KeyType, ValueType > ObjectsMap < KeyType, ValueType >::parseRaw ( std::deque < sax::Token >::iterator & input ) { +ext::map < KeyType, ValueType > ObjectsMap < KeyType, ValueType >::parseRaw ( std::deque < sax::Token >::iterator & input ) { sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, ObjectsMap < >::getXmlTagName() ); - std::map < KeyType, ValueType > map; + ext::map < KeyType, ValueType > map; while ( sax::FromXMLParserHelper::isTokenType ( input, sax::Token::TokenType::START_ELEMENT ) ) map.insert ( alib::xmlApi < std::pair < KeyType, ValueType > >::parse ( input ) ); @@ -140,7 +140,7 @@ std::map < KeyType, ValueType > ObjectsMap < KeyType, ValueType >::parseRaw ( st } template < class KeyType, class ValueType > -void ObjectsMap < KeyType, ValueType >::compose ( std::deque < sax::Token > & out, const std::map < KeyType, ValueType > & input ) { +void ObjectsMap < KeyType, ValueType >::compose ( std::deque < sax::Token > & out, const ext::map < KeyType, ValueType > & input ) { out.emplace_back ( ObjectsMap < >::getXmlTagName(), sax::Token::TokenType::START_ELEMENT ); for ( const std::pair < const KeyType, ValueType > & item : input ) @@ -159,30 +159,30 @@ alib::ObjectBase* ObjectsMap < KeyType, ValueType >::inc() && { namespace alib { template < typename T, typename R > -struct xmlApi < std::map < T, R > > { - static std::map < T, R > parse ( std::deque < sax::Token >::iterator & input ); +struct xmlApi < ext::map < T, R > > { + static ext::map < T, R > parse ( std::deque < sax::Token >::iterator & input ); static bool first ( const std::deque < sax::Token >::const_iterator & input ); static std::string xmlTagName ( ); - static void compose ( std::deque < sax::Token > & output, const std::map < T, R > & data ); + static void compose ( std::deque < sax::Token > & output, const ext::map < T, R > & data ); }; template < typename T, typename R > -std::map < T, R > xmlApi < std::map < T, R > >::parse ( std::deque < sax::Token >::iterator & input ) { +ext::map < T, R > xmlApi < ext::map < T, R > >::parse ( std::deque < sax::Token >::iterator & input ) { return container::ObjectsMap < T, R >::parseRaw ( input ); } template < typename T, typename R > -bool xmlApi < std::map < T, R > >::first ( const std::deque < sax::Token >::const_iterator & input ) { +bool xmlApi < ext::map < T, R > >::first ( const std::deque < sax::Token >::const_iterator & input ) { return sax::FromXMLParserHelper::isToken ( input, sax::Token::TokenType::START_ELEMENT, xmlTagName() ); } template < typename T, typename R > -std::string xmlApi < std::map < T, R > >::xmlTagName ( ) { +std::string xmlApi < ext::map < T, R > >::xmlTagName ( ) { return container::ObjectsMap < >::getXmlTagName(); } template < typename T, typename R > -void xmlApi < std::map < T, R > >::compose ( std::deque < sax::Token > & output, const std::map < T, R > & input ) { +void xmlApi < ext::map < T, R > >::compose ( std::deque < sax::Token > & output, const ext::map < T, R > & input ) { return container::ObjectsMap < T, R >::compose ( output, input ); } diff --git a/alib2common/src/container/ObjectsTrie.h b/alib2common/src/container/ObjectsTrie.h index a4b2490891..0845d212d0 100644 --- a/alib2common/src/container/ObjectsTrie.h +++ b/alib2common/src/container/ObjectsTrie.h @@ -53,17 +53,17 @@ public: } static ObjectsTrie parse ( std::deque < sax::Token >::iterator & input ); - static std::map < KeyType, ext::trie < KeyType, ValueType > > parseChildren ( std::deque < sax::Token >::iterator & input ); + static ext::map < KeyType, ext::trie < KeyType, ValueType > > parseChildren ( std::deque < sax::Token >::iterator & input ); static ext::trie < KeyType, ValueType > parseRaw ( std::deque < sax::Token >::iterator & input ); void compose ( std::deque < sax::Token > & out ) const; - static void composeChildren ( std::deque < sax::Token > & out, const std::map < KeyType, ext::trie < KeyType, ValueType > > & children ); + static void composeChildren ( std::deque < sax::Token > & out, const ext::map < KeyType, ext::trie < KeyType, ValueType > > & children ); static void compose ( std::deque < sax::Token > & out, const ext::trie < KeyType, ValueType > & input ); virtual alib::ObjectBase * inc ( ) &&; ext::trie < alib::Object, alib::Object > normalizeRaw ( ext::trie < KeyType, ValueType > && node ) { - std::map < alib::Object, ext::trie < alib::Object, alib::Object > > children; + ext::map < alib::Object, ext::trie < alib::Object, alib::Object > > children; for ( std::pair < KeyType, ext::trie < KeyType, ValueType > > && child : ext::make_moveable_map ( node.getChildren ( ) ) ) { children.insert ( std::make_pair ( alib::Object ( alib::AnyObject < KeyType > ( std::move ( child.first ) ) ), normalizeRaw ( std::move ( child.second ) ) ) ); @@ -123,15 +123,15 @@ void ObjectsTrie < KeyType, ValueType >::compose ( std::deque < sax::Token > & o } template < class KeyType, class ValueType > -std::map < KeyType, ext::trie < KeyType, ValueType > > ObjectsTrie < KeyType, ValueType >::parseChildren ( std::deque < sax::Token >::iterator & input ) { - std::map < KeyType, ext::trie < KeyType, ValueType > > children; +ext::map < KeyType, ext::trie < KeyType, ValueType > > ObjectsTrie < KeyType, ValueType >::parseChildren ( std::deque < sax::Token >::iterator & input ) { + ext::map < KeyType, ext::trie < KeyType, ValueType > > children; while ( sax::FromXMLParserHelper::isToken ( input, sax::Token::TokenType::START_ELEMENT, "Child" ) ) { sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, "Child" ); KeyType key = alib::xmlApi < KeyType >::parse ( input ); ValueType value = alib::xmlApi < ValueType >::parse ( input ); - std::map < KeyType, ext::trie < KeyType, ValueType > > innerChildren = parseChildren ( input ); + ext::map < KeyType, ext::trie < KeyType, ValueType > > innerChildren = parseChildren ( input ); children.insert ( std::make_pair ( std::move ( key ), ext::trie < KeyType, ValueType > ( std::move ( value ), std::move ( innerChildren ) ) ) ); @@ -145,7 +145,7 @@ template < class KeyType, class ValueType > ext::trie < KeyType, ValueType > ObjectsTrie < KeyType, ValueType >::parseRaw ( std::deque < sax::Token >::iterator & input ) { sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, ObjectsTrie < >::getXmlTagName ( ) ); ValueType value = alib::xmlApi < ValueType >::parse ( input ); - std::map < KeyType, ext::trie < KeyType, ValueType > > children = parseChildren ( input ); + ext::map < KeyType, ext::trie < KeyType, ValueType > > children = parseChildren ( input ); ext::trie < KeyType, ValueType > trie ( std::move ( value ), std::move ( children ) ); @@ -154,7 +154,7 @@ ext::trie < KeyType, ValueType > ObjectsTrie < KeyType, ValueType >::parseRaw ( } template < class KeyType, class ValueType > -void ObjectsTrie < KeyType, ValueType >::composeChildren ( std::deque < sax::Token > & out, const std::map < KeyType, ext::trie < KeyType, ValueType > > & children ) { +void ObjectsTrie < KeyType, ValueType >::composeChildren ( std::deque < sax::Token > & out, const ext::map < KeyType, ext::trie < KeyType, ValueType > > & children ) { for ( const std::pair < const KeyType, ext::trie < KeyType, ValueType > > & child : children ) { out.emplace_back ( "Child", sax::Token::TokenType::START_ELEMENT ); diff --git a/alib2common/src/core/castApi.hpp b/alib2common/src/core/castApi.hpp index 496a927009..7b2b0c17c5 100644 --- a/alib2common/src/core/castApi.hpp +++ b/alib2common/src/core/castApi.hpp @@ -23,7 +23,7 @@ struct castApi { private: class CastPoolBase { protected: - std::map < std::type_index, std::function < alib::Object ( const alib::ObjectBase & ) > > castFunctions; + ext::map < std::type_index, std::function < alib::Object ( const alib::ObjectBase & ) > > castFunctions; virtual std::string toType ( ) = 0; @@ -32,7 +32,7 @@ private: } alib::Object cast ( const alib::ObjectBase & from ) { - std::map < std::type_index, std::function < alib::Object ( const alib::ObjectBase & ) > >::iterator res = castFunctions.find ( std::type_index ( typeid ( from ) ) ); + ext::map < std::type_index, std::function < alib::Object ( const alib::ObjectBase & ) > >::iterator res = castFunctions.find ( std::type_index ( typeid ( from ) ) ); if ( res == castFunctions.end ( ) ) { std::string fromType = ext::to_string ( typeid ( from ) ); @@ -92,7 +92,7 @@ private: }; private: - class CastPoolBaseMap : public std::map < std::type_index, CastPoolBase * > { + class CastPoolBaseMap : public ext::map < std::type_index, CastPoolBase * > { public: ~CastPoolBaseMap ( ) { for ( const std::pair < const std::type_index, CastPoolBase * > & item : * this ) @@ -102,7 +102,7 @@ private: }; // INFO: Function exist to handle static order of initialisation - static std::map < std::type_index, CastPoolBase * > & castFunctionsById ( ) { + static ext::map < std::type_index, CastPoolBase * > & castFunctionsById ( ) { static CastPoolBaseMap res; return res; @@ -110,7 +110,7 @@ private: public: static CastPoolBase & getCastPool ( std::type_index typeId ) { - std::map < std::type_index, CastPoolBase * >::iterator res = castFunctionsById ( ).find ( typeId ); + ext::map < std::type_index, CastPoolBase * >::iterator res = castFunctionsById ( ).find ( typeId ); if ( res == castFunctionsById ( ).end ( ) ) { std::string toType = ext::to_string ( typeId ); @@ -123,7 +123,7 @@ public: template < class To > static CastPool < To > & getCastPool ( ) { - std::map < std::type_index, CastPoolBase * >::iterator res = castFunctionsById ( ).find ( std::type_index ( typeid ( To ) ) ); + ext::map < std::type_index, CastPoolBase * >::iterator res = castFunctionsById ( ).find ( std::type_index ( typeid ( To ) ) ); if ( res == castFunctionsById ( ).end ( ) ) { CastPool < To > * castPool = new CastPool < To > ( ); @@ -135,7 +135,7 @@ public: } static bool castAvailable ( std::type_index to, std::type_index from ) { - std::map < std::type_index, CastPoolBase * >::iterator res = castFunctionsById ( ).find ( to ); + ext::map < std::type_index, CastPoolBase * >::iterator res = castFunctionsById ( ).find ( to ); if ( res == castFunctionsById ( ).end ( ) ) return false; diff --git a/alib2common/src/core/multipleDispatch.hpp b/alib2common/src/core/multipleDispatch.hpp index 09ea9a013a..b5c1d94285 100644 --- a/alib2common/src/core/multipleDispatch.hpp +++ b/alib2common/src/core/multipleDispatch.hpp @@ -59,7 +59,7 @@ private: }; - std::map < typename ext::TupleBuilder < std::type_index, sizeof ... ( DispatchedParameterTypes ) >::type, std::unique_ptr < RegistratorWrapperBase > > registeredFunctions; + ext::map < typename ext::TupleBuilder < std::type_index, sizeof ... ( DispatchedParameterTypes ) >::type, std::unique_ptr < RegistratorWrapperBase > > registeredFunctions; static MultipleDispatch < Algorithm, ReturnType, std::tuple < FrontStaticParamTypes ... >, std::tuple < DispatchedParameterTypes ... >, std::tuple < BackStaticParamTypes ... > > & getInstance ( ) { static MultipleDispatch < Algorithm, ReturnType, std::tuple < FrontStaticParamTypes ... >, std::tuple < DispatchedParameterTypes ... >, std::tuple < BackStaticParamTypes ... > > res; @@ -175,7 +175,7 @@ private: }; - std::map < std::type_index, std::unique_ptr < RegistratorWrapperBase > > registeredFunctions; + ext::map < std::type_index, std::unique_ptr < RegistratorWrapperBase > > registeredFunctions; static PromotingDoubleDispatch < Algorithm, ReturnType, ParametersType > & getInstance ( ) { static PromotingDoubleDispatch < Algorithm, ReturnType, ParametersType > res; @@ -199,7 +199,7 @@ public: } static ReturnType dispatch ( ParametersType && first, ParametersType && second ) { - typename std::map < std::type_index, std::unique_ptr < RegistratorWrapperBase > >::iterator callback = getInstance ( ).registeredFunctions.find ( std::type_index ( typeid ( first ) ) ); + typename ext::map < std::type_index, std::unique_ptr < RegistratorWrapperBase > >::iterator callback = getInstance ( ).registeredFunctions.find ( std::type_index ( typeid ( first ) ) ); if ( ( callback != getInstance ( ).registeredFunctions.end ( ) ) && callback->second->available ( true, std::type_index ( typeid ( first ) ), std::type_index ( typeid ( second ) ) ) ) return callback->second->eval ( true, std::forward < ParametersType > ( first ), std::forward < ParametersType > ( second ) ); diff --git a/alib2common/src/core/namingApi.hpp b/alib2common/src/core/namingApi.hpp index d3cdb8e77e..abf732674a 100644 --- a/alib2common/src/core/namingApi.hpp +++ b/alib2common/src/core/namingApi.hpp @@ -18,8 +18,8 @@ namespace alib { class namingApi { - static std::map < std::string, ext::set < std::type_index > > & getNames ( ) { - static std::map < std::string, ext::set < std::type_index > > names; + static ext::map < std::string, ext::set < std::type_index > > & getNames ( ) { + static ext::map < std::string, ext::set < std::type_index > > names; return names; } diff --git a/alib2common/src/core/xmlApi.hpp b/alib2common/src/core/xmlApi.hpp index 7e30172b56..1ee4c5f0d6 100644 --- a/alib2common/src/core/xmlApi.hpp +++ b/alib2common/src/core/xmlApi.hpp @@ -29,7 +29,7 @@ class xmlApiInputContext : public std::deque < sax::Token >::iterator { template < typename T, typename Enable > friend struct xmlApi; - std::map < std::string, std::map < int, WrapperBaseBase * > > idToInstanceContexts; + ext::map < std::string, ext::map < int, WrapperBaseBase * > > idToInstanceContexts; int idMaxContext; public: @@ -37,12 +37,12 @@ public: } ~xmlApiInputContext ( ) { - for ( const std::pair < const std::string, std::map < int, WrapperBaseBase * > > context : idToInstanceContexts ) + for ( const std::pair < const std::string, ext::map < int, WrapperBaseBase * > > context : idToInstanceContexts ) for ( const std::pair < const int, WrapperBaseBase * > entry : context.second ) delete entry.second; } - std::map < int, WrapperBaseBase * > & idToInstance ( const std::string & name ) { + ext::map < int, WrapperBaseBase * > & idToInstance ( const std::string & name ) { return idToInstanceContexts[name]; } @@ -50,7 +50,7 @@ public: return idMaxContext; } - const std::map < std::string, std::map < int, WrapperBaseBase * > > & dump ( ) const { + const ext::map < std::string, ext::map < int, WrapperBaseBase * > > & dump ( ) const { return idToInstanceContexts; } @@ -60,14 +60,14 @@ class xmlApiOutputContext : public std::deque < sax::Token > { template < typename T, typename Enable > friend struct xmlApi; - std::map < std::string, std::map < const CommonBaseBase *, int > > instanceToIdContexts; + ext::map < std::string, ext::map < const CommonBaseBase *, int > > instanceToIdContexts; int idMaxContext; public: xmlApiOutputContext ( ) : idMaxContext ( 0 ) { } - std::map < const CommonBaseBase *, int > & instanceToId ( const std::string & name ) { + ext::map < const CommonBaseBase *, int > & instanceToId ( const std::string & name ) { return instanceToIdContexts[name]; } @@ -108,8 +108,8 @@ private: virtual Group parse ( std::deque < sax::Token >::iterator & input ) = 0; }; - static std::map < std::string, std::unique_ptr < GroupParser > > & parseFunctions ( ) { - static std::map < std::string, std::unique_ptr < GroupParser > > res; + static ext::map < std::string, std::unique_ptr < GroupParser > > & parseFunctions ( ) { + static ext::map < std::string, std::unique_ptr < GroupParser > > res; return res; } @@ -151,7 +151,7 @@ public: int id = ext::from_string < int > ( sax::FromXMLParserHelper::popTokenData ( input, sax::Token::TokenType::CHARACTER ) ); sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ATTRIBUTE, "id" ); sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ELEMENT, "Ref" ); - std::map < int, WrapperBaseBase * >::iterator elem = input.idToInstance ( ext::to_string < Group > ( ) ).find ( id ); + ext::map < int, WrapperBaseBase * >::iterator elem = input.idToInstance ( ext::to_string < Group > ( ) ).find ( id ); if ( elem == input.idToInstance ( ext::to_string < Group > ( ) ).end ( ) ) { std::cerr << input.dump ( ) << std::endl; @@ -160,7 +160,7 @@ public: return * ( ( Group * ) elem->second ); } else { - typename std::map < std::string, std::unique_ptr < GroupParser > >::iterator callback = parseFunctions ( ).find ( tagName ); + typename ext::map < std::string, std::unique_ptr < GroupParser > >::iterator callback = parseFunctions ( ).find ( tagName ); if ( callback == parseFunctions ( ).end ( ) ) throw exception::CommonException ( "Parse callback for " + tagName + " tag not registered." ); @@ -187,7 +187,7 @@ public: if ( tagName == "Ref" ) return true; - typename std::map < std::string, std::unique_ptr < GroupParser > >::iterator callback = parseFunctions ( ).find ( tagName ); + typename ext::map < std::string, std::unique_ptr < GroupParser > >::iterator callback = parseFunctions ( ).find ( tagName ); if ( callback == parseFunctions ( ).end ( ) ) return false; @@ -203,7 +203,7 @@ public: static void compose ( std::deque < sax::Token > & output, const Group & data ) { xmlApiOutputContext & context = ( xmlApiOutputContext & ) output; - typename std::map < const CommonBaseBase *, int >::iterator elem = context.instanceToId ( ext::to_string < Group > ( ) ).find ( static_cast < const CommonBaseBase * > ( & data.getData ( ) ) ); + typename ext::map < const CommonBaseBase *, int >::iterator elem = context.instanceToId ( ext::to_string < Group > ( ) ).find ( static_cast < const CommonBaseBase * > ( & data.getData ( ) ) ); if ( common::GlobalData::optimizeXml && elem != context.instanceToId ( ext::to_string < Group > ( ) ).end ( ) ) { output.emplace_back ( "Ref", sax::Token::TokenType::START_ELEMENT ); diff --git a/alib2common/src/debug/simpleStacktrace.cpp b/alib2common/src/debug/simpleStacktrace.cpp index 1603387f09..88766b9904 100644 --- a/alib2common/src/debug/simpleStacktrace.cpp +++ b/alib2common/src/debug/simpleStacktrace.cpp @@ -18,7 +18,7 @@ namespace std { int callback(struct dl_phdr_info *info, size_t, void * data) { - std::map<std::string, long>& dlToBaseAddress = *(reinterpret_cast<std::map<std::string, long>*>(data)); + ext::map<std::string, long>& dlToBaseAddress = *(reinterpret_cast<ext::map<std::string, long>*>(data)); dlToBaseAddress.insert(std::make_pair(info->dlpi_name, info->dlpi_addr)); @@ -63,7 +63,7 @@ string simpleStacktrace(unsigned int max_frames) { size_t funcnamesize = 256; char* funcname = (char*)malloc(funcnamesize); - std::map<std::string, long> dlToBaseAddress; + ext::map<std::string, long> dlToBaseAddress; dl_iterate_phdr(callback, &dlToBaseAddress); diff --git a/alib2common/src/introspection/Algorithms.hpp b/alib2common/src/introspection/Algorithms.hpp index 42d052512d..f1e0524cab 100644 --- a/alib2common/src/introspection/Algorithms.hpp +++ b/alib2common/src/introspection/Algorithms.hpp @@ -18,13 +18,13 @@ namespace introspection { class Algorithms { - static std::map < std::string, std::tuple < std::string, ext::vector < std::string >, ext::vector < std::string >, ext::vector < std::string > > > & algorithmInterfaces ( ) { - static std::map < std::string, std::tuple < std::string, ext::vector < std::string >, ext::vector < std::string >, ext::vector < std::string > > > res; + static ext::map < std::string, std::tuple < std::string, ext::vector < std::string >, ext::vector < std::string >, ext::vector < std::string > > > & algorithmInterfaces ( ) { + static ext::map < std::string, std::tuple < std::string, ext::vector < std::string >, ext::vector < std::string >, ext::vector < std::string > > > res; return res; } - static std::map < std::string, ext::set < std::tuple < std::string, ext::vector < std::string > > > > & algorithmCallbacks ( ) { - static std::map < std::string, ext::set < std::tuple < std::string, ext::vector < std::string > > > > res; + static ext::map < std::string, ext::set < std::tuple < std::string, ext::vector < std::string > > > > & algorithmCallbacks ( ) { + static ext::map < std::string, ext::set < std::tuple < std::string, ext::vector < std::string > > > > res; return res; } @@ -47,11 +47,11 @@ class Algorithms { }; public: - static const std::map < std::string, std::tuple < std::string, ext::vector < std::string >, ext::vector < std::string >, ext::vector < std::string > > > & getAlgorithmInterfaces ( ) { + static const ext::map < std::string, std::tuple < std::string, ext::vector < std::string >, ext::vector < std::string >, ext::vector < std::string > > > & getAlgorithmInterfaces ( ) { return algorithmInterfaces ( ); } - static const std::map < std::string, ext::set < std::tuple < std::string, ext::vector < std::string > > > > & getAlgorithmCallbacks ( ) { + static const ext::map < std::string, ext::set < std::tuple < std::string, ext::vector < std::string > > > > & getAlgorithmCallbacks ( ) { return algorithmCallbacks ( ); } diff --git a/alib2common/src/introspection/Casts.hpp b/alib2common/src/introspection/Casts.hpp index f33deb3282..5e86c584e8 100644 --- a/alib2common/src/introspection/Casts.hpp +++ b/alib2common/src/introspection/Casts.hpp @@ -16,22 +16,22 @@ namespace introspection { class Casts { - static std::map < std::string, ext::set < std::string > > & castsFrom ( ) { - static std::map < std::string, ext::set < std::string > > res; + static ext::map < std::string, ext::set < std::string > > & castsFrom ( ) { + static ext::map < std::string, ext::set < std::string > > res; return res; } - static std::map < std::string, ext::set < std::string > > & castsTo ( ) { - static std::map < std::string, ext::set < std::string > > res; + static ext::map < std::string, ext::set < std::string > > & castsTo ( ) { + static ext::map < std::string, ext::set < std::string > > res; return res; } public: - static const std::map < std::string, ext::set < std::string > > & getCastsFrom ( ) { + static const ext::map < std::string, ext::set < std::string > > & getCastsFrom ( ) { return castsFrom ( ); } - static const std::map < std::string, ext::set < std::string > > & getCastsTo ( ) { + static const ext::map < std::string, ext::set < std::string > > & getCastsTo ( ) { return castsTo ( ); } diff --git a/alib2common/src/introspection/DataTypes.hpp b/alib2common/src/introspection/DataTypes.hpp index 9b804a1874..bfe8a7efe4 100644 --- a/alib2common/src/introspection/DataTypes.hpp +++ b/alib2common/src/introspection/DataTypes.hpp @@ -16,8 +16,8 @@ namespace introspection { class DataTypes { - static std::map < std::string, ext::set < std::string > > & typesInGroup ( ) { - static std::map < std::string, ext::set < std::string > > res; + static ext::map < std::string, ext::set < std::string > > & typesInGroup ( ) { + static ext::map < std::string, ext::set < std::string > > res; return res; } @@ -27,7 +27,7 @@ class DataTypes { } public: - static const std::map < std::string, ext::set < std::string > > & getTypesInGroup ( ) { + static const ext::map < std::string, ext::set < std::string > > & getTypesInGroup ( ) { return typesInGroup ( ); } diff --git a/alib2common/test-src/container/ContainerTest.cpp b/alib2common/test-src/container/ContainerTest.cpp index 9b03fd5999..0de594e520 100644 --- a/alib2common/test-src/container/ContainerTest.cpp +++ b/alib2common/test-src/container/ContainerTest.cpp @@ -116,7 +116,7 @@ void ContainerTest::testTrieParsing ( ) { CPPUNIT_ASSERT ( t == t2 ); } { - ext::trie < char, int > t ( 0, std::map < char, ext::trie < char, int > > { std::make_pair ( 'a', ext::trie < char, int > ( 1 ) ), std::make_pair ( 'b', ext::trie < char, int > ( 2 ) ) } ); + ext::trie < char, int > t ( 0, ext::map < char, ext::trie < char, int > > { std::make_pair ( 'a', ext::trie < char, int > ( 1 ) ), std::make_pair ( 'b', ext::trie < char, int > ( 2 ) ) } ); std::string string = alib::XmlDataFactory::toString ( t ); std::cout << string << std::endl; @@ -126,7 +126,7 @@ void ContainerTest::testTrieParsing ( ) { CPPUNIT_ASSERT ( t == t2 ); } { - ext::trie < char, int > t ( 0, std::map < char, ext::trie < char, int > > { std::make_pair ( 'a', ext::trie < char, int > ( 1, std::map < char, ext::trie < char, int > > { std::make_pair ( 'a', ext::trie < char, int > ( 3 ) ), std::make_pair ( 'b', ext::trie < char, int > ( 4 ) ) } ) ), std::make_pair ( 'b', ext::trie < char, int > ( 2, std::map < char, ext::trie < char, int > > { std::make_pair ( 'a', ext::trie < char, int > ( 5 ) ), std::make_pair ( 'b', ext::trie < char, int > ( 6 ) ) } ) ) } ); + ext::trie < char, int > t ( 0, ext::map < char, ext::trie < char, int > > { std::make_pair ( 'a', ext::trie < char, int > ( 1, ext::map < char, ext::trie < char, int > > { std::make_pair ( 'a', ext::trie < char, int > ( 3 ) ), std::make_pair ( 'b', ext::trie < char, int > ( 4 ) ) } ) ), std::make_pair ( 'b', ext::trie < char, int > ( 2, ext::map < char, ext::trie < char, int > > { std::make_pair ( 'a', ext::trie < char, int > ( 5 ) ), std::make_pair ( 'b', ext::trie < char, int > ( 6 ) ) } ) ) } ); std::string string = alib::XmlDataFactory::toString ( t ); std::cout << string << std::endl; diff --git a/alib2common/test-src/measurements/MeasurementsTest.cpp b/alib2common/test-src/measurements/MeasurementsTest.cpp index 8eb74f3d7d..8ccbc8befb 100644 --- a/alib2common/test-src/measurements/MeasurementsTest.cpp +++ b/alib2common/test-src/measurements/MeasurementsTest.cpp @@ -152,7 +152,7 @@ void MeasurementsTest::testCounterMeasurements ( ) { measurements::end ( ); measurements::end ( ); - std::map < std::string, int > expectedResults [ ] = { + ext::map < std::string, int > expectedResults [ ] = { { } , { { "test1", 3 } , { "test2", -19 } , { "test3", -3 } , { "test4", -2 } } , { { "test1", 3 } , { "test2", -19 } , { "test3", -3 } , { "test4", -2 } } , diff --git a/alib2data/src/automaton/FSM/CompactNFA.h b/alib2data/src/automaton/FSM/CompactNFA.h index 94180af057..1861e032e4 100644 --- a/alib2data/src/automaton/FSM/CompactNFA.h +++ b/alib2data/src/automaton/FSM/CompactNFA.h @@ -42,7 +42,7 @@ class InitialState; template < class SymbolType, class StateType > class CompactNFA final : public AutomatonBase, public alib::Components < CompactNFA < SymbolType, StateType >, SymbolType, std::tuple < InputAlphabet >, std::tuple < >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > transitions; + ext::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > transitions; public: explicit CompactNFA ( StateType initialState ); @@ -145,17 +145,17 @@ public: /** * @return automaton transitions */ - const std::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > & getTransitions ( ) const; + const ext::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > & getTransitions ( ) const; /** * @return automaton transitions from state */ - std::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > getTransitionsFromState ( const StateType & from ) const; + ext::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > getTransitionsFromState ( const StateType & from ) const; /** * @return automaton transitions to state */ - std::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > getTransitionsToState ( const StateType & from ) const; + ext::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > getTransitionsToState ( const StateType & from ) const; virtual int compare ( const ObjectBase & other ) const { if ( std::type_index ( typeid ( * this ) ) == std::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); @@ -322,16 +322,16 @@ bool CompactNFA < SymbolType, StateType >::removeTransition ( const StateType & } template < class SymbolType, class StateType > -const std::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > & CompactNFA < SymbolType, StateType >::getTransitions ( ) const { +const ext::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > & CompactNFA < SymbolType, StateType >::getTransitions ( ) const { return transitions; } template < class SymbolType, class StateType > -std::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > CompactNFA < SymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { +ext::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > CompactNFA < SymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); - std::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > transitionsFromState; + ext::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > transitionsFromState; for ( const std::pair < const std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > & transition : transitions ) if ( transition.first.first == from ) @@ -341,11 +341,11 @@ std::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < State } template < class SymbolType, class StateType > -std::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > CompactNFA < SymbolType, StateType >::getTransitionsToState ( const StateType & to ) const { +ext::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > CompactNFA < SymbolType, StateType >::getTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); - std::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > transitionsToState; + ext::map < std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > transitionsToState; for ( const std::pair < const std::pair < StateType, ext::vector < SymbolType > >, ext::set < StateType > > & transition : transitions ) if ( transition.second.find ( to ) != transition.second.end ( ) ) diff --git a/alib2data/src/automaton/FSM/DFA.h b/alib2data/src/automaton/FSM/DFA.h index 5c3575cbdd..85f048a440 100644 --- a/alib2data/src/automaton/FSM/DFA.h +++ b/alib2data/src/automaton/FSM/DFA.h @@ -39,7 +39,7 @@ class InitialState; template<class SymbolType, class StateType > class DFA final : public AutomatonBase, public alib::Components < DFA < SymbolType, StateType >, SymbolType, std::tuple < InputAlphabet >, std::tuple < >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::pair < StateType, SymbolType >, StateType > transitions; + ext::map < std::pair < StateType, SymbolType >, StateType > transitions; public: explicit DFA ( StateType initialState ); @@ -128,17 +128,17 @@ public: /** * @return automaton transitions */ - const std::map < std::pair < StateType, SymbolType >, StateType > & getTransitions ( ) const; + const ext::map < std::pair < StateType, SymbolType >, StateType > & getTransitions ( ) const; /** * @return automaton transitions from state */ - ext::range < typename std::map < std::pair < StateType, SymbolType >, StateType >::const_iterator > getTransitionsFromState ( const StateType & from ) const; + ext::range < typename ext::map < std::pair < StateType, SymbolType >, StateType >::const_iterator > getTransitionsFromState ( const StateType & from ) const; /** * @return automaton transitions to state */ - std::map < std::pair < StateType, SymbolType >, StateType > getTransitionsToState ( const StateType & from ) const; + ext::map < std::pair < StateType, SymbolType >, StateType > getTransitionsToState ( const StateType & from ) const; /** * Determines whether DFA is total deterministic @@ -257,7 +257,7 @@ bool DFA<SymbolType, StateType>::removeTransition ( const StateType & from, cons } template<class SymbolType, class StateType > -const std::map < std::pair < StateType, SymbolType >, StateType > & DFA<SymbolType, StateType>::getTransitions ( ) const { +const ext::map < std::pair < StateType, SymbolType >, StateType > & DFA<SymbolType, StateType>::getTransitions ( ) const { return transitions; } @@ -281,15 +281,15 @@ const std::map < std::pair < StateType, SymbolType >, StateType > & DFA<SymbolTy }; template<class SymbolType, class StateType > -ext::range < typename std::map < std::pair < StateType, SymbolType >, StateType >::const_iterator > DFA<SymbolType, StateType>::getTransitionsFromState ( const StateType & from ) const { +ext::range < typename ext::map < std::pair < StateType, SymbolType >, StateType >::const_iterator > DFA<SymbolType, StateType>::getTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); - typename std::map < std::pair < StateType, SymbolType >, StateType >::const_iterator lower = transitions.begin ( ); + typename ext::map < std::pair < StateType, SymbolType >, StateType >::const_iterator lower = transitions.begin ( ); while ( lower != transitions.end ( ) && lower->first.first < from ) { ++ lower; } - typename std::map < std::pair < StateType, SymbolType >, StateType >::const_iterator upper = transitions.begin ( ); + typename ext::map < std::pair < StateType, SymbolType >, StateType >::const_iterator upper = transitions.begin ( ); while ( upper != transitions.end ( ) && upper->first.first <= from ) { ++ upper; } @@ -298,11 +298,11 @@ ext::range < typename std::map < std::pair < StateType, SymbolType >, StateType } template<class SymbolType, class StateType > -std::map < std::pair < StateType, SymbolType >, StateType > DFA<SymbolType, StateType>::getTransitionsToState ( const StateType & to ) const { +ext::map < std::pair < StateType, SymbolType >, StateType > DFA<SymbolType, StateType>::getTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); - std::map < std::pair < StateType, SymbolType >, StateType > transitionsToState; + ext::map < std::pair < StateType, SymbolType >, StateType > transitionsToState; for ( const std::pair < const std::pair < StateType, SymbolType >, StateType > & transition : transitions ) if ( transition.second == to ) diff --git a/alib2data/src/automaton/FSM/EpsilonNFA.h b/alib2data/src/automaton/FSM/EpsilonNFA.h index 5e62436eb9..509668dadc 100644 --- a/alib2data/src/automaton/FSM/EpsilonNFA.h +++ b/alib2data/src/automaton/FSM/EpsilonNFA.h @@ -42,7 +42,7 @@ class InitialState; template<class SymbolType, class EpsilonType, class StateType > class EpsilonNFA final : public AutomatonBase, public alib::Components < EpsilonNFA < SymbolType, EpsilonType, StateType >, SymbolType, std::tuple < InputAlphabet >, std::tuple < >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > transitions; + ext::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > transitions; public: explicit EpsilonNFA ( StateType initialState ); @@ -184,47 +184,47 @@ public: /** * @return automaton transitions */ - const std::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > & getTransitions ( ) const; + const ext::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > & getTransitions ( ) const; /** * @return automaton epsilon transitions */ - std::map < StateType, ext::set < StateType > > getEpsilonTransitions ( ) const; + ext::map < StateType, ext::set < StateType > > getEpsilonTransitions ( ) const; /** * @return automaton transitions reading some symbol */ - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getSymbolTransitions ( ) const; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getSymbolTransitions ( ) const; /** * @return automaton transitions from state */ - std::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > getTransitionsFromState ( const StateType & from ) const; + ext::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > getTransitionsFromState ( const StateType & from ) const; /** * @return automaton epsilon transitions from state */ - std::map < StateType, ext::set < StateType > > getEpsilonTransitionsFromState ( const StateType & from ) const; + ext::map < StateType, ext::set < StateType > > getEpsilonTransitionsFromState ( const StateType & from ) const; /** * @return automaton transitions from state reading some symbols */ - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getSymbolTransitionsFromState ( const StateType & from ) const; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getSymbolTransitionsFromState ( const StateType & from ) const; /** * @return automaton transitions to state */ - std::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > getTransitionsToState ( const StateType & from ) const; + ext::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > getTransitionsToState ( const StateType & from ) const; /** * @return automaton epsilon transitions to state */ - std::map < StateType, ext::set < StateType > > getEpsilonTransitionsToState ( const StateType & to ) const; + ext::map < StateType, ext::set < StateType > > getEpsilonTransitionsToState ( const StateType & to ) const; /** * @return automaton transitions to state reading some symbols */ - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getSymbolTransitionsToState ( const StateType & to ) const; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getSymbolTransitionsToState ( const StateType & to ) const; /** * Determines whether NFA is without epsilon transitions. @@ -434,13 +434,13 @@ bool EpsilonNFA < SymbolType, EpsilonType, StateType >::removeTransition ( const } template<class SymbolType, class EpsilonType, class StateType > -const std::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > & EpsilonNFA < SymbolType, EpsilonType, StateType >::getTransitions ( ) const { +const ext::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > & EpsilonNFA < SymbolType, EpsilonType, StateType >::getTransitions ( ) const { return transitions; } template<class SymbolType, class EpsilonType, class StateType > -std::map < StateType, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getEpsilonTransitions ( ) const { - std::map < StateType, ext::set < StateType > > result; +ext::map < StateType, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getEpsilonTransitions ( ) const { + ext::map < StateType, ext::set < StateType > > result; for ( const std::pair < const std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > & transition : transitions ) if ( transition.first.second.template is < EpsilonType > ( ) ) @@ -450,8 +450,8 @@ std::map < StateType, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonT } template<class SymbolType, class EpsilonType, class StateType > -std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getSymbolTransitions ( ) const { - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > result; +ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getSymbolTransitions ( ) const { + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > result; for ( const std::pair < const std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > & transition : transitions ) if ( transition.first.second.template is < SymbolType > ( ) ) @@ -461,11 +461,11 @@ std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > Epsilon } template<class SymbolType, class EpsilonType, class StateType > -std::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getTransitionsFromState ( const StateType & from ) const { +ext::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); - std::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > transitionsFromState; + ext::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > transitionsFromState; for ( const std::pair < const std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > & transition : transitions ) if ( transition.first.first == from ) @@ -475,12 +475,12 @@ std::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ex } template<class SymbolType, class EpsilonType, class StateType > -std::map < StateType, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getEpsilonTransitionsFromState ( const StateType & from ) const { +ext::map < StateType, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getEpsilonTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); std::pair < StateType, ext::variant < EpsilonType, SymbolType > > key ( from, ext::variant < EpsilonType, SymbolType >::template from < EpsilonType > ( ) ); - std::map < StateType, ext::set < StateType > > res; + ext::map < StateType, ext::set < StateType > > res; auto transition = transitions.find ( key ); if ( transition != transitions.end ( ) ) @@ -490,11 +490,11 @@ std::map < StateType, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonT } template<class SymbolType, class EpsilonType, class StateType > -std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getSymbolTransitionsFromState ( const StateType & from ) const { +ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getSymbolTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitionsFromState; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitionsFromState; for ( const std::pair < const std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > & transition : transitions ) if ( ( transition.first.first == from ) && transition.first.second.template is < SymbolType > ( ) ) @@ -504,11 +504,11 @@ std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > Epsilon } template<class SymbolType, class EpsilonType, class StateType > -std::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getTransitionsToState ( const StateType & to ) const { +ext::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); - std::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > transitionsToState; + ext::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > transitionsToState; for ( const std::pair < const std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > & transition : transitions ) if ( transition.second.find ( to ) != transition.second.end ( ) ) @@ -518,11 +518,11 @@ std::map < std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ex } template<class SymbolType, class EpsilonType, class StateType > -std::map < StateType, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getEpsilonTransitionsToState ( const StateType & to ) const { +ext::map < StateType, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getEpsilonTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); - std::map < StateType, ext::set < StateType > > transitionsToState; + ext::map < StateType, ext::set < StateType > > transitionsToState; for ( const std::pair < const std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > & transition : transitions ) if ( ( transition.second.find ( to ) != transition.second.end ( ) ) && transition.first.second.template is < EpsilonType > ( ) ) @@ -532,11 +532,11 @@ std::map < StateType, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonT } template<class SymbolType, class EpsilonType, class StateType > -std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getSymbolTransitionsToState ( const StateType & to ) const { +ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > EpsilonNFA < SymbolType, EpsilonType, StateType >::getSymbolTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitionsToState; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitionsToState; for ( const std::pair < const std::pair < StateType, ext::variant < EpsilonType, SymbolType > >, ext::set < StateType > > & transition : transitions ) if ( ( transition.second.find ( to ) != transition.second.end ( ) ) && transition.first.second.template is < SymbolType > ( ) ) diff --git a/alib2data/src/automaton/FSM/ExtendedNFA.h b/alib2data/src/automaton/FSM/ExtendedNFA.h index 19ba86ed45..f6515cce44 100644 --- a/alib2data/src/automaton/FSM/ExtendedNFA.h +++ b/alib2data/src/automaton/FSM/ExtendedNFA.h @@ -45,7 +45,7 @@ class InitialState; template<class SymbolType, class StateType > class ExtendedNFA final : public AutomatonBase, public alib::Components < ExtendedNFA < SymbolType, StateType >, SymbolType, std::tuple < InputAlphabet >, std::tuple < >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > transitions; + ext::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > transitions; public: explicit ExtendedNFA ( StateType initialState ); @@ -149,17 +149,17 @@ public: /** * @return automaton transitions */ - const std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > & getTransitions ( ) const; + const ext::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > & getTransitions ( ) const; /** * @return automaton transitions from state */ - std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > getTransitionsFromState ( const StateType & from ) const; + ext::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > getTransitionsFromState ( const StateType & from ) const; /** * @return automaton transitions to state */ - std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > getTransitionsToState ( const StateType & from ) const; + ext::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > getTransitionsToState ( const StateType & from ) const; virtual int compare ( const ObjectBase & other ) const { if ( std::type_index ( typeid ( * this ) ) == std::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); @@ -340,16 +340,16 @@ bool ExtendedNFA < SymbolType, StateType >::removeTransition ( const StateType & } template<class SymbolType, class StateType > -const std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > & ExtendedNFA < SymbolType, StateType >::getTransitions ( ) const { +const ext::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > & ExtendedNFA < SymbolType, StateType >::getTransitions ( ) const { return transitions; } template<class SymbolType, class StateType > -std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > ExtendedNFA < SymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { +ext::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > ExtendedNFA < SymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); - std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > transitionsFromState; + ext::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > transitionsFromState; for ( const std::pair < const std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > & transition : transitions ) if ( transition.first.first == from ) @@ -359,11 +359,11 @@ std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType } template<class SymbolType, class StateType > -std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > ExtendedNFA < SymbolType, StateType >::getTransitionsToState ( const StateType & to ) const { +ext::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > ExtendedNFA < SymbolType, StateType >::getTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); - std::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > transitionsToState; + ext::map < std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > transitionsToState; for ( const std::pair < const std::pair < StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set < StateType > > & transition : transitions ) if ( transition.second.find ( to ) != transition.second.end ( ) ) diff --git a/alib2data/src/automaton/FSM/MultiInitialStateNFA.h b/alib2data/src/automaton/FSM/MultiInitialStateNFA.h index 8b1701fdff..f317fcc40a 100644 --- a/alib2data/src/automaton/FSM/MultiInitialStateNFA.h +++ b/alib2data/src/automaton/FSM/MultiInitialStateNFA.h @@ -38,7 +38,7 @@ class InitialStates; template < class SymbolType, class StateType > class MultiInitialStateNFA final : public AutomatonBase, public alib::Components < MultiInitialStateNFA < SymbolType, StateType >, SymbolType, std::tuple < InputAlphabet >, std::tuple < >, StateType, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > { protected: - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitions; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitions; public: explicit MultiInitialStateNFA ( ); @@ -142,17 +142,17 @@ public: /** * @return automaton transitions */ - const std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > & getTransitions ( ) const; + const ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > & getTransitions ( ) const; /** * @return automaton transitions from state */ - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getTransitionsFromState ( const StateType & from ) const; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getTransitionsFromState ( const StateType & from ) const; /** * @return automaton transitions to state */ - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getTransitionsToState ( const StateType & from ) const; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getTransitionsToState ( const StateType & from ) const; /** * Determines whether MultiInitialStateNFA is deterministic. @@ -303,16 +303,16 @@ bool MultiInitialStateNFA < SymbolType, StateType >::removeTransition ( const St } template < class SymbolType, class StateType > -const std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > & MultiInitialStateNFA < SymbolType, StateType >::getTransitions ( ) const { +const ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > & MultiInitialStateNFA < SymbolType, StateType >::getTransitions ( ) const { return transitions; } template < class SymbolType, class StateType > -std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > MultiInitialStateNFA < SymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { +ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > MultiInitialStateNFA < SymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitionsFromState; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitionsFromState; for ( const std::pair < const std::pair < StateType, SymbolType >, ext::set < StateType > > & transition : transitions ) if ( transition.first.first == from ) @@ -322,11 +322,11 @@ std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > MultiIn } template < class SymbolType, class StateType > -std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > MultiInitialStateNFA < SymbolType, StateType >::getTransitionsToState ( const StateType & to ) const { +ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > MultiInitialStateNFA < SymbolType, StateType >::getTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitionsToState; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitionsToState; for ( const std::pair < const std::pair < StateType, SymbolType >, ext::set < StateType > > & transition : transitions ) if ( transition.second.find ( to ) != transition.second.end ( ) ) diff --git a/alib2data/src/automaton/FSM/NFA.h b/alib2data/src/automaton/FSM/NFA.h index c02b9e2346..0537952090 100644 --- a/alib2data/src/automaton/FSM/NFA.h +++ b/alib2data/src/automaton/FSM/NFA.h @@ -36,7 +36,7 @@ class InitialState; template<class SymbolType, class StateType > class NFA final : public AutomatonBase, public alib::Components < NFA < SymbolType, StateType >, SymbolType, std::tuple < InputAlphabet >, std::tuple < >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitions; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitions; public: explicit NFA ( StateType initialState ); @@ -135,17 +135,17 @@ public: /** * @return automaton transitions */ - const std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > & getTransitions ( ) const; + const ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > & getTransitions ( ) const; /** * @return automaton transitions from state */ - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getTransitionsFromState ( const StateType & from ) const; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getTransitionsFromState ( const StateType & from ) const; /** * @return automaton transitions to state */ - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getTransitionsToState ( const StateType & from ) const; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > getTransitionsToState ( const StateType & from ) const; /** * Determines whether NFA is deterministic. @@ -288,16 +288,16 @@ bool NFA < SymbolType, StateType >::removeTransition ( const StateType & from, c } template<class SymbolType, class StateType > -const std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > & NFA < SymbolType, StateType >::getTransitions ( ) const { +const ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > & NFA < SymbolType, StateType >::getTransitions ( ) const { return transitions; } template<class SymbolType, class StateType > -std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > NFA < SymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { +ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > NFA < SymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { if ( !getStates ( ).count ( from ) ) throw AutomatonException ( "State \"" + ext::to_string ( from ) + "\" doesn't exist" ); - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitionsFromState; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitionsFromState; for ( const std::pair < const std::pair < StateType, SymbolType >, ext::set < StateType > > & transition : transitions ) if ( transition.first.first == from ) @@ -307,11 +307,11 @@ std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > NFA < S } template<class SymbolType, class StateType > -std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > NFA < SymbolType, StateType >::getTransitionsToState ( const StateType & to ) const { +ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > NFA < SymbolType, StateType >::getTransitionsToState ( const StateType & to ) const { if ( !getStates ( ).count ( to ) ) throw AutomatonException ( "State \"" + ext::to_string ( to ) + "\" doesn't exist" ); - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitionsToState; + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitionsToState; for ( const std::pair < const std::pair < StateType, SymbolType >, ext::set < StateType > > & transition : transitions ) if ( transition.second.find ( to ) != transition.second.end ( ) ) diff --git a/alib2data/src/automaton/PDA/DPDA.h b/alib2data/src/automaton/PDA/DPDA.h index f44adec670..52433cae4a 100644 --- a/alib2data/src/automaton/PDA/DPDA.h +++ b/alib2data/src/automaton/PDA/DPDA.h @@ -46,7 +46,7 @@ class InitialState; template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > class DPDA final : public AutomatonBase, public alib::Components < DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >, InputSymbolType, std::tuple < InputAlphabet>, std::tuple < >, PushdownStoreSymbolType, std::tuple < PushdownStoreAlphabet >, std::tuple < InitialSymbol >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > transitions; + ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > transitions; public: explicit DPDA ( ext::set < StateType > states, ext::set < InputSymbolType > inputAlphabet, ext::set < PushdownStoreSymbolType > pushdownStoreSymbol, StateType initialState, PushdownStoreSymbolType initialPushdownSymbol, ext::set < StateType > finalStates ); @@ -170,17 +170,17 @@ public: /** * @return DPDA transitions */ - const std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > & getTransitions ( ) const; + const ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > & getTransitions ( ) const; /** * @return automaton transitions from state */ - std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > getTransitionsFromState ( const StateType & from ) const; + ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > getTransitionsFromState ( const StateType & from ) const; /** * @return automaton transitions to state */ - std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > getTransitionsToState ( const StateType & from ) const; + ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > getTransitionsToState ( const StateType & from ) const; virtual int compare ( const ObjectBase & other ) const { if ( std::type_index ( typeid ( * this ) ) == std::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); @@ -382,16 +382,16 @@ bool DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >:: } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -const std::map<std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType >, ext::vector<PushdownStoreSymbolType> >, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > >& DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitions() const { +const ext::map<std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType >, ext::vector<PushdownStoreSymbolType> >, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > >& DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitions() const { return transitions; } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -std::map<std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType>, ext::vector<PushdownStoreSymbolType> >, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > > DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitionsFromState(const StateType& from) const { +ext::map<std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType>, ext::vector<PushdownStoreSymbolType> >, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > > DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitionsFromState(const StateType& from) const { if( ! getStates().count(from) ) throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist"); - std::map<std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType>, ext::vector<PushdownStoreSymbolType> >, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > > transitionsFromState; + ext::map<std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType>, ext::vector<PushdownStoreSymbolType> >, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > > transitionsFromState; for (const std::pair<const std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType>, ext::vector<PushdownStoreSymbolType> >, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > >& transition : transitions) { if (std::get<0>(transition.first) == from) { transitionsFromState.insert(std::make_pair(transition.first, transition.second)); @@ -402,11 +402,11 @@ std::map<std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType>, ext:: } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -std::map<std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType>, ext::vector<PushdownStoreSymbolType> >, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > > DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitionsToState(const StateType& to) const { +ext::map<std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType>, ext::vector<PushdownStoreSymbolType> >, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > > DPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitionsToState(const StateType& to) const { if( ! getStates().count(to)) throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist"); - std::map<std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType>, ext::vector<PushdownStoreSymbolType> >, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > > transitionsToState; + ext::map<std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType>, ext::vector<PushdownStoreSymbolType> >, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > > transitionsToState; for (const std::pair<const std::tuple<StateType, ext::variant<EpsilonType, InputSymbolType>, ext::vector<PushdownStoreSymbolType> >, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > >& transition : transitions) { if (transition.second.first == to) { transitionsToState.insert(std::make_pair(transition.first, transition.second)); diff --git a/alib2data/src/automaton/PDA/InputDrivenDPDA.h b/alib2data/src/automaton/PDA/InputDrivenDPDA.h index bde0ee0010..fafa7fc688 100644 --- a/alib2data/src/automaton/PDA/InputDrivenDPDA.h +++ b/alib2data/src/automaton/PDA/InputDrivenDPDA.h @@ -42,8 +42,8 @@ class InitialState; template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > class InputDrivenDPDA final : public AutomatonBase, public alib::Components < InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >, InputSymbolType, std::tuple < InputAlphabet >, std::tuple < >, PushdownStoreSymbolType, std::tuple < PushdownStoreAlphabet >, std::tuple < InitialSymbol >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::pair < StateType, InputSymbolType >, StateType > transitions; - std::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > inputSymbolToPushdownStoreOperation; + ext::map < std::pair < StateType, InputSymbolType >, StateType > transitions; + ext::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > inputSymbolToPushdownStoreOperation; void checkPushdownStoreOperation ( const InputSymbolType & input, const ext::vector < PushdownStoreSymbolType > & pop, const ext::vector < PushdownStoreSymbolType > & push ); @@ -145,11 +145,11 @@ public: bool setPushdownStoreOperation ( InputSymbolType input, ext::vector < PushdownStoreSymbolType > pop, ext::vector < PushdownStoreSymbolType > push ); - void setPushdownStoreOperations ( std::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > operations ); + void setPushdownStoreOperations ( ext::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > operations ); bool clearPushdownStoreOperation ( const InputSymbolType & input ); - const std::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > & getPushdownStoreOperations ( ) const; + const ext::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > & getPushdownStoreOperations ( ) const; /** * Adds transition defined by parameters to the automaton. @@ -170,11 +170,11 @@ public: /** * @return automaton transitions */ - const std::map < std::pair < StateType, InputSymbolType >, StateType > & getTransitions ( ) const; + const ext::map < std::pair < StateType, InputSymbolType >, StateType > & getTransitions ( ) const; - std::map < std::pair < StateType, InputSymbolType >, StateType > getTransitionsFromState ( const StateType & from ) const; + ext::map < std::pair < StateType, InputSymbolType >, StateType > getTransitionsFromState ( const StateType & from ) const; - std::map < std::pair < StateType, InputSymbolType >, StateType > getTransitionsToState ( const StateType & to ) const; + ext::map < std::pair < StateType, InputSymbolType >, StateType > getTransitionsToState ( const StateType & to ) const; /** * Determines whether InputDrivenDPDA is deterministic. @@ -292,7 +292,7 @@ bool InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::se } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -void InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::setPushdownStoreOperations(std::map<InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType>>> operations) { +void InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::setPushdownStoreOperations(ext::map<InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType>>> operations) { ext::set<InputSymbolType> removed; std::set_difference(getInputAlphabet().begin(), getInputAlphabet().end(), ext::key_begin(operations), ext::key_end(operations), std::inserter(removed, removed.end())); @@ -318,7 +318,7 @@ bool InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::cl } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -const std::map < InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType>>>& InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getPushdownStoreOperations() const { +const ext::map < InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType>>>& InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getPushdownStoreOperations() const { return inputSymbolToPushdownStoreOperation; } @@ -364,16 +364,16 @@ bool InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::re } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -const std::map<std::pair<StateType, InputSymbolType>, StateType>& InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitions() const { +const ext::map<std::pair<StateType, InputSymbolType>, StateType>& InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitions() const { return transitions; } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -std::map<std::pair<StateType, InputSymbolType>, StateType > InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitionsFromState(const StateType& from) const { +ext::map<std::pair<StateType, InputSymbolType>, StateType > InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitionsFromState(const StateType& from) const { if( ! getStates().count(from)) throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist"); - std::map<std::pair<StateType, InputSymbolType>, StateType> transitionsFromState; + ext::map<std::pair<StateType, InputSymbolType>, StateType> transitionsFromState; for (const std::pair<const std::pair<StateType, InputSymbolType>, StateType>& transition : transitions) { if (transition.first.first == from) { transitionsFromState.insert(transition); @@ -384,11 +384,11 @@ std::map<std::pair<StateType, InputSymbolType>, StateType > InputDrivenDPDA < In } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -std::map<std::pair<StateType, InputSymbolType>, StateType> InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitionsToState(const StateType& to) const { +ext::map<std::pair<StateType, InputSymbolType>, StateType> InputDrivenDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitionsToState(const StateType& to) const { if( ! getStates().count(to)) throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist"); - std::map<std::pair<StateType, InputSymbolType>, StateType> transitionsToState; + ext::map<std::pair<StateType, InputSymbolType>, StateType> transitionsToState; for (const std::pair<const std::pair<StateType, InputSymbolType>, StateType>& transition : transitions) { if (transition.second == to) { transitionsToState.insert(transition); diff --git a/alib2data/src/automaton/PDA/InputDrivenNPDA.h b/alib2data/src/automaton/PDA/InputDrivenNPDA.h index bcf10c9341..2ec1a54346 100644 --- a/alib2data/src/automaton/PDA/InputDrivenNPDA.h +++ b/alib2data/src/automaton/PDA/InputDrivenNPDA.h @@ -42,8 +42,8 @@ class InitialState; template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > class InputDrivenNPDA final : public AutomatonBase, public alib::Components < InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >, InputSymbolType, std::tuple < InputAlphabet >, std::tuple < >, PushdownStoreSymbolType, std::tuple < PushdownStoreAlphabet >, std::tuple < InitialSymbol >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::pair < StateType, InputSymbolType >, ext::set < StateType > > transitions; - std::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > inputSymbolToPushdownStoreOperation; + ext::map < std::pair < StateType, InputSymbolType >, ext::set < StateType > > transitions; + ext::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > inputSymbolToPushdownStoreOperation; void checkPushdownStoreOperation ( const InputSymbolType & input, const ext::vector < PushdownStoreSymbolType > & pop, const ext::vector < PushdownStoreSymbolType > & push ); @@ -145,11 +145,11 @@ public: bool setPushdownStoreOperation ( InputSymbolType input, ext::vector < PushdownStoreSymbolType > pop, ext::vector < PushdownStoreSymbolType > push ); - void setPushdownStoreOperations ( std::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > operations ); + void setPushdownStoreOperations ( ext::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > operations ); bool clearPushdownStoreOperation ( const InputSymbolType & input ); - const std::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > & getPushdownStoreOperations ( ) const; + const ext::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > & getPushdownStoreOperations ( ) const; /** * Adds transition defined by parameters to the automaton. @@ -179,11 +179,11 @@ public: /** * @return automaton transitions */ - const std::map < std::pair < StateType, InputSymbolType >, ext::set < StateType > > & getTransitions ( ) const; + const ext::map < std::pair < StateType, InputSymbolType >, ext::set < StateType > > & getTransitions ( ) const; - std::map < std::pair < StateType, InputSymbolType >, ext::set < StateType > > getTransitionsFromState ( const StateType & from ) const; + ext::map < std::pair < StateType, InputSymbolType >, ext::set < StateType > > getTransitionsFromState ( const StateType & from ) const; - std::map < std::pair < StateType, InputSymbolType >, ext::set < StateType > > getTransitionsToState ( const StateType & to ) const; + ext::map < std::pair < StateType, InputSymbolType >, ext::set < StateType > > getTransitionsToState ( const StateType & to ) const; /** * Determines whether InputDrivenNPDA is deterministic. @@ -301,7 +301,7 @@ bool InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::se } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -void InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::setPushdownStoreOperations(std::map < InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType>>> operations) { +void InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::setPushdownStoreOperations(ext::map < InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType>>> operations) { ext::set < InputSymbolType> removed; std::set_difference(getInputAlphabet().begin(), getInputAlphabet().end(), ext::key_begin(operations), ext::key_end(operations), std::inserter(removed, removed.end())); @@ -327,7 +327,7 @@ bool InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::cl } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -const std::map < InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType>>>& InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getPushdownStoreOperations() const { +const ext::map < InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType>>>& InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getPushdownStoreOperations() const { return inputSymbolToPushdownStoreOperation; } @@ -376,16 +376,16 @@ bool InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::re } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -const std::map<std::pair < StateType, InputSymbolType >, ext::set<StateType > >& InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitions() const { +const ext::map<std::pair < StateType, InputSymbolType >, ext::set<StateType > >& InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitions() const { return transitions; } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -std::map<std::pair<StateType, InputSymbolType>, ext::set<StateType > > InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitionsFromState(const StateType& from) const { +ext::map<std::pair<StateType, InputSymbolType>, ext::set<StateType > > InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitionsFromState(const StateType& from) const { if (! getStates().count(from)) throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist"); - std::map<std::pair<StateType, InputSymbolType>, ext::set<StateType > > transitionsFromState; + ext::map<std::pair<StateType, InputSymbolType>, ext::set<StateType > > transitionsFromState; for (const std::pair<const std::pair < StateType, InputSymbolType>, ext::set<StateType > >& transition : transitions) { if (transition.first.first == from) { transitionsFromState[transition.first].insert(transition.second.begin(), transition.second.end()); @@ -396,11 +396,11 @@ std::map<std::pair<StateType, InputSymbolType>, ext::set<StateType > > InputDriv } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -std::map<std::pair<StateType, InputSymbolType>, ext::set<StateType > > InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitionsToState(const StateType& to) const { +ext::map<std::pair<StateType, InputSymbolType>, ext::set<StateType > > InputDrivenNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getTransitionsToState(const StateType& to) const { if (! getStates().count(to)) throw AutomatonException("State \"" + ext::to_string ( to ) + "\" doesn't exist"); - std::map<std::pair<StateType, InputSymbolType>, ext::set<StateType > > transitionsToState; + ext::map<std::pair<StateType, InputSymbolType>, ext::set<StateType > > transitionsToState; for (const std::pair<const std::pair<StateType, InputSymbolType>, ext::set<StateType > >& transition : transitions) { if (transition.second.find(to) != transition.second.end()) { transitionsToState[transition.first].insert(transition.second.begin(), transition.second.end()); diff --git a/alib2data/src/automaton/PDA/NPDA.h b/alib2data/src/automaton/PDA/NPDA.h index b37c7aef5a..2cbe0a680b 100644 --- a/alib2data/src/automaton/PDA/NPDA.h +++ b/alib2data/src/automaton/PDA/NPDA.h @@ -42,7 +42,7 @@ class InitialState; template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > class NPDA final : public AutomatonBase, public alib::Components < NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >, InputSymbolType, std::tuple < InputAlphabet >, std::tuple < >, PushdownStoreSymbolType, std::tuple < PushdownStoreAlphabet >, std::tuple < InitialSymbol >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, ext::set < std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > > transitions; + ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, ext::set < std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > > transitions; public: explicit NPDA ( ext::set < StateType > states, ext::set < InputSymbolType > inputAlphabet, ext::set < PushdownStoreSymbolType > pushdownStoreSymbol, StateType initialState, PushdownStoreSymbolType initialPushdownSymbol, ext::set < StateType > finalStates ); @@ -178,7 +178,7 @@ public: /** * @return NPDA transitions */ - const std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, ext::set < std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > > & getTransitions ( ) const; + const ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, ext::set < std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > > & getTransitions ( ) const; virtual int compare ( const ObjectBase & other ) const { if ( std::type_index ( typeid ( * this ) ) == std::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); @@ -351,7 +351,7 @@ bool NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >:: } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -const std::map<std::tuple<StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector<PushdownStoreSymbolType> >, ext::set<std::pair<StateType, ext::vector<PushdownStoreSymbolType> > > >& NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitions() const { +const ext::map<std::tuple<StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector<PushdownStoreSymbolType> >, ext::set<std::pair<StateType, ext::vector<PushdownStoreSymbolType> > > >& NPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitions() const { return transitions; } diff --git a/alib2data/src/automaton/PDA/NPDTA.h b/alib2data/src/automaton/PDA/NPDTA.h index f07c6c2d3b..ab400ccdc3 100644 --- a/alib2data/src/automaton/PDA/NPDTA.h +++ b/alib2data/src/automaton/PDA/NPDTA.h @@ -43,7 +43,7 @@ class InitialState; template < class InputSymbolType, class OutputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > class NPDTA final : public AutomatonBase, public alib::Components < NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >, InputSymbolType, std::tuple < InputAlphabet >, std::tuple < >, OutputSymbolType, std::tuple < OutputAlphabet >, std::tuple < >, PushdownStoreSymbolType, std::tuple < PushdownStoreAlphabet >, std::tuple < InitialSymbol >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, ext::set < std::tuple < StateType, ext::vector < PushdownStoreSymbolType >, ext::vector < OutputSymbolType > > > > transitions; + ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, ext::set < std::tuple < StateType, ext::vector < PushdownStoreSymbolType >, ext::vector < OutputSymbolType > > > > transitions; public: explicit NPDTA ( ext::set < StateType > states, ext::set < InputSymbolType > inputAlphabet, ext::set < OutputSymbolType > outputAlphabet, ext::set < PushdownStoreSymbolType > pushdownStoreSymbol, StateType initialState, PushdownStoreSymbolType initialPushdownSymbol, ext::set < StateType > finalStates ); @@ -200,9 +200,9 @@ public: /** * @return NPDTA transitions */ - const std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, ext::set < std::tuple < StateType, ext::vector < PushdownStoreSymbolType >, ext::vector < OutputSymbolType > > > > & getTransitions ( ) const; + const ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, ext::set < std::tuple < StateType, ext::vector < PushdownStoreSymbolType >, ext::vector < OutputSymbolType > > > > & getTransitions ( ) const; - std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::tuple < StateType, ext::vector < PushdownStoreSymbolType >, ext::vector < OutputSymbolType > > > getTransitionsFromState ( const StateType & from ) const; + ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::tuple < StateType, ext::vector < PushdownStoreSymbolType >, ext::vector < OutputSymbolType > > > getTransitionsFromState ( const StateType & from ) const; virtual int compare ( const ObjectBase & other ) const { if ( std::type_index ( typeid ( * this ) ) == std::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); @@ -393,16 +393,16 @@ bool NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbol } template < class InputSymbolType, class OutputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -const std::map<std::tuple<StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector<PushdownStoreSymbolType> >, ext::set<std::tuple<StateType, ext::vector<PushdownStoreSymbolType>, ext::vector < OutputSymbolType > > > >& NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitions() const { +const ext::map<std::tuple<StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector<PushdownStoreSymbolType> >, ext::set<std::tuple<StateType, ext::vector<PushdownStoreSymbolType>, ext::vector < OutputSymbolType > > > >& NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitions() const { return transitions; } template < class InputSymbolType, class OutputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::tuple < StateType, ext::vector < PushdownStoreSymbolType >, ext::vector < OutputSymbolType > > > NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { +ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::tuple < StateType, ext::vector < PushdownStoreSymbolType >, ext::vector < OutputSymbolType > > > NPDTA < InputSymbolType, OutputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitionsFromState ( const StateType & from ) const { if( !getStates().count(from)) throw AutomatonException("State \"" + ext::to_string ( from ) + "\" doesn't exist"); - std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::tuple < StateType, ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > transitionsFromState; + ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, ext::vector < PushdownStoreSymbolType > >, std::tuple < StateType, ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > transitionsFromState; for ( auto transition: transitions ) { for ( auto iter: transition.second ) { if ( std::get<0>(transition.first) == from ) { diff --git a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.h b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.h index 4d8aa79395..9a70b03d24 100644 --- a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.h +++ b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicDPDA.h @@ -42,9 +42,9 @@ class InitialState; template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > class RealTimeHeightDeterministicDPDA final : public AutomatonBase, public alib::Components < RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >, InputSymbolType, std::tuple < InputAlphabet >, std::tuple < >, PushdownStoreSymbolType, std::tuple < PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, std::pair < StateType, PushdownStoreSymbolType > > callTransitions; - std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, StateType > returnTransitions; - std::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, StateType > localTransitions; + ext::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, std::pair < StateType, PushdownStoreSymbolType > > callTransitions; + ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, StateType > returnTransitions; + ext::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, StateType > localTransitions; public: explicit RealTimeHeightDeterministicDPDA ( ext::set < StateType > states, ext::set < InputSymbolType > inputAlphabet, ext::set < PushdownStoreSymbolType > pushdownStoreSymbol, StateType initialState, PushdownStoreSymbolType bottomOfTheStackSymbol, ext::set < StateType > finalStates ); @@ -202,11 +202,11 @@ public: bool removeLocalTransition ( const StateType & current, const StateType & next ); bool removeLocalTransition ( const StateType & current, const InputSymbolType & input, const StateType & next ); - const std::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, std::pair < StateType, PushdownStoreSymbolType > > & getCallTransitions ( ) const; + const ext::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, std::pair < StateType, PushdownStoreSymbolType > > & getCallTransitions ( ) const; - const std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, StateType > & getReturnTransitions ( ) const; + const ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, StateType > & getReturnTransitions ( ) const; - const std::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, StateType > & getLocalTransitions ( ) const; + const ext::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, StateType > & getLocalTransitions ( ) const; virtual int compare ( const ObjectBase & other ) const { if ( std::type_index ( typeid ( * this ) ) == std::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); @@ -574,17 +574,17 @@ bool RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownSto } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -const std::map<std::pair<StateType, ext::variant < EpsilonType, InputSymbolType >>, std::pair<StateType, PushdownStoreSymbolType> >& RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getCallTransitions() const { +const ext::map<std::pair<StateType, ext::variant < EpsilonType, InputSymbolType >>, std::pair<StateType, PushdownStoreSymbolType> >& RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getCallTransitions() const { return callTransitions; } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -const std::map<std::tuple<StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType>, StateType>& RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getReturnTransitions() const { +const ext::map<std::tuple<StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType>, StateType>& RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getReturnTransitions() const { return returnTransitions; } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -const std::map<std::pair<StateType, ext::variant < EpsilonType, InputSymbolType >>, StateType>& RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getLocalTransitions() const { +const ext::map<std::pair<StateType, ext::variant < EpsilonType, InputSymbolType >>, StateType>& RealTimeHeightDeterministicDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getLocalTransitions() const { return localTransitions; } diff --git a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h index 562ca6c8b1..3c903357e0 100644 --- a/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h +++ b/alib2data/src/automaton/PDA/RealTimeHeightDeterministicNPDA.h @@ -42,9 +42,9 @@ class InitialStates; template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > class RealTimeHeightDeterministicNPDA final : public AutomatonBase, public alib::Components < RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >, InputSymbolType, std::tuple < InputAlphabet >, std::tuple < >, PushdownStoreSymbolType, std::tuple < PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, StateType, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > { protected: - std::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, ext::set < std::pair < StateType, PushdownStoreSymbolType > > > callTransitions; - std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, ext::set < StateType > > returnTransitions; - std::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, ext::set < StateType > > localTransitions; + ext::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, ext::set < std::pair < StateType, PushdownStoreSymbolType > > > callTransitions; + ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, ext::set < StateType > > returnTransitions; + ext::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, ext::set < StateType > > localTransitions; public: explicit RealTimeHeightDeterministicNPDA ( ext::set < StateType > states, ext::set < InputSymbolType > inputAlphabet, ext::set < PushdownStoreSymbolType > pushdownStoreSymbol, ext::set < StateType > initialStates, PushdownStoreSymbolType bottomOfTheStackSymbol, ext::set < StateType > finalStates ); @@ -243,11 +243,11 @@ public: bool removeLocalTransition ( const StateType & current, const StateType & next ); bool removeLocalTransition ( const StateType & current, const InputSymbolType & input, const StateType & next ); - const std::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, ext::set < std::pair < StateType, PushdownStoreSymbolType > > > & getCallTransitions ( ) const; + const ext::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, ext::set < std::pair < StateType, PushdownStoreSymbolType > > > & getCallTransitions ( ) const; - const std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, ext::set < StateType > > & getReturnTransitions ( ) const; + const ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, ext::set < StateType > > & getReturnTransitions ( ) const; - const std::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, ext::set < StateType > > & getLocalTransitions ( ) const; + const ext::map < std::pair < StateType, ext::variant < EpsilonType, InputSymbolType > >, ext::set < StateType > > & getLocalTransitions ( ) const; virtual int compare ( const ObjectBase & other ) const { if ( std::type_index ( typeid ( * this ) ) == std::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); @@ -591,17 +591,17 @@ bool RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownSto } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -const std::map<std::pair<StateType, ext::variant < EpsilonType, InputSymbolType >>, ext::set<std::pair<StateType, PushdownStoreSymbolType> > >& RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getCallTransitions() const { +const ext::map<std::pair<StateType, ext::variant < EpsilonType, InputSymbolType >>, ext::set<std::pair<StateType, PushdownStoreSymbolType> > >& RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getCallTransitions() const { return callTransitions; } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -const std::map<std::tuple<StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType>, ext::set<StateType> >& RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getReturnTransitions() const { +const ext::map<std::tuple<StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType>, ext::set<StateType> >& RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getReturnTransitions() const { return returnTransitions; } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -const std::map<std::pair<StateType, ext::variant < EpsilonType, InputSymbolType >>, ext::set<StateType> >& RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getLocalTransitions() const { +const ext::map<std::pair<StateType, ext::variant < EpsilonType, InputSymbolType >>, ext::set<StateType> >& RealTimeHeightDeterministicNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getLocalTransitions() const { return localTransitions; } diff --git a/alib2data/src/automaton/PDA/SinglePopDPDA.h b/alib2data/src/automaton/PDA/SinglePopDPDA.h index 87d943eead..c0c3f76feb 100644 --- a/alib2data/src/automaton/PDA/SinglePopDPDA.h +++ b/alib2data/src/automaton/PDA/SinglePopDPDA.h @@ -47,7 +47,7 @@ class InitialState; template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > class SinglePopDPDA final : public AutomatonBase, public alib::Components < SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >, InputSymbolType, std::tuple < InputAlphabet >, std::tuple < >, PushdownStoreSymbolType, std::tuple < PushdownStoreAlphabet >, std::tuple < InitialSymbol >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > transitions; + ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > transitions; public: explicit SinglePopDPDA ( ext::set < StateType > states, ext::set < InputSymbolType > inputAlphabet, ext::set < PushdownStoreSymbolType > pushdownStoreSymbol, StateType initialState, PushdownStoreSymbolType initialPushdownSymbol, ext::set < StateType > finalStates ); @@ -171,7 +171,7 @@ public: /** * @return SinglePopDPDA transitions */ - const std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > & getTransitions ( ) const; + const ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > & getTransitions ( ) const; virtual int compare ( const ObjectBase & other ) const { if ( std::type_index ( typeid ( * this ) ) == std::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); @@ -343,7 +343,7 @@ bool SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, Stat } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -const std::map<std::tuple<StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType>, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > >& SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitions() const { +const ext::map<std::tuple<StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType>, std::pair<StateType, ext::vector<PushdownStoreSymbolType> > >& SinglePopDPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitions() const { return transitions; } diff --git a/alib2data/src/automaton/PDA/SinglePopNPDA.h b/alib2data/src/automaton/PDA/SinglePopNPDA.h index a90d0640b9..ada30f3a32 100644 --- a/alib2data/src/automaton/PDA/SinglePopNPDA.h +++ b/alib2data/src/automaton/PDA/SinglePopNPDA.h @@ -42,7 +42,7 @@ class InitialState; template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > class SinglePopNPDA final : public AutomatonBase, public alib::Components < SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >, InputSymbolType, std::tuple < InputAlphabet >, std::tuple < >, PushdownStoreSymbolType, std::tuple < PushdownStoreAlphabet >, std::tuple < InitialSymbol >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, ext::set < std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > > transitions; + ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, ext::set < std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > > transitions; public: explicit SinglePopNPDA ( ext::set < StateType > states, ext::set < InputSymbolType > inputAlphabet, ext::set < PushdownStoreSymbolType > pushdownStoreSymbol, StateType initialState, PushdownStoreSymbolType initialPushdownSymbol, ext::set < StateType > finalStates ); @@ -178,7 +178,7 @@ public: /** * @return SinglePopNPDA transitions */ - const std::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, ext::set < std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > > & getTransitions ( ) const; + const ext::map < std::tuple < StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType >, ext::set < std::pair < StateType, ext::vector < PushdownStoreSymbolType > > > > & getTransitions ( ) const; virtual int compare ( const ObjectBase & other ) const { if ( std::type_index ( typeid ( * this ) ) == std::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); @@ -354,7 +354,7 @@ bool SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, Stat } template < class InputSymbolType, class EpsilonType, class PushdownStoreSymbolType, class StateType > -const std::map<std::tuple<StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType>, ext::set<std::pair<StateType, ext::vector<PushdownStoreSymbolType> > > >& SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitions() const { +const ext::map<std::tuple<StateType, ext::variant < EpsilonType, InputSymbolType >, PushdownStoreSymbolType>, ext::set<std::pair<StateType, ext::vector<PushdownStoreSymbolType> > > >& SinglePopNPDA < InputSymbolType, EpsilonType, PushdownStoreSymbolType, StateType >::getTransitions() const { return transitions; } diff --git a/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.h b/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.h index 661adf9a27..424fa7d5c9 100644 --- a/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.h +++ b/alib2data/src/automaton/PDA/VisiblyPushdownDPDA.h @@ -43,9 +43,9 @@ class InitialState; template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > class VisiblyPushdownDPDA final : public AutomatonBase, public alib::Components < VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >, PushdownStoreSymbolType, std::tuple < CallAlphabet, ReturnAlphabet, LocalAlphabet >, std::tuple < >, PushdownStoreSymbolType, std::tuple < PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::pair < StateType, InputSymbolType >, std::pair < StateType, PushdownStoreSymbolType > > callTransitions; - std::map < std::tuple < StateType, InputSymbolType, PushdownStoreSymbolType >, StateType > returnTransitions; - std::map < std::pair < StateType, InputSymbolType >, StateType > localTransitions; + ext::map < std::pair < StateType, InputSymbolType >, std::pair < StateType, PushdownStoreSymbolType > > callTransitions; + ext::map < std::tuple < StateType, InputSymbolType, PushdownStoreSymbolType >, StateType > returnTransitions; + ext::map < std::pair < StateType, InputSymbolType >, StateType > localTransitions; public: explicit VisiblyPushdownDPDA ( ext::set < StateType > states, ext::set < InputSymbolType > callAlphabet, ext::set < InputSymbolType > returnAlphabet, ext::set < InputSymbolType > localAlphabet, ext::set < PushdownStoreSymbolType > pushdownStoreSymbol, StateType initialState, PushdownStoreSymbolType bottomOfTheStackSymbol, ext::set < StateType > finalStates ); @@ -235,11 +235,11 @@ public: */ bool removeLocalTransition ( const StateType & current, const InputSymbolType & input, const StateType & next ); - const std::map < std::pair < StateType, InputSymbolType >, std::pair < StateType, PushdownStoreSymbolType > > & getCallTransitions ( ) const; + const ext::map < std::pair < StateType, InputSymbolType >, std::pair < StateType, PushdownStoreSymbolType > > & getCallTransitions ( ) const; - const std::map < std::tuple < StateType, InputSymbolType, PushdownStoreSymbolType >, StateType > & getReturnTransitions ( ) const; + const ext::map < std::tuple < StateType, InputSymbolType, PushdownStoreSymbolType >, StateType > & getReturnTransitions ( ) const; - const std::map < std::pair < StateType, InputSymbolType >, StateType > & getLocalTransitions ( ) const; + const ext::map < std::pair < StateType, InputSymbolType >, StateType > & getLocalTransitions ( ) const; virtual int compare ( const ObjectBase & other ) const { if ( std::type_index ( typeid ( * this ) ) == std::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); @@ -493,17 +493,17 @@ bool VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType > } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -const std::map<std::pair<StateType, InputSymbolType>, std::pair<StateType, PushdownStoreSymbolType> >& VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getCallTransitions() const { +const ext::map<std::pair<StateType, InputSymbolType>, std::pair<StateType, PushdownStoreSymbolType> >& VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getCallTransitions() const { return callTransitions; } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -const std::map<std::tuple<StateType, InputSymbolType, PushdownStoreSymbolType>, StateType>& VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getReturnTransitions() const { +const ext::map<std::tuple<StateType, InputSymbolType, PushdownStoreSymbolType>, StateType>& VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getReturnTransitions() const { return returnTransitions; } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -const std::map<std::pair<StateType, InputSymbolType>, StateType>& VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getLocalTransitions() const { +const ext::map<std::pair<StateType, InputSymbolType>, StateType>& VisiblyPushdownDPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getLocalTransitions() const { return localTransitions; } diff --git a/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h b/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h index 2e0c8c6f22..60dea9b04b 100644 --- a/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h +++ b/alib2data/src/automaton/PDA/VisiblyPushdownNPDA.h @@ -43,9 +43,9 @@ class InitialStates; template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > class VisiblyPushdownNPDA final : public AutomatonBase, public alib::Components < VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >, InputSymbolType, std::tuple < CallAlphabet, ReturnAlphabet, LocalAlphabet >, std::tuple < >, PushdownStoreSymbolType, std::tuple < PushdownStoreAlphabet >, std::tuple < BottomOfTheStackSymbol >, StateType, std::tuple < States, InitialStates, FinalStates >, std::tuple < > > { protected: - std::map < std::pair < StateType, InputSymbolType >, ext::set < std::pair < StateType, PushdownStoreSymbolType > > > callTransitions; - std::map < std::tuple < StateType, InputSymbolType, PushdownStoreSymbolType >, ext::set < StateType > > returnTransitions; - std::map < std::pair < StateType, InputSymbolType >, ext::set < StateType > > localTransitions; + ext::map < std::pair < StateType, InputSymbolType >, ext::set < std::pair < StateType, PushdownStoreSymbolType > > > callTransitions; + ext::map < std::tuple < StateType, InputSymbolType, PushdownStoreSymbolType >, ext::set < StateType > > returnTransitions; + ext::map < std::pair < StateType, InputSymbolType >, ext::set < StateType > > localTransitions; public: explicit VisiblyPushdownNPDA ( ext::set < StateType > states, ext::set < InputSymbolType > callAlphabet, ext::set < InputSymbolType > returnAlphabet, ext::set < InputSymbolType > localAlphabet, ext::set < PushdownStoreSymbolType > pushdownStoreSymbol, ext::set < StateType > initialStates, PushdownStoreSymbolType bottomOfTheStackSymbol, ext::set < StateType > finalStates ); @@ -270,11 +270,11 @@ public: */ bool removeLocalTransition ( const StateType & current, const InputSymbolType & input, const StateType & next ); - const std::map < std::pair < StateType, InputSymbolType >, ext::set < std::pair < StateType, PushdownStoreSymbolType > > > & getCallTransitions ( ) const; + const ext::map < std::pair < StateType, InputSymbolType >, ext::set < std::pair < StateType, PushdownStoreSymbolType > > > & getCallTransitions ( ) const; - const std::map < std::tuple < StateType, InputSymbolType, PushdownStoreSymbolType >, ext::set < StateType > > & getReturnTransitions ( ) const; + const ext::map < std::tuple < StateType, InputSymbolType, PushdownStoreSymbolType >, ext::set < StateType > > & getReturnTransitions ( ) const; - const std::map < std::pair < StateType, InputSymbolType >, ext::set < StateType > > & getLocalTransitions ( ) const; + const ext::map < std::pair < StateType, InputSymbolType >, ext::set < StateType > > & getLocalTransitions ( ) const; virtual int compare ( const ObjectBase & other ) const { if ( std::type_index ( typeid ( * this ) ) == std::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); @@ -513,17 +513,17 @@ bool VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType > } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -const std::map<std::pair<StateType, InputSymbolType>, ext::set<std::pair<StateType, PushdownStoreSymbolType> > >& VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getCallTransitions() const { +const ext::map<std::pair<StateType, InputSymbolType>, ext::set<std::pair<StateType, PushdownStoreSymbolType> > >& VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getCallTransitions() const { return callTransitions; } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -const std::map<std::tuple<StateType, InputSymbolType, PushdownStoreSymbolType>, ext::set<StateType> >& VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getReturnTransitions() const { +const ext::map<std::tuple<StateType, InputSymbolType, PushdownStoreSymbolType>, ext::set<StateType> >& VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getReturnTransitions() const { return returnTransitions; } template < class InputSymbolType, class PushdownStoreSymbolType, class StateType > -const std::map<std::pair<StateType, InputSymbolType>, ext::set<StateType> >& VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getLocalTransitions() const { +const ext::map<std::pair<StateType, InputSymbolType>, ext::set<StateType> >& VisiblyPushdownNPDA < InputSymbolType, PushdownStoreSymbolType, StateType >::getLocalTransitions() const { return localTransitions; } diff --git a/alib2data/src/automaton/TA/DFTA.h b/alib2data/src/automaton/TA/DFTA.h index e44a5e3aa7..30d4b95464 100644 --- a/alib2data/src/automaton/TA/DFTA.h +++ b/alib2data/src/automaton/TA/DFTA.h @@ -38,7 +38,7 @@ class FinalStates; */ template<class SymbolType, class RankType, class StateType > class DFTA final : public AutomatonBase, public alib::Components < DFTA < SymbolType, RankType, StateType >, common::ranked_symbol < SymbolType, RankType >, std::tuple < InputAlphabet >, std::tuple < >, StateType, std::tuple < States, FinalStates >, std::tuple < > > { - std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < StateType > >, StateType > transitions; + ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < StateType > >, StateType > transitions; public: explicit DFTA ( ); @@ -118,7 +118,7 @@ public: /** * @return automaton transitions */ - const std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < StateType > >, StateType > & getTransitions ( ) const { return transitions; } + const ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < StateType > >, StateType > & getTransitions ( ) const { return transitions; } ext::set < StateType > getTransitionRightSide ( const common::ranked_symbol < SymbolType, RankType > symbol, const ext::vector < StateType > & states ); diff --git a/alib2data/src/automaton/TA/NFTA.h b/alib2data/src/automaton/TA/NFTA.h index f9a553360b..e41d23f14d 100644 --- a/alib2data/src/automaton/TA/NFTA.h +++ b/alib2data/src/automaton/TA/NFTA.h @@ -37,7 +37,7 @@ class FinalStates; */ template < class SymbolType, class RankType, class StateType > class NFTA final : public AutomatonBase, public alib::Components < NFTA < SymbolType, RankType, StateType >, common::ranked_symbol < SymbolType, RankType >, std::tuple < InputAlphabet >, std::tuple < >, StateType, std::tuple < States, FinalStates >, std::tuple < > > { - std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < StateType > >, ext::set < StateType > > transitions; + ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < StateType > >, ext::set < StateType > > transitions; public: explicit NFTA ( ); @@ -127,7 +127,7 @@ public: /** * @return automaton transitions */ - const std::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < StateType > >, ext::set < StateType > > & getTransitions ( ) const { return transitions; } + const ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < StateType > >, ext::set < StateType > > & getTransitions ( ) const { return transitions; } ext::set < StateType > getTransitionRightSide ( const common::ranked_symbol < SymbolType, RankType > symbol, const ext::vector < StateType > & states ); diff --git a/alib2data/src/automaton/TM/OneTapeDTM.h b/alib2data/src/automaton/TM/OneTapeDTM.h index 7ec727e29c..f0f7947bc3 100644 --- a/alib2data/src/automaton/TM/OneTapeDTM.h +++ b/alib2data/src/automaton/TM/OneTapeDTM.h @@ -42,7 +42,7 @@ class InitialState; template<class SymbolType, class StateType > class OneTapeDTM final : public AutomatonBase, public alib::Components < OneTapeDTM < SymbolType, StateType >, SymbolType, std::tuple < TapeAlphabet, InputAlphabet >, std::tuple < BlankSymbol >, StateType, std::tuple < States, FinalStates >, std::tuple < InitialState > > { protected: - std::map < std::pair < StateType, SymbolType >, std::tuple < StateType, SymbolType, Shift > > transitions; + ext::map < std::pair < StateType, SymbolType >, std::tuple < StateType, SymbolType, Shift > > transitions; public: explicit OneTapeDTM ( ext::set < StateType > states, ext::set < SymbolType > tapeAlphabet, SymbolType blankSymbol, ext::set< SymbolType > inputAlphabet, StateType initialState, ext::set < StateType > finalStates ); @@ -159,7 +159,7 @@ public: /** * @return TM transitions */ - const std::map < std::pair < StateType, SymbolType >, std::tuple < StateType, SymbolType, Shift > > & getTransitions ( ) const; + const ext::map < std::pair < StateType, SymbolType >, std::tuple < StateType, SymbolType, Shift > > & getTransitions ( ) const; virtual int compare ( const ObjectBase & other ) const { if ( std::type_index ( typeid ( * this ) ) == std::type_index ( typeid ( other ) ) ) return this->compare ( ( decltype ( * this ) )other ); @@ -284,7 +284,7 @@ bool OneTapeDTM<SymbolType, StateType>::removeTransition(const StateType& from, } template<class SymbolType, class StateType > -const std::map<std::pair<StateType, SymbolType>, std::tuple<StateType, SymbolType, Shift> >& OneTapeDTM<SymbolType, StateType>::getTransitions() const { +const ext::map<std::pair<StateType, SymbolType>, std::tuple<StateType, SymbolType, Shift> >& OneTapeDTM<SymbolType, StateType>::getTransitions() const { return transitions; } diff --git a/alib2data/src/automaton/common/AutomatonFromXMLParser.h b/alib2data/src/automaton/common/AutomatonFromXMLParser.h index 66ba690042..ab21c8c08f 100644 --- a/alib2data/src/automaton/common/AutomatonFromXMLParser.h +++ b/alib2data/src/automaton/common/AutomatonFromXMLParser.h @@ -64,7 +64,7 @@ public: template < class SymbolType > static SymbolType parseBottomOfTheStackSymbol(std::deque<sax::Token>::iterator& input); template < class InputSymbolType, class PushdownStoreSymbolType > - static std::map<InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType> > > parseInputToPushdownStoreOperation(std::deque<sax::Token>::iterator& input); + static ext::map<InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType> > > parseInputToPushdownStoreOperation(std::deque<sax::Token>::iterator& input); template < class StateType > static StateType parseTransitionFrom(std::deque<sax::Token>::iterator& input); @@ -309,8 +309,8 @@ SymbolType AutomatonFromXMLParser::parseBottomOfTheStackSymbol ( std::deque < sa } template < class InputSymbolType, class PushdownStoreSymbolType > -std::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > AutomatonFromXMLParser::parseInputToPushdownStoreOperation ( std::deque < sax::Token >::iterator & input ) { - std::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > operations; +ext::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > AutomatonFromXMLParser::parseInputToPushdownStoreOperation ( std::deque < sax::Token >::iterator & input ) { + ext::map < InputSymbolType, std::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > operations; sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, "inputToPushdownStoreOperations" ); diff --git a/alib2data/src/automaton/common/AutomatonToXMLComposer.h b/alib2data/src/automaton/common/AutomatonToXMLComposer.h index 1f120718f2..88937f2300 100644 --- a/alib2data/src/automaton/common/AutomatonToXMLComposer.h +++ b/alib2data/src/automaton/common/AutomatonToXMLComposer.h @@ -61,7 +61,7 @@ public: template<class SymbolType> static void composeBottomOfTheStackSymbol(std::deque<sax::Token>&, const SymbolType& symbol); template<class InputSymbolType, class PushdownStoreSymbolType > - static void composeInputToPushdownStoreOperation(std::deque<sax::Token>&, const std::map<InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType> > >& operations); + static void composeInputToPushdownStoreOperation(std::deque<sax::Token>&, const ext::map<InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType> > >& operations); template<class StateType> static void composeTransitionTo(std::deque<sax::Token>&, const StateType& state); @@ -238,7 +238,7 @@ void AutomatonToXMLComposer::composeBottomOfTheStackSymbol(std::deque<sax::Token } template < class InputSymbolType, class PushdownStoreSymbolType > -void AutomatonToXMLComposer::composeInputToPushdownStoreOperation(std::deque<sax::Token>& out, const std::map<InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType> > >& operations) { +void AutomatonToXMLComposer::composeInputToPushdownStoreOperation(std::deque<sax::Token>& out, const ext::map<InputSymbolType, std::pair<ext::vector<PushdownStoreSymbolType>, ext::vector<PushdownStoreSymbolType> > >& operations) { out.emplace_back("inputToPushdownStoreOperations", sax::Token::TokenType::START_ELEMENT); for(const auto& pushdownStoreOperation : operations) { out.emplace_back("operation", sax::Token::TokenType::START_ELEMENT); diff --git a/alib2data/src/grammar/ContextFree/CFG.h b/alib2data/src/grammar/ContextFree/CFG.h index ac1c3162f8..60edd4b3c5 100644 --- a/alib2data/src/grammar/ContextFree/CFG.h +++ b/alib2data/src/grammar/ContextFree/CFG.h @@ -36,7 +36,7 @@ class InitialSymbol; template < class SymbolType > class CFG final : public GrammarBase, public alib::Components < CFG < SymbolType >, SymbolType, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > rules; + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > rules; public: explicit CFG ( SymbolType initialSymbol ); @@ -53,13 +53,13 @@ public: void addRules ( SymbolType leftHandSide, ext::set < ext::vector < SymbolType > > rightHandSide ); - const std::map < SymbolType, ext::set < ext::vector < SymbolType > > > & getRules ( ) const; + const ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > & getRules ( ) const; bool removeRule ( const SymbolType & leftHandSide, const ext::vector < SymbolType > & rightHandSide ); bool addRawRule ( SymbolType leftHandSide, ext::vector < SymbolType > rightHandSide ); - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; bool removeRawRule ( const SymbolType & leftHandSide, const ext::vector < SymbolType > & rightHandSide ); @@ -208,7 +208,7 @@ void CFG < SymbolType >::addRules ( SymbolType leftHandSide, ext::set < ext::vec } template < class SymbolType > -const std::map < SymbolType, ext::set < ext::vector < SymbolType > > > & CFG < SymbolType >::getRules ( ) const { +const ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > & CFG < SymbolType >::getRules ( ) const { return rules; } @@ -218,7 +218,7 @@ bool CFG < SymbolType >::addRawRule ( SymbolType leftHandSide, ext::vector < Sym } template < class SymbolType > -std::map < SymbolType, ext::set < ext::vector < SymbolType > > > CFG < SymbolType >::getRawRules ( ) const { +ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > CFG < SymbolType >::getRawRules ( ) const { return rules; } diff --git a/alib2data/src/grammar/ContextFree/CNF.h b/alib2data/src/grammar/ContextFree/CNF.h index 130aa7bd55..287c84d7fd 100644 --- a/alib2data/src/grammar/ContextFree/CNF.h +++ b/alib2data/src/grammar/ContextFree/CNF.h @@ -37,7 +37,7 @@ class InitialSymbol; template < class SymbolType > class CNF final : public GrammarBase, public alib::Components < CNF < SymbolType >, SymbolType, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { - std::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > rules; + ext::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > rules; bool generatesEpsilon; public: @@ -55,7 +55,7 @@ public: void addRules ( SymbolType leftHandSide, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > rightHandSide ); - const std::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > & getRules ( ) const; + const ext::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > & getRules ( ) const; bool removeRule ( const SymbolType & leftHandSide, const ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > & rightHandSide ); bool removeRule ( const SymbolType & leftHandSide, const SymbolType & rightHandSide ); @@ -63,7 +63,7 @@ public: bool addRawRule ( SymbolType leftHandSide, ext::vector < SymbolType > rightHandSide ); - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; bool removeRawRule ( const SymbolType & leftHandSide, const ext::vector < SymbolType > & rightHandSide ); @@ -234,7 +234,7 @@ void CNF < SymbolType >::addRules ( SymbolType leftHandSide, ext::set < ext::var } template < class SymbolType > -const std::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > & CNF < SymbolType >::getRules ( ) const { +const ext::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > & CNF < SymbolType >::getRules ( ) const { return rules; } @@ -275,8 +275,8 @@ bool CNF < SymbolType >::addRawRule ( SymbolType leftHandSide, ext::vector < Sym } template < class SymbolType > -std::map < SymbolType, ext::set < ext::vector < SymbolType > > > CNF < SymbolType >::getRawRules ( ) const { - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; +ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > CNF < SymbolType >::getRawRules ( ) const { + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; for ( const auto & rule : getRules ( ) ) for ( const auto & rhs : rule.second ) { diff --git a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h index 7597676ad0..abd84ef7d5 100644 --- a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h +++ b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.h @@ -36,7 +36,7 @@ class InitialSymbol; template < class SymbolType > class EpsilonFreeCFG final : public GrammarBase, public alib::Components < EpsilonFreeCFG < SymbolType >, SymbolType, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > rules; + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > rules; bool generatesEpsilon; public: @@ -52,13 +52,13 @@ public: void addRules ( SymbolType leftHandSide, ext::set < ext::vector < SymbolType > > rightHandSide ); - const std::map < SymbolType, ext::set < ext::vector < SymbolType > > > & getRules ( ) const; + const ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > & getRules ( ) const; bool removeRule ( const SymbolType & leftHandSide, const ext::vector < SymbolType > & rightHandSide ); bool addRawRule ( SymbolType leftHandSide, ext::vector < SymbolType > rightHandSide ); - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; bool removeRawRule ( const SymbolType & leftHandSide, const ext::vector < SymbolType > & rightHandSide ); @@ -203,7 +203,7 @@ void EpsilonFreeCFG < SymbolType >::addRules ( SymbolType leftHandSide, ext::set } template < class SymbolType > -const std::map < SymbolType, ext::set < ext::vector < SymbolType > > > & EpsilonFreeCFG < SymbolType >::getRules ( ) const { +const ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > & EpsilonFreeCFG < SymbolType >::getRules ( ) const { return rules; } @@ -226,8 +226,8 @@ bool EpsilonFreeCFG < SymbolType >::addRawRule ( SymbolType leftHandSide, ext::v } template < class SymbolType > -std::map < SymbolType, ext::set < ext::vector < SymbolType > > > EpsilonFreeCFG < SymbolType >::getRawRules ( ) const { - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > res ( getRules ( ).begin ( ), getRules ( ).end ( ) ); +ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > EpsilonFreeCFG < SymbolType >::getRawRules ( ) const { + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > res ( getRules ( ).begin ( ), getRules ( ).end ( ) ); if ( getGeneratesEpsilon ( ) ) res [ getInitialSymbol ( ) ].insert ( ext::vector < SymbolType > { } ); diff --git a/alib2data/src/grammar/ContextFree/GNF.h b/alib2data/src/grammar/ContextFree/GNF.h index 492842984a..cb76409730 100644 --- a/alib2data/src/grammar/ContextFree/GNF.h +++ b/alib2data/src/grammar/ContextFree/GNF.h @@ -36,7 +36,7 @@ class InitialSymbol; template < class SymbolType > class GNF final : public GrammarBase, public alib::Components < GNF < SymbolType >, SymbolType, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { - std::map < SymbolType, ext::set < std::pair < SymbolType, ext::vector < SymbolType > > > > rules; + ext::map < SymbolType, ext::set < std::pair < SymbolType, ext::vector < SymbolType > > > > rules; bool generatesEpsilon; public: @@ -52,13 +52,13 @@ public: void addRules ( SymbolType leftHandSide, ext::set < std::pair < SymbolType, ext::vector < SymbolType > > > rightHandSide ); - const std::map < SymbolType, ext::set < std::pair < SymbolType, ext::vector < SymbolType > > > > & getRules ( ) const; + const ext::map < SymbolType, ext::set < std::pair < SymbolType, ext::vector < SymbolType > > > > & getRules ( ) const; bool removeRule ( const SymbolType & leftHandSide, const std::pair < SymbolType, ext::vector < SymbolType > > & rightHandSide ); bool addRawRule ( SymbolType leftHandSide, ext::vector < SymbolType > rightHandSide ); - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; bool removeRawRule ( const SymbolType & leftHandSide, const ext::vector < SymbolType > & rightHandSide ); @@ -204,7 +204,7 @@ void GNF < SymbolType >::addRules ( SymbolType leftHandSide, ext::set < std::pai } template < class SymbolType > -const std::map < SymbolType, ext::set < std::pair < SymbolType, ext::vector < SymbolType > > > > & GNF < SymbolType >::getRules ( ) const { +const ext::map < SymbolType, ext::set < std::pair < SymbolType, ext::vector < SymbolType > > > > & GNF < SymbolType >::getRules ( ) const { return rules; } @@ -229,8 +229,8 @@ bool GNF < SymbolType >::addRawRule ( SymbolType leftHandSide, ext::vector < Sym } template < class SymbolType > -std::map < SymbolType, ext::set < ext::vector < SymbolType > > > GNF < SymbolType >::getRawRules ( ) const { - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; +ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > GNF < SymbolType >::getRawRules ( ) const { + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; for ( const auto & rule : getRules ( ) ) for ( const auto & rhs : rule.second ) { diff --git a/alib2data/src/grammar/ContextFree/LG.h b/alib2data/src/grammar/ContextFree/LG.h index 8b4afaddde..46cbf734a6 100644 --- a/alib2data/src/grammar/ContextFree/LG.h +++ b/alib2data/src/grammar/ContextFree/LG.h @@ -38,7 +38,7 @@ class InitialSymbol; template < class SymbolType > class LG final : public GrammarBase, public alib::Components < LG < SymbolType >, SymbolType, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { - std::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > > > > > rules; + ext::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > > > > > rules; public: explicit LG ( SymbolType initialSymbol ); @@ -55,7 +55,7 @@ public: void addRules ( SymbolType leftHandSide, ext::set < ext::variant < ext::vector < SymbolType >, std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > > > > rightHandSide ); - const std::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > > > > > & getRules ( ) const; + const ext::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > > > > > & getRules ( ) const; bool removeRule ( const SymbolType & leftHandSide, const ext::variant < ext::vector < SymbolType >, std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > > > & rightHandSide ); bool removeRule ( const SymbolType & leftHandSide, const ext::vector < SymbolType > & rightHandSide ); @@ -63,7 +63,7 @@ public: bool addRawRule ( SymbolType leftHandSide, ext::vector < SymbolType > rightHandSide ); - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; bool removeRawRule ( const SymbolType & leftHandSide, const ext::vector < SymbolType > & rightHandSide ); @@ -245,7 +245,7 @@ void LG < SymbolType >::addRules ( SymbolType leftHandSide, ext::set < ext::vari } template < class SymbolType > -const std::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > > > > > & LG < SymbolType >::getRules ( ) const { +const ext::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > > > > > & LG < SymbolType >::getRules ( ) const { return rules; } @@ -282,8 +282,8 @@ bool LG < SymbolType >::addRawRule ( SymbolType leftHandSide, ext::vector < Symb } template < class SymbolType > -std::map < SymbolType, ext::set < ext::vector < SymbolType > > > LG < SymbolType >::getRawRules ( ) const { - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; +ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > LG < SymbolType >::getRawRules ( ) const { + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; for ( const auto & rule : getRules ( ) ) for ( const auto & rhs : rule.second ) { diff --git a/alib2data/src/grammar/ContextSensitive/CSG.h b/alib2data/src/grammar/ContextSensitive/CSG.h index decbfdaa7e..8c9b723843 100644 --- a/alib2data/src/grammar/ContextSensitive/CSG.h +++ b/alib2data/src/grammar/ContextSensitive/CSG.h @@ -36,7 +36,7 @@ class InitialSymbol; template < class SymbolType > class CSG final : public GrammarBase, public alib::Components < CSG < SymbolType >, SymbolType, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { - std::map < std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > >, ext::set < ext::vector < SymbolType > > > rules; + ext::map < std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > >, ext::set < ext::vector < SymbolType > > > rules; bool generatesEpsilon; public: @@ -52,7 +52,7 @@ public: void addRules ( ext::vector < SymbolType > lContext, SymbolType leftHandSide, ext::vector < SymbolType > rContext, ext::set < ext::vector < SymbolType > > rightHandSide ); - const std::map < std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > >, ext::set < ext::vector < SymbolType > > > & getRules ( ) const; + const ext::map < std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > >, ext::set < ext::vector < SymbolType > > > & getRules ( ) const; bool removeRule ( const ext::vector < SymbolType > & lContext, const SymbolType & leftHandSide, const ext::vector < SymbolType > & rContext, const ext::vector < SymbolType > & rightHandSide ); @@ -217,7 +217,7 @@ void CSG < SymbolType >::addRules ( ext::vector < SymbolType > lContext, SymbolT } template < class SymbolType > -const std::map < std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > >, ext::set < ext::vector < SymbolType > > > & CSG < SymbolType >::getRules ( ) const { +const ext::map < std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > >, ext::set < ext::vector < SymbolType > > > & CSG < SymbolType >::getRules ( ) const { return rules; } diff --git a/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h b/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h index 51c60a9bd4..453ae8454d 100644 --- a/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h +++ b/alib2data/src/grammar/ContextSensitive/NonContractingGrammar.h @@ -36,7 +36,7 @@ class InitialSymbol; template < class SymbolType > class NonContractingGrammar final : public GrammarBase, public alib::Components < NonContractingGrammar < SymbolType >, SymbolType, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { - std::map < ext::vector < SymbolType >, ext::set < ext::vector < SymbolType > > > rules; + ext::map < ext::vector < SymbolType >, ext::set < ext::vector < SymbolType > > > rules; bool generatesEpsilon; public: @@ -52,7 +52,7 @@ public: void addRules ( ext::vector < SymbolType > leftHandSide, ext::set < ext::vector < SymbolType > > rightHandSide ); - const std::map < ext::vector < SymbolType >, ext::set < ext::vector < SymbolType > > > & getRules ( ) const; + const ext::map < ext::vector < SymbolType >, ext::set < ext::vector < SymbolType > > > & getRules ( ) const; bool removeRule ( const ext::vector < SymbolType > & leftHandSide, const ext::vector < SymbolType > & rightHandSide ); @@ -218,7 +218,7 @@ void NonContractingGrammar < SymbolType >::addRules ( ext::vector < SymbolType > } template < class SymbolType > -const std::map < ext::vector < SymbolType >, ext::set < ext::vector < SymbolType > > > & NonContractingGrammar < SymbolType >::getRules ( ) const { +const ext::map < ext::vector < SymbolType >, ext::set < ext::vector < SymbolType > > > & NonContractingGrammar < SymbolType >::getRules ( ) const { return rules; } diff --git a/alib2data/src/grammar/Regular/LeftLG.h b/alib2data/src/grammar/Regular/LeftLG.h index 85a5fadba1..393602fafd 100644 --- a/alib2data/src/grammar/Regular/LeftLG.h +++ b/alib2data/src/grammar/Regular/LeftLG.h @@ -67,7 +67,7 @@ class LeftLG final : public GrammarBase, public alib::Components < LeftLG < Symb /** * Rules as mapping from nonterminal symbol on the left hand side to set of either sequence of terminal symbols or doublets of sequence of terminal symbols and nonterminal symbol. */ - std::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::pair < SymbolType, ext::vector < SymbolType > > > > > rules; + ext::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::pair < SymbolType, ext::vector < SymbolType > > > > > rules; public: /** @@ -147,7 +147,7 @@ public: * * \returns rules of the grammar */ - const std::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::pair < SymbolType, ext::vector < SymbolType > > > > > & getRules ( ) const; + const ext::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::pair < SymbolType, ext::vector < SymbolType > > > > > & getRules ( ) const; /** * Remove a rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T*. @@ -194,7 +194,7 @@ public: * * \returns rules of the grammar */ - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; /** * Remove a rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T* as stored in combination of leftHandSide and rightHandSide @@ -477,7 +477,7 @@ void LeftLG < SymbolType >::addRules ( SymbolType leftHandSide, ext::set < ext:: } template < class SymbolType > -const std::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::pair < SymbolType, ext::vector < SymbolType > > > > > & LeftLG < SymbolType >::getRules ( ) const { +const ext::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::pair < SymbolType, ext::vector < SymbolType > > > > > & LeftLG < SymbolType >::getRules ( ) const { return rules; } @@ -511,8 +511,8 @@ bool LeftLG < SymbolType >::addRawRule ( SymbolType leftHandSide, ext::vector < } template < class SymbolType > -std::map < SymbolType, ext::set < ext::vector < SymbolType > > > LeftLG < SymbolType >::getRawRules ( ) const { - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; +ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > LeftLG < SymbolType >::getRawRules ( ) const { + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; for ( const auto & rule : getRules ( ) ) for ( const auto & rhs : rule.second ) { diff --git a/alib2data/src/grammar/Regular/LeftRG.h b/alib2data/src/grammar/Regular/LeftRG.h index 56652dc9d9..24494befb8 100644 --- a/alib2data/src/grammar/Regular/LeftRG.h +++ b/alib2data/src/grammar/Regular/LeftRG.h @@ -71,7 +71,7 @@ class LeftRG final : public GrammarBase, public alib::Components < LeftRG < Symb /** * Rules as mapping from nonterminal symbol on the left hand side to set of either terminal symbols or doublets of terminal symbol and nonterminal symbol. */ - std::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > rules; + ext::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > rules; /** * Boolean signaling whether grammar generates empty string or don't. @@ -156,7 +156,7 @@ public: * * \returns rules of the grammar */ - const std::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > & getRules ( ) const; + const ext::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > & getRules ( ) const; /** * Remove a rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T. @@ -203,7 +203,7 @@ public: * * \returns rules of the grammar */ - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; /** * Remove a rule of a grammar in form of A -> aB or A -> a, where A, B \in N and a \in T as stored in combination of leftHandSide and rightHandSide @@ -494,7 +494,7 @@ bool LeftRG < SymbolType >::addRule ( SymbolType leftHandSide, std::pair < Symbo } template < class SymbolType > -const std::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > & LeftRG < SymbolType >::getRules ( ) const { +const ext::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > & LeftRG < SymbolType >::getRules ( ) const { return rules; } @@ -535,8 +535,8 @@ bool LeftRG < SymbolType >::addRawRule ( SymbolType leftHandSide, ext::vector < } template < class SymbolType > -std::map < SymbolType, ext::set < ext::vector < SymbolType > > > LeftRG < SymbolType >::getRawRules ( ) const { - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; +ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > LeftRG < SymbolType >::getRawRules ( ) const { + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; for ( const auto & rule : getRules ( ) ) for ( const auto & rhs : rule.second ) { diff --git a/alib2data/src/grammar/Regular/RightLG.h b/alib2data/src/grammar/Regular/RightLG.h index 90fcf5d7b7..e2e2c3d7ea 100644 --- a/alib2data/src/grammar/Regular/RightLG.h +++ b/alib2data/src/grammar/Regular/RightLG.h @@ -67,7 +67,7 @@ class RightLG final : public GrammarBase, public alib::Components < RightLG < Sy /** * Rules as mapping from nonterminal symbol on the left hand side to set of either sequence of terminal symbols or doublets of sequence of nonterminal symbol and terminal symbols. */ - std::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::pair < ext::vector < SymbolType >, SymbolType > > > > rules; + ext::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::pair < ext::vector < SymbolType >, SymbolType > > > > rules; public: /** @@ -147,7 +147,7 @@ public: * * \returns rules of the grammar */ - const std::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::pair < ext::vector < SymbolType >, SymbolType > > > > & getRules ( ) const; + const ext::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::pair < ext::vector < SymbolType >, SymbolType > > > > & getRules ( ) const; /** * Remove a rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T*. @@ -194,7 +194,7 @@ public: * * \returns rules of the grammar */ - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; /** * Remove a rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T* as stored in combination of leftHandSide and rightHandSide @@ -474,7 +474,7 @@ void RightLG < SymbolType >::addRules ( SymbolType leftHandSide, ext::set < ext: } template < class SymbolType > -const std::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::pair < ext::vector < SymbolType >, SymbolType > > > > & RightLG < SymbolType >::getRules ( ) const { +const ext::map < SymbolType, ext::set < ext::variant < ext::vector < SymbolType >, std::pair < ext::vector < SymbolType >, SymbolType > > > > & RightLG < SymbolType >::getRules ( ) const { return rules; } @@ -508,8 +508,8 @@ bool RightLG < SymbolType >::addRawRule ( SymbolType leftHandSide, ext::vector < } template < class SymbolType > -std::map < SymbolType, ext::set < ext::vector < SymbolType > > > RightLG < SymbolType >::getRawRules ( ) const { - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; +ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > RightLG < SymbolType >::getRawRules ( ) const { + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; for ( const auto & rule : getRules ( ) ) for ( const auto & rhs : rule.second ) { diff --git a/alib2data/src/grammar/Regular/RightRG.h b/alib2data/src/grammar/Regular/RightRG.h index 70680ff0eb..94f7bb5166 100644 --- a/alib2data/src/grammar/Regular/RightRG.h +++ b/alib2data/src/grammar/Regular/RightRG.h @@ -71,7 +71,7 @@ class RightRG final : public GrammarBase, public alib::Components < RightRG < Sy /** * Rules function as mapping from nonterminal symbol on the left hand side to set of either terminal symbols or doublets of nonterminal symbol and terminal symbol. */ - std::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > rules; + ext::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > rules; /** * Boolean signaling whether grammar generates empty string or don't. @@ -156,7 +156,7 @@ public: * * \returns rules of the grammar */ - const std::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > & getRules ( ) const; + const ext::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > & getRules ( ) const; /** * Remove a rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T. @@ -203,7 +203,7 @@ public: * * \returns rules of the grammar */ - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > getRawRules ( ) const; /** * Remove a rule of a grammar in form of A -> Ba or A -> a, where A, B \in N and a \in T as stored in combination of leftHandSide and rightHandSide @@ -493,7 +493,7 @@ void RightRG < SymbolType >::addRules ( SymbolType leftHandSide, ext::set < ext: } template < class SymbolType > -const std::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > & RightRG < SymbolType >::getRules ( ) const { +const ext::map < SymbolType, ext::set < ext::variant < SymbolType, std::pair < SymbolType, SymbolType > > > > & RightRG < SymbolType >::getRules ( ) const { return rules; } @@ -534,8 +534,8 @@ bool RightRG < SymbolType >::addRawRule ( SymbolType leftHandSide, ext::vector < } template < class SymbolType > -std::map < SymbolType, ext::set < ext::vector < SymbolType > > > RightRG < SymbolType >::getRawRules ( ) const { - std::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; +ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > RightRG < SymbolType >::getRawRules ( ) const { + ext::map < SymbolType, ext::set < ext::vector < SymbolType > > > res; for ( const auto & rule : getRules ( ) ) for ( const auto & rhs : rule.second ) { diff --git a/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h b/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h index 8d27d185c6..05cf879028 100644 --- a/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h +++ b/alib2data/src/grammar/Unrestricted/ContextPreservingUnrestrictedGrammar.h @@ -36,7 +36,7 @@ class InitialSymbol; template < class SymbolType > class ContextPreservingUnrestrictedGrammar final : public GrammarBase, public alib::Components < ContextPreservingUnrestrictedGrammar < SymbolType >, SymbolType, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { - std::map < std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > >, ext::set < ext::vector < SymbolType > > > rules; + ext::map < std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > >, ext::set < ext::vector < SymbolType > > > rules; public: explicit ContextPreservingUnrestrictedGrammar ( SymbolType initialSymbol ); @@ -51,7 +51,7 @@ public: void addRules ( ext::vector < SymbolType > lContext, SymbolType leftHandSide, ext::vector < SymbolType > rContext, ext::set < ext::vector < SymbolType > > rightHandSide ); - const std::map < std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > >, ext::set < ext::vector < SymbolType > > > & getRules ( ) const; + const ext::map < std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > >, ext::set < ext::vector < SymbolType > > > & getRules ( ) const; bool removeRule ( const ext::vector < SymbolType > & lContext, const SymbolType & leftHandSide, const ext::vector < SymbolType > & rContext, const ext::vector < SymbolType > & rightHandSide ); @@ -202,7 +202,7 @@ void ContextPreservingUnrestrictedGrammar < SymbolType >::addRules ( ext::vector } template < class SymbolType > -const std::map < std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > >, ext::set < ext::vector < SymbolType > > > & ContextPreservingUnrestrictedGrammar < SymbolType >::getRules ( ) const { +const ext::map < std::tuple < ext::vector < SymbolType >, SymbolType, ext::vector < SymbolType > >, ext::set < ext::vector < SymbolType > > > & ContextPreservingUnrestrictedGrammar < SymbolType >::getRules ( ) const { return rules; } diff --git a/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h b/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h index 3c99c5f10c..23d9df2341 100644 --- a/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h +++ b/alib2data/src/grammar/Unrestricted/UnrestrictedGrammar.h @@ -36,7 +36,7 @@ class InitialSymbol; template < class SymbolType > class UnrestrictedGrammar final : public GrammarBase, public alib::Components < UnrestrictedGrammar < SymbolType >, SymbolType, std::tuple < TerminalAlphabet, NonterminalAlphabet >, std::tuple < InitialSymbol > > { - std::map < ext::vector < SymbolType >, ext::set < ext::vector < SymbolType > > > rules; + ext::map < ext::vector < SymbolType >, ext::set < ext::vector < SymbolType > > > rules; public: explicit UnrestrictedGrammar ( SymbolType initialSymbol ); @@ -51,7 +51,7 @@ public: void addRules ( ext::vector < SymbolType > leftHandSide, ext::set < ext::vector < SymbolType > > rightHandSide ); - const std::map < ext::vector < SymbolType >, ext::set < ext::vector < SymbolType > > > & getRules ( ) const; + const ext::map < ext::vector < SymbolType >, ext::set < ext::vector < SymbolType > > > & getRules ( ) const; bool removeRule ( const ext::vector < SymbolType > & leftHandSide, const ext::vector < SymbolType > & rightHandSide ); @@ -196,7 +196,7 @@ void UnrestrictedGrammar < SymbolType >::addRules ( ext::vector < SymbolType > l } template < class SymbolType > -const std::map < ext::vector < SymbolType >, ext::set < ext::vector < SymbolType > > > & UnrestrictedGrammar < SymbolType >::getRules ( ) const { +const ext::map < ext::vector < SymbolType >, ext::set < ext::vector < SymbolType > > > & UnrestrictedGrammar < SymbolType >::getRules ( ) const { return rules; } diff --git a/alib2data/src/indexes/arbology/CompressedBitParallelTreeIndex.h b/alib2data/src/indexes/arbology/CompressedBitParallelTreeIndex.h index d76e8bc033..649b04c4fe 100644 --- a/alib2data/src/indexes/arbology/CompressedBitParallelTreeIndex.h +++ b/alib2data/src/indexes/arbology/CompressedBitParallelTreeIndex.h @@ -44,7 +44,7 @@ class GeneralAlphabet; template < class SymbolType = DefaultSymbolType > class CompressedBitParallelTreeIndex final : public alib::ObjectBase, public alib::Components < CompressedBitParallelTreeIndex < SymbolType >, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > { protected: - std::map < SymbolType, common::SparseBoolVector > m_vectors; + ext::map < SymbolType, common::SparseBoolVector > m_vectors; ext::vector < int > m_jumpTable; public: @@ -58,12 +58,12 @@ public: */ virtual ObjectBase * plunder ( ) &&; - explicit CompressedBitParallelTreeIndex ( ext::set < SymbolType > alphabet, std::map < SymbolType, common::SparseBoolVector > vectors, ext::vector < int > jumpTable ); + explicit CompressedBitParallelTreeIndex ( ext::set < SymbolType > alphabet, ext::map < SymbolType, common::SparseBoolVector > vectors, ext::vector < int > jumpTable ); /** * @return Root node of the trie */ - const std::map < SymbolType, common::SparseBoolVector > & getData ( ) const; + const ext::map < SymbolType, common::SparseBoolVector > & getData ( ) const; /** * @return subtree jump table @@ -126,7 +126,7 @@ public: return this; ext::set < DefaultSymbolType > alphabet = alphabet::SymbolNormalize::normalizeAlphabet ( std::move ( this->template accessComponent < GeneralAlphabet > ( ).get ( ) ) ); - std::map < DefaultSymbolType, common::SparseBoolVector > vectors; + ext::map < DefaultSymbolType, common::SparseBoolVector > vectors; for ( std::pair < SymbolType, common::SparseBoolVector > && vector : ext::make_moveable_map ( m_vectors ) ) vectors.insert ( std::make_pair ( alphabet::SymbolNormalize::normalizeSymbol ( std::move ( vector.first ) ), std::move ( vector.second ) ) ); @@ -143,7 +143,7 @@ namespace indexes { namespace arbology { template < class SymbolType > -CompressedBitParallelTreeIndex < SymbolType >::CompressedBitParallelTreeIndex ( ext::set < SymbolType > alphabet, std::map < SymbolType, common::SparseBoolVector > vectors, ext::vector < int > jumpTable ) : alib::Components < CompressedBitParallelTreeIndex, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), m_vectors ( std::move ( vectors ) ), m_jumpTable ( jumpTable ) { +CompressedBitParallelTreeIndex < SymbolType >::CompressedBitParallelTreeIndex ( ext::set < SymbolType > alphabet, ext::map < SymbolType, common::SparseBoolVector > vectors, ext::vector < int > jumpTable ) : alib::Components < CompressedBitParallelTreeIndex, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), m_vectors ( std::move ( vectors ) ), m_jumpTable ( jumpTable ) { } template < class SymbolType > @@ -157,7 +157,7 @@ alib::ObjectBase * CompressedBitParallelTreeIndex < SymbolType >::plunder ( ) && } template < class SymbolType > -const std::map < SymbolType, common::SparseBoolVector > & CompressedBitParallelTreeIndex < SymbolType >::getData ( ) const { +const ext::map < SymbolType, common::SparseBoolVector > & CompressedBitParallelTreeIndex < SymbolType >::getData ( ) const { return m_vectors; } @@ -215,7 +215,7 @@ template < class SymbolType > CompressedBitParallelTreeIndex < SymbolType > CompressedBitParallelTreeIndex < SymbolType >::parse ( std::deque < sax::Token >::iterator & input ) { sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, CompressedBitParallelTreeIndex::getXmlTagName ( ) ); ext::set < SymbolType > alphabet = alib::xmlApi < ext::set < SymbolType > >::parse ( input ); - std::map < SymbolType, common::SparseBoolVector > data = alib::xmlApi < std::map < SymbolType, common::SparseBoolVector > >::parse ( input ); + ext::map < SymbolType, common::SparseBoolVector > data = alib::xmlApi < ext::map < SymbolType, common::SparseBoolVector > >::parse ( input ); ext::vector < int > jumps = alib::xmlApi < ext::vector < int > >::parse ( input ); CompressedBitParallelTreeIndex < SymbolType > res ( std::move ( alphabet ), std::move ( data ), std::move ( jumps ) ); @@ -228,7 +228,7 @@ template < class SymbolType > void CompressedBitParallelTreeIndex < SymbolType >::compose ( std::deque < sax::Token > & out ) const { out.emplace_back ( CompressedBitParallelTreeIndex::getXmlTagName ( ), sax::Token::TokenType::START_ELEMENT ); alib::xmlApi < ext::set < SymbolType > >::compose ( out, getAlphabet ( ) ); - alib::xmlApi < std::map < SymbolType, common::SparseBoolVector > >::compose ( out, getData ( ) ); + alib::xmlApi < ext::map < SymbolType, common::SparseBoolVector > >::compose ( out, getData ( ) ); alib::xmlApi < ext::vector < int > >::compose ( out, getJumps ( ) ); out.emplace_back ( CompressedBitParallelTreeIndex::getXmlTagName ( ), sax::Token::TokenType::END_ELEMENT ); } @@ -248,7 +248,7 @@ template < class SymbolType > class ComponentConstraint < indexes::arbology::CompressedBitParallelTreeIndex < SymbolType >, SymbolType, indexes::arbology::GeneralAlphabet > { public: static bool used ( const indexes::arbology::CompressedBitParallelTreeIndex < SymbolType > & index, const SymbolType & symbol ) { - const std::map < SymbolType, common::SparseBoolVector > & content = index.getData ( ); + const ext::map < SymbolType, common::SparseBoolVector > & content = index.getData ( ); return content.find ( symbol ) != content.end ( ); } diff --git a/alib2data/src/indexes/common/IndexesNormalize.h b/alib2data/src/indexes/common/IndexesNormalize.h index 06f442674d..2891d0dbb0 100644 --- a/alib2data/src/indexes/common/IndexesNormalize.h +++ b/alib2data/src/indexes/common/IndexesNormalize.h @@ -24,7 +24,7 @@ namespace indexes { class IndexesNormalize { template < class SymbolType, class ValueType > static ext::trie < DefaultSymbolType, ValueType > normalizeTrieInner ( ext::trie < SymbolType, ValueType > && node ) { - std::map < DefaultSymbolType, ext::trie < DefaultSymbolType, ValueType > > children; + ext::map < DefaultSymbolType, ext::trie < DefaultSymbolType, ValueType > > children; for ( std::pair < SymbolType, ext::trie < SymbolType, ValueType > > && child : ext::make_moveable_map ( node.getChildren ( ) ) ) { children.insert ( std::make_pair ( alphabet::SymbolNormalize::normalizeSymbol ( std::move ( child.first ) ), normalizeTrieInner ( std::move ( child.second ) ) ) ); diff --git a/alib2data/src/indexes/stringology/BNDMMatcher.h b/alib2data/src/indexes/stringology/BNDMMatcher.h index 9fa1cdc7fd..114c218603 100644 --- a/alib2data/src/indexes/stringology/BNDMMatcher.h +++ b/alib2data/src/indexes/stringology/BNDMMatcher.h @@ -45,7 +45,7 @@ class GeneralAlphabet; template < class SymbolType = DefaultSymbolType, size_t BitmaskBitCount = 64 > class BNDMMatcher final : public alib::ObjectBase, public alib::Components < BNDMMatcher < SymbolType >, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > { protected: - std::map < SymbolType, std::bitset < BitmaskBitCount > > m_vectors; + ext::map < SymbolType, std::bitset < BitmaskBitCount > > m_vectors; ext::vector < SymbolType > m_string; public: @@ -59,12 +59,12 @@ public: */ virtual ObjectBase * plunder ( ) &&; - explicit BNDMMatcher ( ext::set < SymbolType > alphabet, std::map < SymbolType, std::bitset < BitmaskBitCount > > vectors, ext::vector < SymbolType > string ); + explicit BNDMMatcher ( ext::set < SymbolType > alphabet, ext::map < SymbolType, std::bitset < BitmaskBitCount > > vectors, ext::vector < SymbolType > string ); /** * @return Root node of the trie */ - const std::map < SymbolType, std::bitset < BitmaskBitCount > > & getData ( ) const; + const ext::map < SymbolType, std::bitset < BitmaskBitCount > > & getData ( ) const; const ext::vector < SymbolType > & getString ( ) const; @@ -123,7 +123,7 @@ public: ext::set < DefaultSymbolType > alphabet = alphabet::SymbolNormalize::normalizeAlphabet ( std::move ( this->template accessComponent < GeneralAlphabet > ( ).get ( ) ) ); - std::map < DefaultSymbolType, std::bitset < BitmaskBitCount > > vectors; + ext::map < DefaultSymbolType, std::bitset < BitmaskBitCount > > vectors; for ( std::pair < SymbolType, std::bitset < BitmaskBitCount > > && vector : ext::make_moveable_map ( m_vectors ) ) vectors.insert ( std::make_pair ( alphabet::SymbolNormalize::normalizeSymbol ( std::move ( vector.first ) ), std::move ( vector.second ) ) ); @@ -142,7 +142,7 @@ namespace indexes { namespace stringology { template < class SymbolType, size_t BitmaskBitCount > -BNDMMatcher < SymbolType, BitmaskBitCount >::BNDMMatcher ( ext::set < SymbolType > alphabet, std::map < SymbolType, std::bitset < BitmaskBitCount > > vectors, ext::vector < SymbolType > string ) : alib::Components < BNDMMatcher, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), m_vectors ( std::move ( vectors ) ), m_string ( std::move ( string ) ) { +BNDMMatcher < SymbolType, BitmaskBitCount >::BNDMMatcher ( ext::set < SymbolType > alphabet, ext::map < SymbolType, std::bitset < BitmaskBitCount > > vectors, ext::vector < SymbolType > string ) : alib::Components < BNDMMatcher, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), m_vectors ( std::move ( vectors ) ), m_string ( std::move ( string ) ) { } template < class SymbolType, size_t BitmaskBitCount > @@ -156,7 +156,7 @@ alib::ObjectBase * BNDMMatcher < SymbolType, BitmaskBitCount >::plunder ( ) && { } template < class SymbolType, size_t BitmaskBitCount > -const std::map < SymbolType, std::bitset < BitmaskBitCount > > & BNDMMatcher < SymbolType, BitmaskBitCount >::getData ( ) const { +const ext::map < SymbolType, std::bitset < BitmaskBitCount > > & BNDMMatcher < SymbolType, BitmaskBitCount >::getData ( ) const { return m_vectors; } @@ -196,7 +196,7 @@ template < class SymbolType, size_t BitmaskBitCount > BNDMMatcher < SymbolType, BitmaskBitCount > BNDMMatcher < SymbolType, BitmaskBitCount >::parse ( std::deque < sax::Token >::iterator & input ) { sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, BNDMMatcher::getXmlTagName() ); ext::set < SymbolType > alphabet = alib::xmlApi < ext::set < SymbolType > >::parse ( input ); - std::map < SymbolType, std::bitset < BitmaskBitCount > > data = alib::xmlApi < std::map < SymbolType, std::bitset < BitmaskBitCount > > >::parse ( input ); + ext::map < SymbolType, std::bitset < BitmaskBitCount > > data = alib::xmlApi < ext::map < SymbolType, std::bitset < BitmaskBitCount > > >::parse ( input ); ext::vector < SymbolType > string = alib::xmlApi < ext::vector < SymbolType > >::parse ( input ); BNDMMatcher < SymbolType, BitmaskBitCount > res ( std::move ( alphabet ), std::move ( data ), std::move ( string ) ); @@ -208,7 +208,7 @@ template < class SymbolType, size_t BitmaskBitCount > void BNDMMatcher < SymbolType, BitmaskBitCount >::compose ( std::deque < sax::Token > & out ) const { out.emplace_back ( BNDMMatcher::getXmlTagName(), sax::Token::TokenType::START_ELEMENT ); alib::xmlApi < ext::set < SymbolType > >::compose ( out, getAlphabet ( ) ); - alib::xmlApi < std::map < SymbolType, std::bitset < BitmaskBitCount > > >::compose ( out, getData ( ) ); + alib::xmlApi < ext::map < SymbolType, std::bitset < BitmaskBitCount > > >::compose ( out, getData ( ) ); alib::xmlApi < ext::vector < SymbolType > >::compose ( out, getString ( ) ); out.emplace_back ( BNDMMatcher::getXmlTagName(), sax::Token::TokenType::END_ELEMENT ); } @@ -228,7 +228,7 @@ template < class SymbolType, size_t BitmaskBitCount > class ComponentConstraint < indexes::stringology::BNDMMatcher < SymbolType, BitmaskBitCount >, SymbolType, indexes::stringology::GeneralAlphabet > { public: static bool used ( const indexes::stringology::BNDMMatcher < SymbolType, BitmaskBitCount > & index, const SymbolType & symbol ) { - const std::map < SymbolType, std::bitset < BitmaskBitCount > > & content = index.getData ( ); + const ext::map < SymbolType, std::bitset < BitmaskBitCount > > & content = index.getData ( ); return content.find( symbol ) != content.end(); } diff --git a/alib2data/src/indexes/stringology/BitParallelIndex.h b/alib2data/src/indexes/stringology/BitParallelIndex.h index 3788c78062..6d143481b8 100644 --- a/alib2data/src/indexes/stringology/BitParallelIndex.h +++ b/alib2data/src/indexes/stringology/BitParallelIndex.h @@ -43,7 +43,7 @@ class GeneralAlphabet; template < class SymbolType = DefaultSymbolType > class BitParallelIndex final : public alib::ObjectBase, public alib::Components < BitParallelIndex < SymbolType >, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > { protected: - std::map < SymbolType, ext::vector < bool > > m_vectors; + ext::map < SymbolType, ext::vector < bool > > m_vectors; public: /** @@ -56,12 +56,12 @@ public: */ virtual ObjectBase * plunder ( ) &&; - explicit BitParallelIndex ( ext::set < SymbolType > alphabet, std::map < SymbolType, ext::vector < bool > > vectors ); + explicit BitParallelIndex ( ext::set < SymbolType > alphabet, ext::map < SymbolType, ext::vector < bool > > vectors ); /** * @return Root node of the trie */ - const std::map < SymbolType, ext::vector < bool > > & getData ( ) const; + const ext::map < SymbolType, ext::vector < bool > > & getData ( ) const; ext::vector < SymbolType > getString ( ) const; @@ -119,7 +119,7 @@ public: return this; ext::set < DefaultSymbolType > alphabet = alphabet::SymbolNormalize::normalizeAlphabet ( std::move ( this->template accessComponent < GeneralAlphabet > ( ).get ( ) ) ); - std::map < DefaultSymbolType, ext::vector < bool > > vectors; + ext::map < DefaultSymbolType, ext::vector < bool > > vectors; for ( std::pair < SymbolType, ext::vector < bool > > && vector : ext::make_moveable_map ( m_vectors ) ) vectors.insert ( std::make_pair ( alphabet::SymbolNormalize::normalizeSymbol ( std::move ( vector.first ) ), std::move ( vector.second ) ) ); @@ -136,7 +136,7 @@ namespace indexes { namespace stringology { template < class SymbolType > -BitParallelIndex < SymbolType >::BitParallelIndex ( ext::set < SymbolType > alphabet, std::map < SymbolType, ext::vector < bool > > vectors ) : alib::Components < BitParallelIndex, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), m_vectors ( std::move ( vectors ) ) { +BitParallelIndex < SymbolType >::BitParallelIndex ( ext::set < SymbolType > alphabet, ext::map < SymbolType, ext::vector < bool > > vectors ) : alib::Components < BitParallelIndex, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), m_vectors ( std::move ( vectors ) ) { } template < class SymbolType > @@ -150,7 +150,7 @@ alib::ObjectBase * BitParallelIndex < SymbolType >::plunder ( ) && { } template < class SymbolType > -const std::map < SymbolType, ext::vector < bool > > & BitParallelIndex < SymbolType >::getData ( ) const { +const ext::map < SymbolType, ext::vector < bool > > & BitParallelIndex < SymbolType >::getData ( ) const { return m_vectors; } @@ -202,7 +202,7 @@ template < class SymbolType > BitParallelIndex < SymbolType > BitParallelIndex < SymbolType >::parse ( std::deque < sax::Token >::iterator & input ) { sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, BitParallelIndex::getXmlTagName() ); ext::set < SymbolType > alphabet = alib::xmlApi < ext::set < SymbolType > >::parse ( input ); - std::map < SymbolType, ext::vector < bool > > data = alib::xmlApi < std::map < SymbolType, ext::vector < bool > > >::parse ( input ); + ext::map < SymbolType, ext::vector < bool > > data = alib::xmlApi < ext::map < SymbolType, ext::vector < bool > > >::parse ( input ); BitParallelIndex < SymbolType > res ( std::move ( alphabet ), std::move ( data ) ); sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ELEMENT, BitParallelIndex::getXmlTagName() ); @@ -213,7 +213,7 @@ template < class SymbolType > void BitParallelIndex < SymbolType >::compose ( std::deque < sax::Token > & out ) const { out.emplace_back ( BitParallelIndex::getXmlTagName(), sax::Token::TokenType::START_ELEMENT ); alib::xmlApi < ext::set < SymbolType > >::compose ( out, getAlphabet ( ) ); - alib::xmlApi < std::map < SymbolType, ext::vector < bool > > >::compose ( out, getData ( ) ); + alib::xmlApi < ext::map < SymbolType, ext::vector < bool > > >::compose ( out, getData ( ) ); out.emplace_back ( BitParallelIndex::getXmlTagName(), sax::Token::TokenType::END_ELEMENT ); } @@ -232,7 +232,7 @@ template < class SymbolType > class ComponentConstraint < indexes::stringology::BitParallelIndex < SymbolType >, SymbolType, indexes::stringology::GeneralAlphabet > { public: static bool used ( const indexes::stringology::BitParallelIndex < SymbolType > & index, const SymbolType & symbol ) { - const std::map < SymbolType, ext::vector < bool > > & content = index.getData ( ); + const ext::map < SymbolType, ext::vector < bool > > & content = index.getData ( ); return content.find( symbol ) != content.end(); } diff --git a/alib2data/src/indexes/stringology/CompressedBitParallelIndex.h b/alib2data/src/indexes/stringology/CompressedBitParallelIndex.h index 334017ae9e..f19e440298 100644 --- a/alib2data/src/indexes/stringology/CompressedBitParallelIndex.h +++ b/alib2data/src/indexes/stringology/CompressedBitParallelIndex.h @@ -43,7 +43,7 @@ class GeneralAlphabet; template < class SymbolType = DefaultSymbolType > class CompressedBitParallelIndex final : public alib::ObjectBase, public alib::Components < CompressedBitParallelIndex < SymbolType >, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > { protected: - std::map < SymbolType, common::SparseBoolVector > m_vectors; + ext::map < SymbolType, common::SparseBoolVector > m_vectors; public: /** @@ -56,12 +56,12 @@ public: */ virtual ObjectBase * plunder ( ) &&; - explicit CompressedBitParallelIndex ( ext::set < SymbolType > alphabet, std::map < SymbolType, common::SparseBoolVector > vectors ); + explicit CompressedBitParallelIndex ( ext::set < SymbolType > alphabet, ext::map < SymbolType, common::SparseBoolVector > vectors ); /** * @return Root node of the trie */ - const std::map < SymbolType, common::SparseBoolVector > & getData ( ) const; + const ext::map < SymbolType, common::SparseBoolVector > & getData ( ) const; ext::vector < SymbolType > getString ( ) const; @@ -119,7 +119,7 @@ public: return this; ext::set < DefaultSymbolType > alphabet = alphabet::SymbolNormalize::normalizeAlphabet ( std::move ( this->template accessComponent < GeneralAlphabet > ( ).get ( ) ) ); - std::map < DefaultSymbolType, common::SparseBoolVector > vectors; + ext::map < DefaultSymbolType, common::SparseBoolVector > vectors; for ( std::pair < SymbolType, common::SparseBoolVector > && vector : ext::make_moveable_map ( m_vectors ) ) vectors.insert ( std::make_pair ( alphabet::SymbolNormalize::normalizeSymbol ( std::move ( vector.first ) ), std::move ( vector.second ) ) ); @@ -136,7 +136,7 @@ namespace indexes { namespace stringology { template < class SymbolType > -CompressedBitParallelIndex < SymbolType >::CompressedBitParallelIndex ( ext::set < SymbolType > alphabet, std::map < SymbolType, common::SparseBoolVector > vectors ) : alib::Components < CompressedBitParallelIndex, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), m_vectors ( std::move ( vectors ) ) { +CompressedBitParallelIndex < SymbolType >::CompressedBitParallelIndex ( ext::set < SymbolType > alphabet, ext::map < SymbolType, common::SparseBoolVector > vectors ) : alib::Components < CompressedBitParallelIndex, SymbolType, std::tuple < GeneralAlphabet >, std::tuple < > > ( std::make_tuple ( std::move ( alphabet ) ), std::tuple < > ( ) ), m_vectors ( std::move ( vectors ) ) { } template < class SymbolType > @@ -150,7 +150,7 @@ alib::ObjectBase * CompressedBitParallelIndex < SymbolType >::plunder ( ) && { } template < class SymbolType > -const std::map < SymbolType, common::SparseBoolVector > & CompressedBitParallelIndex < SymbolType >::getData ( ) const { +const ext::map < SymbolType, common::SparseBoolVector > & CompressedBitParallelIndex < SymbolType >::getData ( ) const { return m_vectors; } @@ -202,7 +202,7 @@ template < class SymbolType > CompressedBitParallelIndex < SymbolType > CompressedBitParallelIndex < SymbolType >::parse ( std::deque < sax::Token >::iterator & input ) { sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, CompressedBitParallelIndex::getXmlTagName() ); ext::set < SymbolType > alphabet = alib::xmlApi < ext::set < SymbolType > >::parse ( input ); - std::map < SymbolType, common::SparseBoolVector > data = alib::xmlApi < std::map < SymbolType, common::SparseBoolVector > >::parse ( input ); + ext::map < SymbolType, common::SparseBoolVector > data = alib::xmlApi < ext::map < SymbolType, common::SparseBoolVector > >::parse ( input ); CompressedBitParallelIndex < SymbolType > res ( std::move ( alphabet ), std::move ( data ) ); sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ELEMENT, CompressedBitParallelIndex::getXmlTagName() ); @@ -213,7 +213,7 @@ template < class SymbolType > void CompressedBitParallelIndex < SymbolType >::compose ( std::deque < sax::Token > & out ) const { out.emplace_back ( CompressedBitParallelIndex::getXmlTagName(), sax::Token::TokenType::START_ELEMENT ); alib::xmlApi < ext::set < SymbolType > >::compose ( out, getAlphabet ( ) ); - alib::xmlApi < std::map < SymbolType, common::SparseBoolVector > >::compose ( out, getData ( ) ); + alib::xmlApi < ext::map < SymbolType, common::SparseBoolVector > >::compose ( out, getData ( ) ); out.emplace_back ( CompressedBitParallelIndex::getXmlTagName(), sax::Token::TokenType::END_ELEMENT ); } @@ -232,7 +232,7 @@ template < class SymbolType > class ComponentConstraint < indexes::stringology::CompressedBitParallelIndex < SymbolType >, SymbolType, indexes::stringology::GeneralAlphabet > { public: static bool used ( const indexes::stringology::CompressedBitParallelIndex < SymbolType > & index, const SymbolType & symbol ) { - const std::map < SymbolType, common::SparseBoolVector > & content = index.getData ( ); + const ext::map < SymbolType, common::SparseBoolVector > & content = index.getData ( ); return content.find( symbol ) != content.end(); } diff --git a/alib2data/test-src/string/StringTest.cpp b/alib2data/test-src/string/StringTest.cpp index 74e8f3d70d..b41de4c3e2 100644 --- a/alib2data/test-src/string/StringTest.cpp +++ b/alib2data/test-src/string/StringTest.cpp @@ -74,7 +74,7 @@ void StringTest::testXMLParser ( ) { } void StringTest::testStringInMap ( ) { - std::map < ext::variant < string::Epsilon < >, int >, int > testMap; + ext::map < ext::variant < string::Epsilon < >, int >, int > testMap; ext::variant < string::Epsilon < >, int > epsVar { string::Epsilon < > { } }; diff --git a/alib2data_experimental/src/grammar/parsing/LRParserTypes.h b/alib2data_experimental/src/grammar/parsing/LRParserTypes.h index 18221501dd..f4557bdfd7 100644 --- a/alib2data_experimental/src/grammar/parsing/LRParserTypes.h +++ b/alib2data_experimental/src/grammar/parsing/LRParserTypes.h @@ -26,9 +26,9 @@ enum class LRAction { Accept }; -typedef std::map < DefaultSymbolType, ext::set < std::pair < unsigned, ext::vector < DefaultSymbolType > > > > LR0Items; -typedef std::map < std::pair < DefaultStateType, DefaultSymbolType >, std::pair < LRAction, ext::variant < DefaultStateType, std::pair < DefaultSymbolType, ext::vector < DefaultSymbolType > > > > > LRActionTable; -typedef std::map < std::pair < DefaultStateType, DefaultSymbolType >, DefaultStateType > LRGotoTable; +typedef ext::map < DefaultSymbolType, ext::set < std::pair < unsigned, ext::vector < DefaultSymbolType > > > > LR0Items; +typedef ext::map < std::pair < DefaultStateType, DefaultSymbolType >, std::pair < LRAction, ext::variant < DefaultStateType, std::pair < DefaultSymbolType, ext::vector < DefaultSymbolType > > > > > LRActionTable; +typedef ext::map < std::pair < DefaultStateType, DefaultSymbolType >, DefaultStateType > LRGotoTable; } /* namespace parsing */ diff --git a/alib2data_experimental/src/indexes/common/IndexFromXMLParser.cpp b/alib2data_experimental/src/indexes/common/IndexFromXMLParser.cpp index 5fd7d56b12..341e509f93 100644 --- a/alib2data_experimental/src/indexes/common/IndexFromXMLParser.cpp +++ b/alib2data_experimental/src/indexes/common/IndexFromXMLParser.cpp @@ -26,7 +26,7 @@ ext::set < DefaultSymbolType > IndexFromXMLParser::parseAlphabet ( std::deque < SuffixTrieNodeTerminatingSymbol * IndexFromXMLParser::parseSuffixTrieNodeTerminatingSymbol ( std::deque < sax::Token >::iterator & input ) { sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, "node" ); - std::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * > children; + ext::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * > children; while ( sax::FromXMLParserHelper::isTokenType ( input, sax::Token::TokenType::START_ELEMENT ) ) { sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::START_ELEMENT, "child" ); diff --git a/alib2data_experimental/src/indexes/suffixTrie/SuffixTrieNodeTerminatingSymbol.cpp b/alib2data_experimental/src/indexes/suffixTrie/SuffixTrieNodeTerminatingSymbol.cpp index 365eddd4bd..7a8e54a6df 100644 --- a/alib2data_experimental/src/indexes/suffixTrie/SuffixTrieNodeTerminatingSymbol.cpp +++ b/alib2data_experimental/src/indexes/suffixTrie/SuffixTrieNodeTerminatingSymbol.cpp @@ -12,7 +12,7 @@ namespace indexes { -SuffixTrieNodeTerminatingSymbol::SuffixTrieNodeTerminatingSymbol ( std::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * > children ) : m_children ( std::move ( children ) ), parentTree ( NULL ) { +SuffixTrieNodeTerminatingSymbol::SuffixTrieNodeTerminatingSymbol ( ext::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * > children ) : m_children ( std::move ( children ) ), parentTree ( NULL ) { for ( auto & element : this->m_children ) element.second->parent = this; @@ -69,16 +69,16 @@ SuffixTrieNodeTerminatingSymbol::~SuffixTrieNodeTerminatingSymbol ( ) noexcept { m_children.clear ( ); } -const std::map < const DefaultSymbolType, const SuffixTrieNodeTerminatingSymbol * > & SuffixTrieNodeTerminatingSymbol::getChildren ( ) const { - return * reinterpret_cast < const std::map < const DefaultSymbolType, const SuffixTrieNodeTerminatingSymbol * > * > ( & m_children ); +const ext::map < const DefaultSymbolType, const SuffixTrieNodeTerminatingSymbol * > & SuffixTrieNodeTerminatingSymbol::getChildren ( ) const { + return * reinterpret_cast < const ext::map < const DefaultSymbolType, const SuffixTrieNodeTerminatingSymbol * > * > ( & m_children ); } -const std::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * > & SuffixTrieNodeTerminatingSymbol::getChildren ( ) { +const ext::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * > & SuffixTrieNodeTerminatingSymbol::getChildren ( ) { return m_children; } SuffixTrieNodeTerminatingSymbol & SuffixTrieNodeTerminatingSymbol::getChild ( const DefaultSymbolType & symbol ) { - std::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * >::const_iterator iter = m_children.find ( symbol ); + ext::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * >::const_iterator iter = m_children.find ( symbol ); if ( iter == m_children.end ( ) ) throw exception::CommonException ( "child does not exist" ); @@ -86,7 +86,7 @@ SuffixTrieNodeTerminatingSymbol & SuffixTrieNodeTerminatingSymbol::getChild ( co } const SuffixTrieNodeTerminatingSymbol & SuffixTrieNodeTerminatingSymbol::getChild ( const DefaultSymbolType & symbol ) const { - std::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * >::const_iterator iter = m_children.find ( symbol ); + ext::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * >::const_iterator iter = m_children.find ( symbol ); if ( iter == m_children.end ( ) ) throw exception::CommonException ( "child does not exist" ); @@ -100,7 +100,7 @@ bool SuffixTrieNodeTerminatingSymbol::hasChild ( const DefaultSymbolType & symbo } SuffixTrieNodeTerminatingSymbol & SuffixTrieNodeTerminatingSymbol::addChild ( DefaultSymbolType symbol, SuffixTrieNodeTerminatingSymbol node ) { - std::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * >::iterator iter = m_children.find ( symbol ); + ext::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * >::iterator iter = m_children.find ( symbol ); if ( iter != m_children.end ( ) ) throw exception::CommonException ( "child already exist" ); diff --git a/alib2data_experimental/src/indexes/suffixTrie/SuffixTrieNodeTerminatingSymbol.h b/alib2data_experimental/src/indexes/suffixTrie/SuffixTrieNodeTerminatingSymbol.h index 1d98544c5c..be5ecaea2b 100644 --- a/alib2data_experimental/src/indexes/suffixTrie/SuffixTrieNodeTerminatingSymbol.h +++ b/alib2data_experimental/src/indexes/suffixTrie/SuffixTrieNodeTerminatingSymbol.h @@ -21,7 +21,7 @@ class SuffixTrieTerminatingSymbol; */ class SuffixTrieNodeTerminatingSymbol { protected: - std::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * > m_children; + ext::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * > m_children; SuffixTrieNodeTerminatingSymbol * parent; @@ -36,7 +36,7 @@ protected: bool attachTree ( const SuffixTrieTerminatingSymbol * tree ); public: - explicit SuffixTrieNodeTerminatingSymbol ( std::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * > children ); + explicit SuffixTrieNodeTerminatingSymbol ( ext::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * > children ); SuffixTrieNodeTerminatingSymbol ( const SuffixTrieNodeTerminatingSymbol & other ); SuffixTrieNodeTerminatingSymbol ( SuffixTrieNodeTerminatingSymbol && other ) noexcept; @@ -67,12 +67,12 @@ public: /** * @return children */ - const std::map < const DefaultSymbolType, const SuffixTrieNodeTerminatingSymbol * > & getChildren ( ) const; + const ext::map < const DefaultSymbolType, const SuffixTrieNodeTerminatingSymbol * > & getChildren ( ) const; /** * @return children */ - const std::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * > & getChildren ( ); + const ext::map < DefaultSymbolType, SuffixTrieNodeTerminatingSymbol * > & getChildren ( ); SuffixTrieNodeTerminatingSymbol & getChild ( const DefaultSymbolType & symbol ); diff --git a/alib2elgo/src/automaton/properties/efficient/AllEpsilonClosure.cpp b/alib2elgo/src/automaton/properties/efficient/AllEpsilonClosure.cpp index d675f836ab..b7538d680a 100644 --- a/alib2elgo/src/automaton/properties/efficient/AllEpsilonClosure.cpp +++ b/alib2elgo/src/automaton/properties/efficient/AllEpsilonClosure.cpp @@ -14,14 +14,14 @@ namespace properties { namespace efficient { -auto AllEpsilonClosureEpsilonNFA = registration::OverloadRegister < AllEpsilonClosure, std::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::EpsilonNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); -auto AllEpsilonClosureMultiInitialStateNFA = registration::OverloadRegister < AllEpsilonClosure, std::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::MultiInitialStateNFA < >> ( AllEpsilonClosure::allEpsilonClosure ); -auto AllEpsilonClosureNFA = registration::OverloadRegister < AllEpsilonClosure, std::map < DefaultStateType, ext::set<DefaultStateType > >, automaton::NFA < > > ( AllEpsilonClosure::allEpsilonClosure ); -auto AllEpsilonClosureDFA = registration::OverloadRegister < AllEpsilonClosure, std::map < DefaultStateType, ext::set<DefaultStateType > >, automaton::DFA < > > ( AllEpsilonClosure::allEpsilonClosure ); -auto AllEpsilonClosureExtendedNFA = registration::OverloadRegister < AllEpsilonClosure, std::map < DefaultStateType, ext::set<DefaultStateType > >, automaton::ExtendedNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); -auto AllEpsilonClosureCompactNFA = registration::OverloadRegister < AllEpsilonClosure, std::map < DefaultStateType, ext::set<DefaultStateType > >, automaton::CompactNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); - -std::map<DefaultStateType, ext::set<DefaultStateType>> AllEpsilonClosure::allEpsilonClosure(const Automaton& automaton) { +auto AllEpsilonClosureEpsilonNFA = registration::OverloadRegister < AllEpsilonClosure, ext::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::EpsilonNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); +auto AllEpsilonClosureMultiInitialStateNFA = registration::OverloadRegister < AllEpsilonClosure, ext::map < DefaultStateType, ext::set < DefaultStateType > >, automaton::MultiInitialStateNFA < >> ( AllEpsilonClosure::allEpsilonClosure ); +auto AllEpsilonClosureNFA = registration::OverloadRegister < AllEpsilonClosure, ext::map < DefaultStateType, ext::set<DefaultStateType > >, automaton::NFA < > > ( AllEpsilonClosure::allEpsilonClosure ); +auto AllEpsilonClosureDFA = registration::OverloadRegister < AllEpsilonClosure, ext::map < DefaultStateType, ext::set<DefaultStateType > >, automaton::DFA < > > ( AllEpsilonClosure::allEpsilonClosure ); +auto AllEpsilonClosureExtendedNFA = registration::OverloadRegister < AllEpsilonClosure, ext::map < DefaultStateType, ext::set<DefaultStateType > >, automaton::ExtendedNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); +auto AllEpsilonClosureCompactNFA = registration::OverloadRegister < AllEpsilonClosure, ext::map < DefaultStateType, ext::set<DefaultStateType > >, automaton::CompactNFA < > > ( AllEpsilonClosure::allEpsilonClosure ); + +ext::map<DefaultStateType, ext::set<DefaultStateType>> AllEpsilonClosure::allEpsilonClosure(const Automaton& automaton) { return dispatch(automaton.getData()); } diff --git a/alib2elgo/src/automaton/properties/efficient/AllEpsilonClosure.h b/alib2elgo/src/automaton/properties/efficient/AllEpsilonClosure.h index 74f1b22403..11ff00cf9c 100644 --- a/alib2elgo/src/automaton/properties/efficient/AllEpsilonClosure.h +++ b/alib2elgo/src/automaton/properties/efficient/AllEpsilonClosure.h @@ -34,31 +34,31 @@ namespace properties { namespace efficient { -class AllEpsilonClosure : public alib::SingleDispatch<AllEpsilonClosure, std::map<DefaultStateType, ext::set<DefaultStateType>>, const automaton::AutomatonBase &> { +class AllEpsilonClosure : public alib::SingleDispatch<AllEpsilonClosure, ext::map<DefaultStateType, ext::set<DefaultStateType>>, const automaton::AutomatonBase &> { template < class StateType > - static void process(const std::map<StateType, ext::set<StateType>>& epsilonTransitions, const StateType * state, std::map<StateType, ext::set<StateType>>& closures, ext::set<StateType>& visited, ext::set<StateType>& nonvisited); + static void process(const ext::map<StateType, ext::set<StateType>>& epsilonTransitions, const StateType * state, ext::map<StateType, ext::set<StateType>>& closures, ext::set<StateType>& visited, ext::set<StateType>& nonvisited); public: - static std::map<DefaultStateType, ext::set<DefaultStateType>> allEpsilonClosure( const automaton::Automaton & automaton); + static ext::map<DefaultStateType, ext::set<DefaultStateType>> allEpsilonClosure( const automaton::Automaton & automaton); /** * Computes allEpsilon closure of a state in allEpsilon nonfree automaton */ template < class SymbolType, class EpsilonType, class StateType > - static std::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm); + static ext::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm); template < class SymbolType, class StateType > - static std::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm); + static ext::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm); template < class SymbolType, class StateType > - static std::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::NFA < SymbolType, StateType > & fsm); + static ext::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::NFA < SymbolType, StateType > & fsm); template < class SymbolType, class StateType > - static std::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::DFA < SymbolType, StateType > & fsm); + static ext::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::DFA < SymbolType, StateType > & fsm); template < class SymbolType, class StateType > - static std::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::ExtendedNFA < SymbolType, StateType > & fsm); + static ext::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::ExtendedNFA < SymbolType, StateType > & fsm); template < class SymbolType, class StateType > - static std::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::CompactNFA < SymbolType, StateType > & fsm); + static ext::map<StateType, ext::set<StateType>> allEpsilonClosure( const automaton::CompactNFA < SymbolType, StateType > & fsm); }; template < class StateType > -void AllEpsilonClosure::process(const std::map<StateType, ext::set<StateType>>& epsilonTransitions, const StateType * state, std::map<StateType, ext::set<StateType>>& closures, ext::set<StateType>& visited, ext::set<StateType>& nonvisited) { +void AllEpsilonClosure::process(const ext::map<StateType, ext::set<StateType>>& epsilonTransitions, const StateType * state, ext::map<StateType, ext::set<StateType>>& closures, ext::set<StateType>& visited, ext::set<StateType>& nonvisited) { if(visited.count(*state)) return; state = &*visited.insert(*state).first; @@ -74,8 +74,8 @@ void AllEpsilonClosure::process(const std::map<StateType, ext::set<StateType>>& } template < class SymbolType, class EpsilonType, class StateType > -std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm) { - std::map<StateType, ext::set<StateType>> res; +ext::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::EpsilonNFA < SymbolType, EpsilonType, StateType > & fsm) { + ext::map<StateType, ext::set<StateType>> res; for(const StateType& state : fsm.getStates()) res[state].insert(state); @@ -83,7 +83,7 @@ std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( c ext::set<StateType> visited; ext::set<StateType> nonvisited = fsm.getStates(); - std::map<StateType, ext::set<StateType>> epsilonTransitions = fsm.getEpsilonTransitions(); + ext::map<StateType, ext::set<StateType>> epsilonTransitions = fsm.getEpsilonTransitions(); while(nonvisited.size()) { process(epsilonTransitions, &*nonvisited.begin(), res, visited, nonvisited); @@ -99,32 +99,32 @@ std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( c } template < class SymbolType, class StateType > -std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm) { - std::map<StateType, ext::set<StateType>> closure; +ext::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm) { + ext::map<StateType, ext::set<StateType>> closure; for(const StateType& state : fsm.getStates()) closure[state].insert(state); return closure; } template < class SymbolType, class StateType > -std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::NFA < SymbolType, StateType > & fsm) { - std::map<StateType, ext::set<StateType>> closure; +ext::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::NFA < SymbolType, StateType > & fsm) { + ext::map<StateType, ext::set<StateType>> closure; for(const StateType& state : fsm.getStates()) closure[state].insert(state); return closure; } template < class SymbolType, class StateType > -std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::DFA < SymbolType, StateType > & fsm) { - std::map<StateType, ext::set<StateType>> closure; +ext::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::DFA < SymbolType, StateType > & fsm) { + ext::map<StateType, ext::set<StateType>> closure; for(const StateType& state : fsm.getStates()) closure[state].insert(state); return closure; } template < class SymbolType, class StateType > -std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::ExtendedNFA < SymbolType, StateType > & fsm) { - std::map<StateType, ext::set<StateType>> res; +ext::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::ExtendedNFA < SymbolType, StateType > & fsm) { + ext::map<StateType, ext::set<StateType>> res; for(const StateType& state : fsm.getStates()) res[state].insert(state); @@ -132,7 +132,7 @@ std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( c ext::set<StateType> visited; ext::set<StateType> nonvisited = fsm.getStates(); - std::map<StateType, ext::set<StateType>> epsilonTransitions; + ext::map<StateType, ext::set<StateType>> epsilonTransitions; for(const std::pair<const std::pair<StateType, regexp::UnboundedRegExpStructure < SymbolType > >, ext::set<StateType> >& transition : fsm.getTransitions() ) if( regexp::properties::RegExpEpsilon::languageContainsEpsilon( transition.first.second ) ) epsilonTransitions[transition.first.first].insert(transition.second.begin(), transition.second.end()); @@ -151,8 +151,8 @@ std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( c } template < class SymbolType, class StateType > -std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::CompactNFA < SymbolType, StateType > & fsm) { - std::map<StateType, ext::set<StateType>> res; +ext::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( const automaton::CompactNFA < SymbolType, StateType > & fsm) { + ext::map<StateType, ext::set<StateType>> res; for(const StateType& state : fsm.getStates()) res[state].insert(state); @@ -160,7 +160,7 @@ std::map<StateType, ext::set<StateType>> AllEpsilonClosure::allEpsilonClosure( c ext::set<StateType> visited; ext::set<StateType> nonvisited = fsm.getStates(); - std::map<StateType, ext::set<StateType>> epsilonTransitions; + ext::map<StateType, ext::set<StateType>> epsilonTransitions; for(const std::pair<const std::pair<StateType, ext::vector < SymbolType > >, ext::set<StateType> >& transition : fsm.getTransitions() ) if( transition.first.second.size() == 0 ) epsilonTransitions[transition.first.first].insert(transition.second.begin(), transition.second.end()); diff --git a/alib2elgo/src/automaton/properties/efficient/ReachableStates.h b/alib2elgo/src/automaton/properties/efficient/ReachableStates.h index ad1e3c1eb8..8e40817aee 100644 --- a/alib2elgo/src/automaton/properties/efficient/ReachableStates.h +++ b/alib2elgo/src/automaton/properties/efficient/ReachableStates.h @@ -47,7 +47,7 @@ public: template < class T, class SymbolType, class StateType > ext::set<StateType> ReachableStates::reachableStates( const T & fsm ) { - std::map<StateType, ext::set<StateType>> transitions; + ext::map<StateType, ext::set<StateType>> transitions; for(const auto& transition : fsm.getTransitions()) transitions[transition.first.first].insert(transition.second.begin(), transition.second.end()); @@ -69,7 +69,7 @@ ext::set<StateType> ReachableStates::reachableStates( const T & fsm ) { template < class SymbolType, class StateType > ext::set<StateType> ReachableStates::reachableStates( const automaton::MultiInitialStateNFA < SymbolType, StateType > & fsm ) { - std::map<StateType, ext::set<StateType>> transitions; + ext::map<StateType, ext::set<StateType>> transitions; for(const auto& transition : fsm.getTransitions()) transitions[transition.first.first].insert(transition.second.begin(), transition.second.end()); @@ -91,7 +91,7 @@ ext::set<StateType> ReachableStates::reachableStates( const automaton::MultiInit template < class SymbolType, class StateType > ext::set<StateType> ReachableStates::reachableStates( const automaton::DFA < SymbolType, StateType > & fsm ) { - std::map<StateType, ext::set<StateType>> transitions; + ext::map<StateType, ext::set<StateType>> transitions; for(const auto& transition : fsm.getTransitions()) transitions[transition.first.first].insert(transition.second); diff --git a/alib2elgo/src/automaton/properties/efficient/UsefullStates.h b/alib2elgo/src/automaton/properties/efficient/UsefullStates.h index 04cc6e7360..ec6ba8829b 100644 --- a/alib2elgo/src/automaton/properties/efficient/UsefullStates.h +++ b/alib2elgo/src/automaton/properties/efficient/UsefullStates.h @@ -45,7 +45,7 @@ public: template < class T, class SymbolType, class StateType > ext::set<StateType> UsefullStates::usefullStates( const T & fsm ) { - std::map<StateType, ext::set<StateType>> reversedTransitions; + ext::map<StateType, ext::set<StateType>> reversedTransitions; for(const auto& transition : fsm.getTransitions()) for(const StateType& to : transition.second) reversedTransitions[to].insert(transition.first.first); @@ -68,7 +68,7 @@ ext::set<StateType> UsefullStates::usefullStates( const T & fsm ) { template < class SymbolType, class StateType > ext::set<StateType> UsefullStates::usefullStates( const automaton::DFA < SymbolType, StateType > & fsm ) { - std::map<StateType, ext::set<StateType>> reversedTransitions; + ext::map<StateType, ext::set<StateType>> reversedTransitions; for(const auto& transition : fsm.getTransitions()) reversedTransitions[transition.second].insert(transition.first.first); diff --git a/alib2elgo/src/automaton/simplify/efficient/EpsilonRemoverIncoming.h b/alib2elgo/src/automaton/simplify/efficient/EpsilonRemoverIncoming.h index 6b5c73d752..c059896aea 100644 --- a/alib2elgo/src/automaton/simplify/efficient/EpsilonRemoverIncoming.h +++ b/alib2elgo/src/automaton/simplify/efficient/EpsilonRemoverIncoming.h @@ -66,9 +66,9 @@ automaton::NFA < SymbolType, StateType > EpsilonRemoverIncoming::remove ( const fsm.setStates ( origFSM.getStates ( ) ); fsm.setInputAlphabet ( origFSM.getInputAlphabet ( ) ); - std::map < StateType, ext::set < StateType > > closures = automaton::properties::efficient::AllEpsilonClosure::allEpsilonClosure ( origFSM ); + ext::map < StateType, ext::set < StateType > > closures = automaton::properties::efficient::AllEpsilonClosure::allEpsilonClosure ( origFSM ); - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > origTransitions = origFSM.getSymbolTransitions ( ); + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > origTransitions = origFSM.getSymbolTransitions ( ); /** * Step 1 from Melichar 2.41 diff --git a/alib2elgo/src/automaton/simplify/efficient/EpsilonRemoverOutgoing.h b/alib2elgo/src/automaton/simplify/efficient/EpsilonRemoverOutgoing.h index 05d0b08db6..7ccbeaaae0 100644 --- a/alib2elgo/src/automaton/simplify/efficient/EpsilonRemoverOutgoing.h +++ b/alib2elgo/src/automaton/simplify/efficient/EpsilonRemoverOutgoing.h @@ -66,9 +66,9 @@ automaton::MultiInitialStateNFA < SymbolType, StateType > EpsilonRemoverOutgoing fsm.setFinalStates ( origFSM.getFinalStates ( ) ); fsm.setInputAlphabet ( origFSM.getInputAlphabet ( ) ); - std::map < StateType, ext::set < StateType > > closures = automaton::properties::efficient::AllEpsilonClosure::allEpsilonClosure ( origFSM ); + ext::map < StateType, ext::set < StateType > > closures = automaton::properties::efficient::AllEpsilonClosure::allEpsilonClosure ( origFSM ); - std::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitions = origFSM.getSymbolTransitions ( ); + ext::map < std::pair < StateType, SymbolType >, ext::set < StateType > > transitions = origFSM.getSymbolTransitions ( ); for ( const std::pair < const std::pair < StateType, SymbolType >, ext::set < StateType > > & transition : transitions ) for ( const StateType & to : transition.second ) diff --git a/alib2measurepp/src/processor/MeasurementProcessor.cpp b/alib2measurepp/src/processor/MeasurementProcessor.cpp index 4db3577e67..7af7c0cb1d 100644 --- a/alib2measurepp/src/processor/MeasurementProcessor.cpp +++ b/alib2measurepp/src/processor/MeasurementProcessor.cpp @@ -87,7 +87,7 @@ MeasurementProvisionerResults MeasurementProcessor::aggregate ( const Measuremen MeasurementProvisionerResults aggregatedResults; - std::map < ext::vector < std::pair < int, std::string > >, ext::vector < MPRInputResult > > sameInputCombinations; + ext::map < ext::vector < std::pair < int, std::string > >, ext::vector < MPRInputResult > > sameInputCombinations; for ( const auto & mprir : mpr.inputResults ) sameInputCombinations[mprir.inputs].push_back ( mprir ); diff --git a/alib2measurepp/src/processor/MeasurementProcessorFilter.hpp b/alib2measurepp/src/processor/MeasurementProcessorFilter.hpp index 8d78fbff6d..62fb934d4f 100644 --- a/alib2measurepp/src/processor/MeasurementProcessorFilter.hpp +++ b/alib2measurepp/src/processor/MeasurementProcessorFilter.hpp @@ -17,7 +17,7 @@ public: }; private: - std::map < FilterType, ext::set < std::string > > filters; + ext::map < FilterType, ext::set < std::string > > filters; public: void add ( FilterType, const std::string & ); diff --git a/alib2measurepp/src/provisioner/MeasurementProvisionerInputData.cpp b/alib2measurepp/src/provisioner/MeasurementProvisionerInputData.cpp index 00858011ed..8d8e7700e7 100644 --- a/alib2measurepp/src/provisioner/MeasurementProvisionerInputData.cpp +++ b/alib2measurepp/src/provisioner/MeasurementProvisionerInputData.cpp @@ -216,7 +216,7 @@ void MPInputData::processSimpleBatchGeneratorData ( const MPCInputDatum & inputD } void MPInputData::processSimpleBatch ( const MPCInputBatch & inputBatch ) { - std::map < int, std::list < std::string > > distributedMPInputData; + ext::map < int, std::list < std::string > > distributedMPInputData; for ( const MPCInputDatum & inputDatum : inputBatch.batch ) { std::list < std::string > & didList = distributedMPInputData[inputDatum.id]; @@ -286,7 +286,7 @@ void MPInputData::processDependencyBatch ( const MPCInputBatch & inputBatch ) { // the already processed substitution maps into the batch being processed // distribute MPCInputData by their ids for processing in order - std::map < int, std::list < MPCInputDatum > > distributedMPCInputData; + ext::map < int, std::list < MPCInputDatum > > distributedMPCInputData; for ( const MPCInputDatum & inputDatum : inputBatch.batch ) distributedMPCInputData[inputDatum.id].push_back ( inputDatum ); diff --git a/alib2measurepp/src/provisioner/MeasurementProvisionerInputData.hpp b/alib2measurepp/src/provisioner/MeasurementProvisionerInputData.hpp index ee2128a585..189bd766c2 100644 --- a/alib2measurepp/src/provisioner/MeasurementProvisionerInputData.hpp +++ b/alib2measurepp/src/provisioner/MeasurementProvisionerInputData.hpp @@ -32,7 +32,7 @@ struct MPInputDatum { ~MPInputDatum ( ); }; -using MPSubstitutionMap = std::map < int, std::string >; +using MPSubstitutionMap = ext::map < int, std::string >; class MPSubstitution { ext::vector < std::string > tokens; @@ -70,7 +70,7 @@ public: using MPPipeline = std::list < MPPipelineCommand >; class MPInputData { - std::map < std::string, MPInputDatum > mpidHandles; + ext::map < std::string, MPInputDatum > mpidHandles; std::list < MPSubstitutionMap > substitutionMaps; ext::set < int > requiredSubstitutionPattern; diff --git a/alib2std/src/extensions/map.hpp b/alib2std/src/extensions/map.hpp index ec3f1063b3..d0d985625c 100644 --- a/alib2std/src/extensions/map.hpp +++ b/alib2std/src/extensions/map.hpp @@ -17,10 +17,42 @@ #include "compare.hpp" #include "pair.hpp" -namespace std { +namespace ext { + +template < typename T, typename R, typename Cmp = std::less < T >, typename Alloc = std::allocator < std::pair < const T, R > > > +class map : public std::map < T, R, Cmp, Alloc > { +public: +#ifdef __clang__ + using std::map< T, R, Cmp, Alloc >::map; + using std::map< T, R, Cmp, Alloc >::operator =; +#else + map ( ) noexcept : std::map < T, R, Cmp, Alloc > ( ) { + } + + map ( const map & other ) noexcept : std::map < T, R, Cmp, Alloc > ( other ) { + } + + map ( map && other ) noexcept : std::map < T, R, Cmp, Alloc > ( std::move ( other ) ) { + } + + using std::map < T, R, Cmp, Alloc >::map; + + map & operator = ( map && other ) noexcept { + static_cast < std::map < T, R, Cmp, Alloc > & > ( * this ) = std::move ( other ); + return * this; + } + + map & operator = ( const map & other ) noexcept { + static_cast < std::map < T, R, Cmp, Alloc > & > ( * this ) = other; + return * this; + } + + using std::map < T, R, Cmp, Alloc >::operator =; +#endif +}; template< class T, class R, class ... Ts > -std::ostream& operator<<(std::ostream& out, const std::map<T, R, Ts ... >& map) { +std::ostream& operator<<(std::ostream& out, const ext::map<T, R, Ts ... >& map) { out << "{"; bool first = true; @@ -34,13 +66,9 @@ std::ostream& operator<<(std::ostream& out, const std::map<T, R, Ts ... >& map) return out; } -} /* namespace std */ - -namespace ext { - template < class T, class R, class ... Ts > -struct compare < std::map < T, R, Ts ... > > { - int operator ( ) ( const std::map < T, R, Ts ... > & first, const std::map < T, R, Ts ... > & second) const { +struct compare < ext::map < T, R, Ts ... > > { + int operator ( ) ( const ext::map < T, R, Ts ... > & first, const ext::map < T, R, Ts ... > & second) const { if(first.size() < second.size()) return -1; if(first.size() > second.size()) return 1; @@ -54,7 +82,7 @@ struct compare < std::map < T, R, Ts ... > > { }; template < class T, class R, class ... Ts > -std::string to_string ( const std::map < T, R, Ts ... > & value ) { +std::string to_string ( const ext::map < T, R, Ts ... > & value ) { std::stringstream ss; ss << value; return ss.str(); @@ -158,41 +186,41 @@ public: template<class T, class R> class moveable_map_ref { - std::map < T, R > & theMap; + ext::map < T, R > & theMap; public: - moveable_map_ref ( std::map < T, R > & param ) : theMap ( param ) {} + moveable_map_ref ( ext::map < T, R > & param ) : theMap ( param ) {} - map_move_iterator < typename std::map < T, R >::iterator, T, R > begin ( ) { - return map_move_iterator < typename std::map < T, R >::iterator, T, R > ( theMap.begin ( ) ); + map_move_iterator < typename ext::map < T, R >::iterator, T, R > begin ( ) { + return map_move_iterator < typename ext::map < T, R >::iterator, T, R > ( theMap.begin ( ) ); } - map_move_iterator < typename std::map < T, R >::iterator, T, R > end ( ) { - return map_move_iterator < typename std::map < T, R >::iterator, T, R > ( theMap.end ( ) ); + map_move_iterator < typename ext::map < T, R >::iterator, T, R > end ( ) { + return map_move_iterator < typename ext::map < T, R >::iterator, T, R > ( theMap.end ( ) ); } }; template<class T, class R> -moveable_map_ref < T, R > make_moveable_map (std::map < T, R > & map) { +moveable_map_ref < T, R > make_moveable_map (ext::map < T, R > & map) { return moveable_map_ref < T, R > ( map ); } template<class T, class R> class moveable_map { - std::map<T, R> theMap; + ext::map<T, R> theMap; public: - moveable_map ( std::map < T, R > && param) : theMap(std::move(param)) {} + moveable_map ( ext::map < T, R > && param) : theMap(std::move(param)) {} - map_move_iterator<typename std::map < T, R >::iterator, T, R > begin() { - return map_move_iterator<typename std::map < T, R >::iterator, T, R > (theMap.begin()); + map_move_iterator<typename ext::map < T, R >::iterator, T, R > begin() { + return map_move_iterator<typename ext::map < T, R >::iterator, T, R > (theMap.begin()); } - map_move_iterator<typename std::map < T, R >::iterator, T, R > end() { - return map_move_iterator<typename std::map < T, R >::iterator, T, R > (theMap.end()); + map_move_iterator<typename ext::map < T, R >::iterator, T, R > end() { + return map_move_iterator<typename ext::map < T, R >::iterator, T, R > (theMap.end()); } }; template < class T, class R > -moveable_map < T, R > make_moveable_map ( std::map < T, R > && map) { +moveable_map < T, R > make_moveable_map ( ext::map < T, R > && map) { return moveable_map < T, R > ( std::move ( map ) ); } diff --git a/alib2std/src/extensions/trie.hpp b/alib2std/src/extensions/trie.hpp index 9a3ca87ce7..cf85c08b7c 100644 --- a/alib2std/src/extensions/trie.hpp +++ b/alib2std/src/extensions/trie.hpp @@ -17,6 +17,7 @@ #include "compare.hpp" #include "pair.hpp" #include "tuple.hpp" +#include "map.hpp" namespace ext { @@ -25,7 +26,7 @@ class trie { Value m_data; trie * m_parent; - std::map < Key, trie > m_children; + ext::map < Key, trie > m_children; public: trie * getParent ( ) { @@ -44,11 +45,11 @@ public: return m_data; } - std::map < Key, trie > & getChildren ( ) { + ext::map < Key, trie > & getChildren ( ) { return m_children; } - const std::map < Key, trie > & getChildren ( ) const { + const ext::map < Key, trie > & getChildren ( ) const { return m_children; } @@ -73,14 +74,14 @@ public: } } - typedef typename std::map < Key, trie >::const_iterator const_children_iterator; + typedef typename ext::map < Key, trie >::const_iterator const_children_iterator; typedef const trie * const_child_iterator; // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- private: void insert_helper ( const_child_iterator under, const_children_iterator begin, const_children_iterator end ) { - std::map < Key, trie > & children = const_cast < std::map < Key, trie > & > ( under->getChildren ( ) ); + ext::map < Key, trie > & children = const_cast < ext::map < Key, trie > & > ( under->getChildren ( ) ); for ( ; begin != end; ++begin ) children.insert ( * begin ).first->second.m_parent = const_cast < trie * > ( & * under ); @@ -88,9 +89,9 @@ private: public: void insert ( const_child_iterator under, Key key, trie < Key, Value > && value ) { - std::map < Key, trie > & children = const_cast < std::map < Key, trie > & > ( under->getChildren ( ) ); + ext::map < Key, trie > & children = const_cast < ext::map < Key, trie > & > ( under->getChildren ( ) ); - std::pair < typename std::map < Key, trie >::iterator, bool > iter = children.insert ( std::make_pair ( std::move ( key ), std::move ( value ) ) ); + std::pair < typename ext::map < Key, trie >::iterator, bool > iter = children.insert ( std::make_pair ( std::move ( key ), std::move ( value ) ) ); iter.first->second.m_parent = const_cast < trie * > ( & * under ); } @@ -105,23 +106,23 @@ public: // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- public: - trie ( Value && data, std::map < Key, trie > && children ) : m_data ( std::move ( data ) ), m_parent ( nullptr ), m_children ( std::move ( children ) ) { + trie ( Value && data, ext::map < Key, trie > && children ) : m_data ( std::move ( data ) ), m_parent ( nullptr ), m_children ( std::move ( children ) ) { for ( std::pair < const Key, trie > & child : m_children ) child.second.m_parent = this; } - trie ( const Value & data, const std::map < Key, trie > & subtrees ) : trie ( Value ( data ), std::map < Key, trie > ( subtrees ) ) { + trie ( const Value & data, const ext::map < Key, trie > & subtrees ) : trie ( Value ( data ), ext::map < Key, trie > ( subtrees ) ) { } template < typename ... Types > - trie ( const Value & data, Types ... subtrees ) : trie ( data, std::map < Key, trie > { subtrees ... } ) { + trie ( const Value & data, Types ... subtrees ) : trie ( data, ext::map < Key, trie > { subtrees ... } ) { } template < typename ... Types > - trie ( Value && data, Types ... subtrees ) : trie ( std::move ( data ), std::map < Key, trie > { subtrees ... } ) { + trie ( Value && data, Types ... subtrees ) : trie ( std::move ( data ), ext::map < Key, trie > { subtrees ... } ) { } - trie ( const Value & data, const_children_iterator begin, const_children_iterator end ) : trie ( data, std::map < Key, trie > ( begin, end ) ) { + trie ( const Value & data, const_children_iterator begin, const_children_iterator end ) : trie ( data, ext::map < Key, trie > ( begin, end ) ) { } ~trie ( ) noexcept { @@ -172,7 +173,7 @@ public: // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- const_children_iterator erase ( const_child_iterator under, const_children_iterator position ) { - std::map < Key, trie > & children = const_cast < std::map < Key, trie > & > ( under->getChildren ( ) ); + ext::map < Key, trie > & children = const_cast < ext::map < Key, trie > & > ( under->getChildren ( ) ); return children.erase ( position ); } @@ -292,7 +293,7 @@ std::ostream & operator <<( std::ostream & out, const trie < Key, Value > & t ) out << t.getData ( ) << ";"; - for ( typename std::map < Key, trie < Key, Value > >::const_iterator iter = t.getChildren ( ).begin ( ); iter != t.getChildren ( ).end ( ); ++ iter) { + for ( typename ext::map < Key, trie < Key, Value > >::const_iterator iter = t.getChildren ( ).begin ( ); iter != t.getChildren ( ).end ( ); ++ iter) { if ( iter != t.getChildren ( ).begin ( ) ) { out << ","; } diff --git a/alib2std/test-src/extensions/CompareTest.cpp b/alib2std/test-src/extensions/CompareTest.cpp index 01d9737ca8..ae74c7d018 100644 --- a/alib2std/test-src/extensions/CompareTest.cpp +++ b/alib2std/test-src/extensions/CompareTest.cpp @@ -38,10 +38,10 @@ void CompareTest::testCompare() { int three = 3; int four = 4; - std::map<int, const int*> map1 = { {1, &two}, {2, &three} }; - std::map<int, const int*> map2 = { {2, &three}, {3, &four} }; + ext::map<int, const int*> map1 = { {1, &two}, {2, &three} }; + ext::map<int, const int*> map2 = { {2, &three}, {3, &four} }; - ext::compare<std::map<int, const int*>> comp4; + ext::compare<ext::map<int, const int*>> comp4; CPPUNIT_ASSERT(comp4(map1, map2) < 0); auto first = std::tie(vector1, set1, pair1, map1); diff --git a/alib2std/test-src/extensions/MapTest.cpp b/alib2std/test-src/extensions/MapTest.cpp index c362e6e313..27c8bb40f4 100644 --- a/alib2std/test-src/extensions/MapTest.cpp +++ b/alib2std/test-src/extensions/MapTest.cpp @@ -15,9 +15,9 @@ void MapTest::test3() { int moves; int copies; - std::map<MapTest::Moveable, MapTest::Moveable> map; + ext::map<MapTest::Moveable, MapTest::Moveable> map; map.insert ( std::make_pair ( MapTest::Moveable(moves, copies ), MapTest::Moveable(moves, copies)) ); - std::map<MapTest::Moveable, MapTest::Moveable> map2; + ext::map<MapTest::Moveable, MapTest::Moveable> map2; for( std::pair < Moveable, Moveable > moveablePair : ext::make_moveable_map(map)) { map2.insert(std::move(moveablePair)); diff --git a/alib2std/test-src/extensions/TrieTest.cpp b/alib2std/test-src/extensions/TrieTest.cpp index e1ce530c3b..c996e2d011 100644 --- a/alib2std/test-src/extensions/TrieTest.cpp +++ b/alib2std/test-src/extensions/TrieTest.cpp @@ -18,7 +18,7 @@ void TrieTest::print_tree ( const ext::trie < char, int > & tree, std::string in } void TrieTest::testTrieStdStructure ( ) { - ext::trie < char, int > t ( 0, std::map < char, ext::trie < char, int > > { std::make_pair ( 'a', ext::trie < char, int > ( 1 ) ), std::make_pair ( 'b', ext::trie < char, int > ( 2 ) ) } ); + ext::trie < char, int > t ( 0, ext::map < char, ext::trie < char, int > > { std::make_pair ( 'a', ext::trie < char, int > ( 1 ) ), std::make_pair ( 'b', ext::trie < char, int > ( 2 ) ) } ); // std::cout << "structure t " << std::boolalpha << t.checkStructure() << std::endl; @@ -30,10 +30,10 @@ void TrieTest::testTrieStdStructure ( ) { std::cout << t2 << std::endl; - CPPUNIT_ASSERT ( t2 == ( ext::trie < char, int > ( 3, std::map < char, ext::trie < char, int > > { std::make_pair ( 'c', ext::trie < char, int > ( 4 ) ) } ) ) ); + CPPUNIT_ASSERT ( t2 == ( ext::trie < char, int > ( 3, ext::map < char, ext::trie < char, int > > { std::make_pair ( 'c', ext::trie < char, int > ( 4 ) ) } ) ) ); std::swap ( t2.getChildren ( ).begin()->second, t.getChildren().begin()->second ); - CPPUNIT_ASSERT ( t2 == ( ext::trie < char, int > ( 3, std::map < char, ext::trie < char, int > > { std::make_pair ( 'c', ext::trie < char, int > ( 1 ) ) } ) ) ); - CPPUNIT_ASSERT ( t == ( ext::trie < char, int > ( 0, std::map < char, ext::trie < char, int > > { std::make_pair ( 'a', ext::trie < char, int > ( 4 ) ), std::make_pair ( 'b', ext::trie < char, int > ( 2 ) ) } ) ) ); + CPPUNIT_ASSERT ( t2 == ( ext::trie < char, int > ( 3, ext::map < char, ext::trie < char, int > > { std::make_pair ( 'c', ext::trie < char, int > ( 1 ) ) } ) ) ); + CPPUNIT_ASSERT ( t == ( ext::trie < char, int > ( 0, ext::map < char, ext::trie < char, int > > { std::make_pair ( 'a', ext::trie < char, int > ( 4 ) ), std::make_pair ( 'b', ext::trie < char, int > ( 2 ) ) } ) ) ); CPPUNIT_ASSERT ( t2.checkStructure ( ) ); CPPUNIT_ASSERT ( t.checkStructure ( ) ); std::swap ( t2.getChildren ( ).begin()->second, t.getChildren().begin()->second ); diff --git a/alib2std/test-src/extensions/VariantTest.cpp b/alib2std/test-src/extensions/VariantTest.cpp index 9203dc8f6c..c051a5976c 100644 --- a/alib2std/test-src/extensions/VariantTest.cpp +++ b/alib2std/test-src/extensions/VariantTest.cpp @@ -92,7 +92,7 @@ void VariantTest::testVariantSet() { ext::variant<VariantTest::test2, std::string, VariantTest::test> h("aa"); CPPUNIT_ASSERT( h.is<std::string>() ); - std::map<ext::variant<std::string, int>, int> testMap; + ext::map<ext::variant<std::string, int>, int> testMap; testMap.insert(std::make_pair(ext::variant<std::string, int> {"aa"}, 10)); CPPUNIT_ASSERT( testMap.size() == 1 ); diff --git a/alib2str/src/automaton/AutomatonToStringComposer.h b/alib2str/src/automaton/AutomatonToStringComposer.h index 0296e11b07..f59c10f106 100644 --- a/alib2str/src/automaton/AutomatonToStringComposer.h +++ b/alib2str/src/automaton/AutomatonToStringComposer.h @@ -51,7 +51,7 @@ public: template < class SymbolType, class StateType > void AutomatonToStringComposer::composeTransitionsFromState(std::ostream& out, const DFA < SymbolType, StateType > & automaton, const StateType & from) { - ext::range < typename std::map < std::pair < StateType, SymbolType >, StateType >::const_iterator > symbolTransitionsFromState = automaton.getTransitionsFromState(from); + ext::range < typename ext::map < std::pair < StateType, SymbolType >, StateType >::const_iterator > symbolTransitionsFromState = automaton.getTransitionsFromState(from); for(const SymbolType& inputSymbol : automaton.getInputAlphabet()) { if ( ! symbolTransitionsFromState.empty ( ) && symbolTransitionsFromState.front ( ).first.second == inputSymbol ) { @@ -66,10 +66,10 @@ void AutomatonToStringComposer::composeTransitionsFromState(std::ostream& out, c template < class SymbolType, class StateType > void AutomatonToStringComposer::composeTransitionsFromState(std::ostream& out, const NFA < SymbolType, StateType > & automaton, const StateType & from) { - std::map<std::pair<StateType, SymbolType>, ext::set<StateType> > symbolTransitionsFromState = automaton.getTransitionsFromState(from); + ext::map<std::pair<StateType, SymbolType>, ext::set<StateType> > symbolTransitionsFromState = automaton.getTransitionsFromState(from); for(const SymbolType& inputSymbol : automaton.getInputAlphabet()) { - const typename std::map<std::pair<StateType, SymbolType>, ext::set<StateType> >::iterator toStates = symbolTransitionsFromState.find(std::make_pair(from, inputSymbol)); + const typename ext::map<std::pair<StateType, SymbolType>, ext::set<StateType> >::iterator toStates = symbolTransitionsFromState.find(std::make_pair(from, inputSymbol)); if(toStates == symbolTransitionsFromState.end() || toStates->second.size() == 0) { out << " -"; } else { @@ -85,10 +85,10 @@ void AutomatonToStringComposer::composeTransitionsFromState(std::ostream& out, c template < class SymbolType, class StateType > void AutomatonToStringComposer::composeTransitionsFromState(std::ostream& out, const MultiInitialStateNFA < SymbolType, StateType > & automaton, const StateType & from) { - std::map<std::pair<StateType, SymbolType>, ext::set<StateType> > symbolTransitionsFromState = automaton.getTransitionsFromState(from); + ext::map<std::pair<StateType, SymbolType>, ext::set<StateType> > symbolTransitionsFromState = automaton.getTransitionsFromState(from); for(const SymbolType& inputSymbol : automaton.getInputAlphabet()) { - const typename std::map<std::pair<StateType, SymbolType>, ext::set<StateType> >::iterator toStates = symbolTransitionsFromState.find(std::make_pair(from, inputSymbol)); + const typename ext::map<std::pair<StateType, SymbolType>, ext::set<StateType> >::iterator toStates = symbolTransitionsFromState.find(std::make_pair(from, inputSymbol)); if(toStates == symbolTransitionsFromState.end() || toStates->second.size() == 0) { out << " -"; } else { @@ -104,10 +104,10 @@ void AutomatonToStringComposer::composeTransitionsFromState(std::ostream& out, c template < class SymbolType, class EpsilonType, class StateType > void AutomatonToStringComposer::composeTransitionsFromState(std::ostream& out, const EpsilonNFA < SymbolType, EpsilonType, StateType > & automaton, const StateType & from) { - std::map<std::pair<StateType, SymbolType>, ext::set<StateType> > symbolTransitionsFromState = automaton.getSymbolTransitionsFromState(from); + ext::map<std::pair<StateType, SymbolType>, ext::set<StateType> > symbolTransitionsFromState = automaton.getSymbolTransitionsFromState(from); for(const SymbolType& inputSymbol : automaton.getInputAlphabet()) { - const typename std::map<std::pair<StateType, SymbolType>, ext::set<StateType> >::iterator toStates = symbolTransitionsFromState.find(std::make_pair(from, inputSymbol)); + const typename ext::map<std::pair<StateType, SymbolType>, ext::set<StateType> >::iterator toStates = symbolTransitionsFromState.find(std::make_pair(from, inputSymbol)); if(toStates == symbolTransitionsFromState.end() || toStates->second.size() == 0) { out << " -"; } else { @@ -120,7 +120,7 @@ void AutomatonToStringComposer::composeTransitionsFromState(std::ostream& out, c } } - std::map<StateType, ext::set<StateType> > epsilonTransitionsFromState = automaton.getEpsilonTransitionsFromState(from); + ext::map<StateType, ext::set<StateType> > epsilonTransitionsFromState = automaton.getEpsilonTransitionsFromState(from); if(epsilonTransitionsFromState.size() == 0 || epsilonTransitionsFromState.begin()->second.size() == 0) { out << " -"; } else { diff --git a/alib2str/src/grammar/GrammarFromStringParser.cpp b/alib2str/src/grammar/GrammarFromStringParser.cpp index 67d72a36ae..978b9eff23 100644 --- a/alib2str/src/grammar/GrammarFromStringParser.cpp +++ b/alib2str/src/grammar/GrammarFromStringParser.cpp @@ -111,8 +111,8 @@ ext::set<DefaultSymbolType> GrammarFromStringParser::parseSet(std::istream& inpu return res; } -std::map<DefaultSymbolType, ext::set<ext::vector<DefaultSymbolType>>> GrammarFromStringParser::parseCFLikeRules(std::istream& input) { - std::map<DefaultSymbolType, ext::set<ext::vector<DefaultSymbolType>>> result; +ext::map<DefaultSymbolType, ext::set<ext::vector<DefaultSymbolType>>> GrammarFromStringParser::parseCFLikeRules(std::istream& input) { + ext::map<DefaultSymbolType, ext::set<ext::vector<DefaultSymbolType>>> result; GrammarFromStringLexer::Token token = GrammarFromStringLexer::next(input); if(token.type != GrammarFromStringLexer::TokenType::SET_BEGIN) { @@ -188,7 +188,7 @@ T GrammarFromStringParser::parseCFLikeGrammar(std::istream& input) { throw exception::CommonException("Unrecognised Comma token."); } - std::map<DefaultSymbolType, ext::set<ext::vector<DefaultSymbolType>>> rules = parseCFLikeRules(input); + ext::map<DefaultSymbolType, ext::set<ext::vector<DefaultSymbolType>>> rules = parseCFLikeRules(input); token = GrammarFromStringLexer::next(input); if(token.type != GrammarFromStringLexer::TokenType::COMMA) { @@ -211,8 +211,8 @@ T GrammarFromStringParser::parseCFLikeGrammar(std::istream& input) { return grammar; } -std::map<ext::vector<DefaultSymbolType>, ext::set<ext::vector<DefaultSymbolType>>> GrammarFromStringParser::parseCSLikeRules(std::istream& input) { - std::map<ext::vector<DefaultSymbolType>, ext::set<ext::vector<DefaultSymbolType>>> result; +ext::map<ext::vector<DefaultSymbolType>, ext::set<ext::vector<DefaultSymbolType>>> GrammarFromStringParser::parseCSLikeRules(std::istream& input) { + ext::map<ext::vector<DefaultSymbolType>, ext::set<ext::vector<DefaultSymbolType>>> result; GrammarFromStringLexer::Token token = GrammarFromStringLexer::next(input); if(token.type != GrammarFromStringLexer::TokenType::SET_BEGIN) { @@ -295,7 +295,7 @@ T GrammarFromStringParser::parseCSLikeGrammar(std::istream& input) { throw exception::CommonException("Unrecognised Comma token."); } - std::map<ext::vector<DefaultSymbolType>, ext::set<ext::vector<DefaultSymbolType>>> rules = parseCSLikeRules(input); + ext::map<ext::vector<DefaultSymbolType>, ext::set<ext::vector<DefaultSymbolType>>> rules = parseCSLikeRules(input); token = GrammarFromStringLexer::next(input); if(token.type != GrammarFromStringLexer::TokenType::COMMA) { @@ -318,8 +318,8 @@ T GrammarFromStringParser::parseCSLikeGrammar(std::istream& input) { return grammar; } -std::map<std::tuple<ext::vector<DefaultSymbolType>, DefaultSymbolType, ext::vector<DefaultSymbolType>>, ext::set<ext::vector<DefaultSymbolType>>> GrammarFromStringParser::parsePreservingCSLikeRules(std::istream& input) { - std::map<std::tuple<ext::vector<DefaultSymbolType>, DefaultSymbolType, ext::vector<DefaultSymbolType>>, ext::set<ext::vector<DefaultSymbolType>>> result; +ext::map<std::tuple<ext::vector<DefaultSymbolType>, DefaultSymbolType, ext::vector<DefaultSymbolType>>, ext::set<ext::vector<DefaultSymbolType>>> GrammarFromStringParser::parsePreservingCSLikeRules(std::istream& input) { + ext::map<std::tuple<ext::vector<DefaultSymbolType>, DefaultSymbolType, ext::vector<DefaultSymbolType>>, ext::set<ext::vector<DefaultSymbolType>>> result; GrammarFromStringLexer::Token token = GrammarFromStringLexer::next(input); if(token.type != GrammarFromStringLexer::TokenType::SET_BEGIN) { @@ -427,7 +427,7 @@ T GrammarFromStringParser::parsePreservingCSLikeGrammar(std::istream& input) { throw exception::CommonException("Unrecognised Comma token."); } - std::map<std::tuple<ext::vector<DefaultSymbolType>, DefaultSymbolType, ext::vector<DefaultSymbolType>>, ext::set<ext::vector<DefaultSymbolType>>> rules = parsePreservingCSLikeRules(input); + ext::map<std::tuple<ext::vector<DefaultSymbolType>, DefaultSymbolType, ext::vector<DefaultSymbolType>>, ext::set<ext::vector<DefaultSymbolType>>> rules = parsePreservingCSLikeRules(input); token = GrammarFromStringLexer::next(input); if(token.type != GrammarFromStringLexer::TokenType::COMMA) { diff --git a/alib2str/src/grammar/GrammarFromStringParser.h b/alib2str/src/grammar/GrammarFromStringParser.h index 6b010a05cf..2a01530fad 100644 --- a/alib2str/src/grammar/GrammarFromStringParser.h +++ b/alib2str/src/grammar/GrammarFromStringParser.h @@ -20,15 +20,15 @@ namespace grammar { class GrammarFromStringParser { static ext::set<DefaultSymbolType> parseSet(std::istream& input); - static std::map<DefaultSymbolType, ext::set<ext::vector<DefaultSymbolType>>> parseCFLikeRules(std::istream& input); + static ext::map<DefaultSymbolType, ext::set<ext::vector<DefaultSymbolType>>> parseCFLikeRules(std::istream& input); template<class T> static T parseCFLikeGrammar(std::istream& input); - static std::map<ext::vector<DefaultSymbolType>, ext::set<ext::vector<DefaultSymbolType>>> parseCSLikeRules(std::istream& input); + static ext::map<ext::vector<DefaultSymbolType>, ext::set<ext::vector<DefaultSymbolType>>> parseCSLikeRules(std::istream& input); template<class T> static T parseCSLikeGrammar(std::istream& input); - static std::map<std::tuple<ext::vector<DefaultSymbolType>, DefaultSymbolType, ext::vector<DefaultSymbolType>>, ext::set<ext::vector<DefaultSymbolType>>> parsePreservingCSLikeRules(std::istream& input); + static ext::map<std::tuple<ext::vector<DefaultSymbolType>, DefaultSymbolType, ext::vector<DefaultSymbolType>>, ext::set<ext::vector<DefaultSymbolType>>> parsePreservingCSLikeRules(std::istream& input); template<class T> static T parsePreservingCSLikeGrammar(std::istream& input); diff --git a/astringology2/src/astringology.cpp b/astringology2/src/astringology.cpp index 454912b53d..333b36201b 100644 --- a/astringology2/src/astringology.cpp +++ b/astringology2/src/astringology.cpp @@ -385,7 +385,7 @@ int main ( int argc, char * argv[] ) { measurements::end ( ); measurements::start ( "Algorithm", measurements::Type::MAIN ); - std::map < DefaultSymbolType, size_t > bcs = string::properties::BadCharacterShiftTable::bcs ( pattern ); + ext::map < DefaultSymbolType, size_t > bcs = string::properties::BadCharacterShiftTable::bcs ( pattern ); measurements::end ( ); measurements::start ( "Output write", measurements::Type::AUXILIARY ); -- GitLab