From dfd357b67c0a0abfe9b6a78ad7e25bc9eca6636d Mon Sep 17 00:00:00 2001 From: Tomas Pecka <tomas.pecka@fit.cvut.cz> Date: Wed, 13 Nov 2019 14:55:12 +0100 Subject: [PATCH] automaton::simplify::Total: No op for FSM with total transition function (Closes #177) --- alib2algo/src/automaton/simplify/Total.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/alib2algo/src/automaton/simplify/Total.h b/alib2algo/src/automaton/simplify/Total.h index 954eb25bdc..453887a645 100644 --- a/alib2algo/src/automaton/simplify/Total.h +++ b/alib2algo/src/automaton/simplify/Total.h @@ -81,6 +81,9 @@ template < class T > ext::require < isDFA < T > || isNFA < T >, T > Total::total ( const T & automaton ) { using StateType = typename T::StateType; + if ( automaton.isTotal ( ) ) + return automaton; + T res ( automaton ); StateType nullState = common::createUnique ( label::FailStateLabel::instance < StateType > ( ), automaton.getStates ( ) ); res.addState ( nullState ); -- GitLab