// // libsemigroups - C++ library for semigroups and monoids // Copyright (C) 2019 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 implementations of the member functions for the Runner // class.
#include"libsemigroups/runner.hpp"
#include"libsemigroups/report.hpp"// for REPORT_DEFAULT #include"libsemigroups/timer.hpp"// for Timer::string
void Runner::run_for(std::chrono::nanoseconds val) { if (!finished() && !dead()) { if (val != FOREVER) {
REPORT_DEFAULT("running for approx. %s\n",
detail::Timer::string(val).c_str());
} else {
REPORT_DEFAULT("running until finished, with no time limit\n");
run(); return;
}
before_run(); auto previous_state = get_state();
set_state(state::running_for);
_start_time = std::chrono::high_resolution_clock::now();
_run_for = val; // run_impl should depend on the method timed_out!
void Runner::report_why_we_stopped() const { if (dead()) {
REPORT_DEFAULT("killed!\n");
} elseif (timed_out()) {
REPORT_DEFAULT("timed out!\n");
} // Checking finished can be expensive, so we don't
}
} // namespace libsemigroups
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
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.