10#include <ext/algorithm>
26 template <
class SymbolType,
class StateType >
29 template <
class StateType >
32 bool operator ( ) (
const std::pair < StateType, unsigned > & first,
const std::pair < StateType, unsigned > &
second ) {
33 return first.second <
second.second;
39template <
class SymbolType,
class StateType >
47 while ( ! open.empty ( ) ) {
48 std::pair < StateType, unsigned > current = std::move ( open.top ( ) );
50 unsigned & dist = closed [ current.first ];
52 if ( dist > current.second )
55 dist = current.second;
59 open.push (
std::make_pair ( target.second, current.second + 1 ) );
Deterministic finite automaton. Accepts regular languages.
Definition: DFA.h:71
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Definition: BackboneLength.h:30
Definition: BackboneLength.h:19
static unsigned length(const automaton::DFA< SymbolType, StateType > &automaton)
Definition: BackboneLength.h:40
typename T::StateType StateType
Definition: ToGrammarLeftRG.h:64
p second
Definition: ToRegExpAlgebraic.h:126
Definition: ToGrammar.h:31
constexpr const T & max(const T &a)
Root case of maximum computation. The maximum from one value is the value itself.
Definition: algorithm.hpp:278
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
Definition: ArithmeticCompression.h:18