// // 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/>. //
// Must include hpcombi.hpp so that LIBSEMIGROUPS_HPCOMBI_ENABLED is defined, // if so specified at during configure. #include"libsemigroups/config.hpp"// for LIBSEMIGROUPS_HPCOMBI_ENABLED
#ifdef LIBSEMIGROUPS_HPCOMBI_ENABLED
#include <cstddef> // for size_t
#include"catch.hpp"// for REQUIRE #include"libsemigroups/froidure-pin.hpp"// for FroidurePin #include"libsemigroups/hpcombi.hpp"// for PTransf16, ... #include"libsemigroups/int-range.hpp"// for IntegralRange #include"libsemigroups/report.hpp"// for ReportGuard #include"libsemigroups/transf.hpp"// for Transf<> #include"test-main.hpp"// for LIBSEMIGROUPS_TEST_CASE
usingnamespace HPCombi;
const uint8_t FF = 0xFF;
// Note that Renner0Element appears to require very little to make it a // template argument of FroidurePin, but in actual fact because it inherits // from PTransf16, most of the required specialisations of One, etc, are in // include/hpcombi.hpp.
struct Renner0Element : public PTransf16 { using PTransf16::PTransf16;
LIBSEMIGROUPS_TEST_CASE("HPCombi", "005", "Inverse specialisation", "[quick][hpcombi]") { auto id = One<Perm16>()(10); auto x = Perm16({0, 2, 1, 4, 5, 3}); auto y = Inverse<Perm16>()(x);
REQUIRE(x * y == id);
REQUIRE(y * x == id);
}
LIBSEMIGROUPS_TEST_CASE("HPCombi", "012", "Renner0", "[extreme][hpcombi]") { auto rg = ReportGuard(true);
FroidurePin<Renner0Element> S(
{Renner0Element({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}),
Renner0Element(
{FF, FF, FF, FF, FF, FF, FF, FF, 8, 9, 10, 11, 12, 13, 14, 15}),
Renner0Element({0, 1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 11, 12, 13, 14, 15}),
Renner0Element({0, 1, 2, 3, 4, 5, 7, 6, 9, 8, 10, 11, 12, 13, 14, 15}),
Renner0Element({0, 1, 2, 3, 4, 6, 5, 7, 8, 10, 9, 11, 12, 13, 14, 15}),
Renner0Element({0, 1, 2, 3, 5, 4, 6, 7, 8, 9, 11, 10, 12, 13, 14, 15}),
Renner0Element({0, 1, 2, 4, 3, 5, 6, 7, 8, 9, 10, 12, 11, 13, 14, 15}),
Renner0Element(
{0, 1, 3, 2, 4, 5, 6, 7, 8, 9, 10, 11, 13, 12, 14, 15})}); // Note that the number in this test file was 8962225 since (at least) this // file was renamed from .cc to .cpp, but the current value below ?? was // the returned value since at least commit 4d39875 (the first commit after // the file was renamed where the tests worked).
REQUIRE(S.size() == 1793622); // Same problem as above, the value below was 128.
REQUIRE(S.number_of_idempotents() == 158716);
}
LIBSEMIGROUPS_TEST_CASE("HPCombi", "013", "full transformation monoid 8", "[extreme][hpcombi]") { auto rg = ReportGuard(true);
FroidurePin<Transf16> S({Transf16({1, 2, 3, 4, 5, 6, 7, 0}),
Transf16({1, 0, 2, 3, 4, 5, 6, 7}),
Transf16({0, 1, 2, 3, 4, 5, 6, 0})}); // FIXME(later) // 1. including the next line makes this test run extremely slowly // (20/09/2019) under clang. // 2. Without the next line this is no faster than the next test. // 3. Does not appear to be an issue under gcc (FLS) - takes ~7s // S.reserve(2 * std::pow(8, 8));
REQUIRE(S.size() == 16777216);
}
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.