// // libsemigroups - C++ library for semigroups and monoids // Copyright (C) 2022 James D. Mitchell // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. //
// This file contains an implementation of Stephen's procedure for finitely // presented semigroups and monoids.
#include"libsemigroups/stephen.hpp"
#include <chrono> // for duration, duration... #include <tuple> // for tie, tuple #include <utility> // for move, pair // #include"libsemigroups/constants.hpp"// for operator==, Undefined #include"libsemigroups/debug.hpp"// for LIBSEMIGROUPS_ASSERT #include"libsemigroups/digraph-helper.hpp"// for last_node_on_path_nc #include"libsemigroups/exception.hpp"// for LibsemigroupsExcep... #include"libsemigroups/present.hpp"// for Presentation<>::wo... #include"libsemigroups/report.hpp"// for REPORT_DEFAULT_V3 #include"libsemigroups/string.hpp"// for group_digits #include"libsemigroups/todd-coxeter-digraph.hpp"// for ToddCoxeterDigraph... #include"libsemigroups/types.hpp"// for word_type
namespace libsemigroups {
//////////////////////////////////////////////////////////////////////// // Public ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// // Private Member Functions ////////////////////////////////////////////////////////////////////////
void Stephen::init_impl(Presentation<word_type>&& p, non_lvalue_tag) { if (p.alphabet().empty()) {
LIBSEMIGROUPS_EXCEPTION( "the argument (Presentation) must not have 0 generators");
}
reset();
_presentation = std::move(p);
presentation::normalize_alphabet(_presentation);
_word_graph.init(_presentation);
_word.clear();
}
void Stephen::report_status(
std::chrono::high_resolution_clock::time_point const& start_time) { if (!report()) { return;
} using std::chrono::duration_cast; using std::chrono::seconds; auto now = std::chrono::high_resolution_clock::now(); auto total_time = duration_cast<seconds>(now - start_time);
void Stephen::validate() const { if (_presentation.alphabet().empty()) {
LIBSEMIGROUPS_EXCEPTION( "no presentation defined, use Stephen::init to set the presentation");
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.