diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d3f535e..5af5edae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,9 +71,9 @@ add_subdirectory(doc) include_directories( ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/third_party ${PROJECT_BINARY_DIR}) - ######### # Testing @@ -102,6 +102,10 @@ install ( DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include/${CMAKE_PROJECT_NAME} FILES_MATCHING PATTERN "*.hpp") +install ( + DIRECTORY ${CMAKE_SOURCE_DIR}/third_party/ + DESTINATION third_party/${CMAKE_PROJECT_NAME} + FILES_MATCHING PATTERN "*.hpp") ################### # pkgconfig stuff diff --git a/include/arch.hpp b/include/hpcombi/arch.hpp similarity index 100% rename from include/arch.hpp rename to include/hpcombi/arch.hpp diff --git a/include/bmat8.hpp b/include/hpcombi/bmat8.hpp similarity index 100% rename from include/bmat8.hpp rename to include/hpcombi/bmat8.hpp diff --git a/include/bmat8_impl.hpp b/include/hpcombi/bmat8_impl.hpp similarity index 100% rename from include/bmat8_impl.hpp rename to include/hpcombi/bmat8_impl.hpp diff --git a/include/epu.hpp b/include/hpcombi/epu.hpp similarity index 100% rename from include/epu.hpp rename to include/hpcombi/epu.hpp diff --git a/include/epu_impl.hpp b/include/hpcombi/epu_impl.hpp similarity index 100% rename from include/epu_impl.hpp rename to include/hpcombi/epu_impl.hpp diff --git a/include/hpcombi.hpp b/include/hpcombi/hpcombi.hpp similarity index 100% rename from include/hpcombi.hpp rename to include/hpcombi/hpcombi.hpp diff --git a/include/perm16.hpp b/include/hpcombi/perm16.hpp similarity index 100% rename from include/perm16.hpp rename to include/hpcombi/perm16.hpp diff --git a/include/perm16_impl.hpp b/include/hpcombi/perm16_impl.hpp similarity index 100% rename from include/perm16_impl.hpp rename to include/hpcombi/perm16_impl.hpp diff --git a/include/perm_generic.hpp b/include/hpcombi/perm_generic.hpp similarity index 100% rename from include/perm_generic.hpp rename to include/hpcombi/perm_generic.hpp diff --git a/include/perm_generic_impl.hpp b/include/hpcombi/perm_generic_impl.hpp similarity index 100% rename from include/perm_generic_impl.hpp rename to include/hpcombi/perm_generic_impl.hpp diff --git a/include/power.hpp b/include/hpcombi/power.hpp similarity index 100% rename from include/power.hpp rename to include/hpcombi/power.hpp diff --git a/include/vect16.hpp b/include/hpcombi/vect16.hpp similarity index 100% rename from include/vect16.hpp rename to include/hpcombi/vect16.hpp diff --git a/include/vect_generic.hpp b/include/hpcombi/vect_generic.hpp similarity index 100% rename from include/vect_generic.hpp rename to include/hpcombi/vect_generic.hpp diff --git a/tests/test_bmat8.cpp b/tests/test_bmat8.cpp index 7f486089..1ca173cf 100644 --- a/tests/test_bmat8.cpp +++ b/tests/test_bmat8.cpp @@ -20,8 +20,8 @@ #include "test_main.hpp" #include -#include "bmat8.hpp" -#include "epu.hpp" +#include "hpcombi/bmat8.hpp" +#include "hpcombi/epu.hpp" namespace HPCombi { namespace { @@ -82,21 +82,21 @@ struct BMat8Fixture { TEST_CASE_METHOD(BMat8Fixture, "BMat8::one", "[BMat8][000]") { CHECK(BMat8::one(0) == zero); CHECK(BMat8::one(2) == BMat8({{1, 0, 0, 0, 0, 0, 0, 0}, - {0, 1, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0}})); + {0, 1, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}})); CHECK(BMat8::one(5) == BMat8({{1, 0, 0, 0, 0, 0, 0, 0}, - {0, 1, 0, 0, 0, 0, 0, 0}, - {0, 0, 1, 0, 0, 0, 0, 0}, - {0, 0, 0, 1, 0, 0, 0, 0}, - {0, 0, 0, 0, 1, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 0}})); + {0, 1, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 0, 0}, + {0, 0, 0, 1, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0}})); CHECK(BMat8::one(8) == BMat8::one()); } @@ -176,13 +176,13 @@ TEST_CASE_METHOD(BMat8Fixture, "BMat8::operator<<", "[BMat8][008]") { std::ostringstream oss; oss << bm3; CHECK(oss.str() == "00010011\n" - "11111101\n" - "01111101\n" - "11011111\n" - "00100111\n" - "11000001\n" - "01000011\n" - "01111010\n"); + "11111101\n" + "01111101\n" + "11011111\n" + "00100111\n" + "11000001\n" + "01000011\n" + "01111010\n"); std::stringbuf buff; std::ostream os(&buff); @@ -343,12 +343,12 @@ TEST_CASE_METHOD(BMat8Fixture, "BMat8::row_space_size", "[BMat8][012]") { TEST_AGREES(BMat8Fixture, row_space_size_ref, row_space_size, BMlist, "[BMat8][013]"); -TEST_AGREES(BMat8Fixture, row_space_size_ref, row_space_size_incl, - BMlist, "[BMat8][014]"); -TEST_AGREES(BMat8Fixture, row_space_size_ref, row_space_size_incl1, - BMlist, "[BMat8][015]"); -TEST_AGREES(BMat8Fixture, row_space_size_ref, row_space_size_bitset, - BMlist, "[BMat8][016]"); +TEST_AGREES(BMat8Fixture, row_space_size_ref, row_space_size_incl, BMlist, + "[BMat8][014]"); +TEST_AGREES(BMat8Fixture, row_space_size_ref, row_space_size_incl1, BMlist, + "[BMat8][015]"); +TEST_AGREES(BMat8Fixture, row_space_size_ref, row_space_size_bitset, BMlist, + "[BMat8][016]"); TEST_CASE_METHOD(BMat8Fixture, "BMat8::row_space_included", "[BMat8][017]") { CHECK(zero.row_space_included(one1)); @@ -370,8 +370,8 @@ TEST_CASE_METHOD(BMat8Fixture, "BMat8::row_space_included", "[BMat8][017]") { CHECK(m3.row_space_included(BMat8::one())); } -TEST_AGREES2(BMat8Fixture, row_space_included, row_space_included_ref, - BMlist, "[BMat8][018]"); +TEST_AGREES2(BMat8Fixture, row_space_included, row_space_included_ref, BMlist, + "[BMat8][018]"); TEST_AGREES2(BMat8Fixture, row_space_included, row_space_included_bitset, BMlist, "[BMat8][019]"); @@ -401,109 +401,109 @@ TEST_CASE_METHOD(BMat8Fixture, "BMat8::row_space_included2", "[BMat8][020]") { TEST_CASE_METHOD(BMat8Fixture, "BMat8::row_permuted", "[BMat8][021]") { CHECK(bm2.row_permuted(Perm16({1, 0})) == BMat8({{0, 1}, {1, 1}})); CHECK(bm2.row_permuted(Perm16({2, 1, 0})) == - BMat8({{0, 0, 0}, {0, 1, 0}, {1, 1, 0}})); + BMat8({{0, 0, 0}, {0, 1, 0}, {1, 1, 0}})); CHECK(bm.row_permuted(Perm16({5, 3, 1, 4, 2, 0})) == - BMat8({{1, 1, 0, 0, 0, 0, 0, 1}, - {1, 1, 0, 1, 1, 1, 1, 1}, - {1, 1, 1, 1, 1, 1, 0, 1}, - {0, 0, 1, 0, 0, 1, 1, 1}, - {0, 1, 1, 1, 0, 1, 0, 1}, - {0, 0, 0, 1, 0, 0, 1, 1}, - {0, 1, 0, 0, 0, 0, 1, 1}, - {0, 1, 1, 1, 1, 0, 1, 0}})); + BMat8({{1, 1, 0, 0, 0, 0, 0, 1}, + {1, 1, 0, 1, 1, 1, 1, 1}, + {1, 1, 1, 1, 1, 1, 0, 1}, + {0, 0, 1, 0, 0, 1, 1, 1}, + {0, 1, 1, 1, 0, 1, 0, 1}, + {0, 0, 0, 1, 0, 0, 1, 1}, + {0, 1, 0, 0, 0, 0, 1, 1}, + {0, 1, 1, 1, 1, 0, 1, 0}})); CHECK(BMat8::one().row_permuted(Perm16({5, 3, 1, 4, 2, 0})) == - BMat8({{0, 0, 0, 0, 0, 1, 0, 0}, - {0, 0, 0, 1, 0, 0, 0, 0}, - {0, 1, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 1, 0, 0, 0}, - {0, 0, 1, 0, 0, 0, 0, 0}, - {1, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 1, 0}, - {0, 0, 0, 0, 0, 0, 0, 1}})); + BMat8({{0, 0, 0, 0, 0, 1, 0, 0}, + {0, 0, 0, 1, 0, 0, 0, 0}, + {0, 1, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 0, 0}, + {1, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 1, 0}, + {0, 0, 0, 0, 0, 0, 0, 1}})); } TEST_CASE_METHOD(BMat8Fixture, "BMat8::col_permuted", "[BMat8][022]") { CHECK(bm2.col_permuted(Perm16({1, 0})) == BMat8({{1, 1}, {1, 0}})); CHECK(bm2.col_permuted(Perm16({2, 1, 0})) == - BMat8({{0, 1, 1}, {0, 1, 0}, {0, 0, 0}})); + BMat8({{0, 1, 1}, {0, 1, 0}, {0, 0, 0}})); CHECK(bm.col_permuted(Perm16({5, 3, 1, 4, 2, 0})) == - BMat8({{0, 1, 0, 0, 0, 0, 1, 1}, - {1, 1, 1, 1, 1, 1, 0, 1}, - {1, 1, 1, 0, 1, 0, 0, 1}, - {1, 1, 1, 1, 0, 1, 1, 1}, - {1, 0, 0, 0, 1, 0, 1, 1}, - {0, 0, 1, 0, 0, 1, 0, 1}, - {0, 0, 1, 0, 0, 0, 1, 1}, - {0, 1, 1, 1, 1, 0, 1, 0}})); + BMat8({{0, 1, 0, 0, 0, 0, 1, 1}, + {1, 1, 1, 1, 1, 1, 0, 1}, + {1, 1, 1, 0, 1, 0, 0, 1}, + {1, 1, 1, 1, 0, 1, 1, 1}, + {1, 0, 0, 0, 1, 0, 1, 1}, + {0, 0, 1, 0, 0, 1, 0, 1}, + {0, 0, 1, 0, 0, 0, 1, 1}, + {0, 1, 1, 1, 1, 0, 1, 0}})); CHECK(BMat8::one().col_permuted(Perm16({4, 1, 3, 0, 2, 6, 5})) == - BMat8({{0, 0, 0, 1, 0, 0, 0, 0}, - {0, 1, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 1, 0, 0, 0}, - {0, 0, 1, 0, 0, 0, 0, 0}, - {1, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 1, 0}, - {0, 0, 0, 0, 0, 1, 0, 0}, - {0, 0, 0, 0, 0, 0, 0, 1}})); + BMat8({{0, 0, 0, 1, 0, 0, 0, 0}, + {0, 1, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 0, 0}, + {1, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 1, 0}, + {0, 0, 0, 0, 0, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 1}})); } TEST_CASE("BMat8::row_permutation_matrix", "[BMat8][023]") { CHECK(BMat8::row_permutation_matrix(Perm16({1, 0})) == - BMat8({{0, 1, 0, 0, 0, 0, 0, 0}, - {1, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 1, 0, 0, 0, 0, 0}, - {0, 0, 0, 1, 0, 0, 0, 0}, - {0, 0, 0, 0, 1, 0, 0, 0}, - {0, 0, 0, 0, 0, 1, 0, 0}, - {0, 0, 0, 0, 0, 0, 1, 0}, - {0, 0, 0, 0, 0, 0, 0, 1}})); + BMat8({{0, 1, 0, 0, 0, 0, 0, 0}, + {1, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 0, 0}, + {0, 0, 0, 1, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 0, 0, 0}, + {0, 0, 0, 0, 0, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 1, 0}, + {0, 0, 0, 0, 0, 0, 0, 1}})); CHECK(BMat8::row_permutation_matrix(Perm16({1, 3, 4, 0, 2})) == - BMat8({{0, 1, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 1, 0, 0, 0, 0}, - {0, 0, 0, 0, 1, 0, 0, 0}, - {1, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 1, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 1, 0, 0}, - {0, 0, 0, 0, 0, 0, 1, 0}, - {0, 0, 0, 0, 0, 0, 0, 1}})); + BMat8({{0, 1, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 1, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 0, 0, 0}, + {1, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 1, 0}, + {0, 0, 0, 0, 0, 0, 0, 1}})); CHECK(BMat8::row_permutation_matrix(Perm16({5, 3, 1, 4, 2, 0})) == - BMat8({{0, 0, 0, 0, 0, 1, 0, 0}, - {0, 0, 0, 1, 0, 0, 0, 0}, - {0, 1, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 1, 0, 0, 0}, - {0, 0, 1, 0, 0, 0, 0, 0}, - {1, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 1, 0}, - {0, 0, 0, 0, 0, 0, 0, 1}})); + BMat8({{0, 0, 0, 0, 0, 1, 0, 0}, + {0, 0, 0, 1, 0, 0, 0, 0}, + {0, 1, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 0, 0}, + {1, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 1, 0}, + {0, 0, 0, 0, 0, 0, 0, 1}})); } TEST_CASE("BMat8::col_permutation_matrix", "[BMat8][024]") { CHECK(BMat8::col_permutation_matrix(Perm16({1, 0})) == - BMat8({{0, 1, 0, 0, 0, 0, 0, 0}, - {1, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 1, 0, 0, 0, 0, 0}, - {0, 0, 0, 1, 0, 0, 0, 0}, - {0, 0, 0, 0, 1, 0, 0, 0}, - {0, 0, 0, 0, 0, 1, 0, 0}, - {0, 0, 0, 0, 0, 0, 1, 0}, - {0, 0, 0, 0, 0, 0, 0, 1}})); + BMat8({{0, 1, 0, 0, 0, 0, 0, 0}, + {1, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 0, 0}, + {0, 0, 0, 1, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 0, 0, 0}, + {0, 0, 0, 0, 0, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 1, 0}, + {0, 0, 0, 0, 0, 0, 0, 1}})); CHECK(BMat8::col_permutation_matrix(Perm16({1, 3, 4, 0, 2})) == - BMat8({{0, 0, 0, 1, 0, 0, 0, 0}, - {1, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 1, 0, 0, 0}, - {0, 1, 0, 0, 0, 0, 0, 0}, - {0, 0, 1, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 1, 0, 0}, - {0, 0, 0, 0, 0, 0, 1, 0}, - {0, 0, 0, 0, 0, 0, 0, 1}})); + BMat8({{0, 0, 0, 1, 0, 0, 0, 0}, + {1, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 0, 0, 0}, + {0, 1, 0, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 1, 0, 0}, + {0, 0, 0, 0, 0, 0, 1, 0}, + {0, 0, 0, 0, 0, 0, 0, 1}})); CHECK(BMat8::col_permutation_matrix(Perm16({5, 3, 1, 4, 2, 0})) == - BMat8({{0, 0, 0, 0, 0, 1, 0, 0}, - {0, 0, 1, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 1, 0, 0, 0}, - {0, 1, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 1, 0, 0, 0, 0}, - {1, 0, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, 1, 0}, - {0, 0, 0, 0, 0, 0, 0, 1}})); + BMat8({{0, 0, 0, 0, 0, 1, 0, 0}, + {0, 0, 1, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 0, 0, 0}, + {0, 1, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 1, 0, 0, 0, 0}, + {1, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 1, 0}, + {0, 0, 0, 0, 0, 0, 0, 1}})); } TEST_CASE_METHOD(BMat8Fixture, "BMat8::nr_rows", "[BMat8][025]") { diff --git a/tests/test_epu.cpp b/tests/test_epu.cpp index 7d6941c3..bd07da37 100644 --- a/tests/test_epu.cpp +++ b/tests/test_epu.cpp @@ -16,11 +16,11 @@ #include #include -#include "epu.hpp" - #include "test_main.hpp" #include +#include "hpcombi/epu.hpp" + namespace HPCombi { struct Fix { @@ -204,16 +204,16 @@ TEST_CASE_METHOD(Fix, "Epu8::permuted", "[Epu8][011]") { TEST_CASE_METHOD(Fix, "Epu8::shifted_left", "[Epu8][012]") { CHECK_THAT(shifted_left(P01), Equals(P10)); CHECK_THAT(shifted_left(P112), - Equals(epu8{1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0})); - CHECK_THAT(shifted_left(Pv), Equals(epu8{5, 2, 5, 1, 6, 12, 4, 0, 3, 2, - 11, 12, 13, 14, 15, 0})); + Equals(epu8{1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0})); + CHECK_THAT(shifted_left(Pv), Equals(epu8{5, 2, 5, 1, 6, 12, 4, 0, 3, 2, 11, + 12, 13, 14, 15, 0})); } TEST_CASE_METHOD(Fix, "Epu8::shifted_right", "[Epu8][013]") { CHECK_THAT(shifted_right(P10), Equals(P01)); CHECK_THAT(shifted_right(P112), Equals(Epu8({0, 1, 1}, 2))); - CHECK_THAT(shifted_right(Pv), Equals(epu8{0, 5, 5, 2, 5, 1, 6, 12, 4, 0, - 3, 2, 11, 12, 13, 14})); + CHECK_THAT(shifted_right(Pv), Equals(epu8{0, 5, 5, 2, 5, 1, 6, 12, 4, 0, 3, + 2, 11, 12, 13, 14})); } TEST_CASE_METHOD(Fix, "Epu8::reverted", "[Epu8][014]") { @@ -303,9 +303,9 @@ TEST_CASE_METHOD(Fix, "Epu8::revsorted", "[Epu8][019]") { TEST_CASE_METHOD(Fix, "Epu8::sort_perm", "[Epu8][020]") { epu8 ve{2, 1, 3, 2, 4, 1, 1, 4, 2, 0, 1, 2, 1, 3, 4, 0}; CHECK_THAT(sort_perm(ve), Equals(epu8{9, 15, 1, 5, 6, 10, 12, 3, 0, 8, 11, - 2, 13, 7, 4, 14})); + 2, 13, 7, 4, 14})); CHECK_THAT(ve, - Equals(epu8{0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 4})); + Equals(epu8{0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 4})); for (auto x : v) { epu8 xsort = x; @@ -319,9 +319,9 @@ TEST_CASE_METHOD(Fix, "Epu8::sort_perm", "[Epu8][020]") { TEST_CASE_METHOD(Fix, "Epu8::sort8_perm", "[Epu8][021]") { epu8 ve{2, 1, 3, 2, 4, 1, 1, 4, 2, 0, 1, 2, 1, 3, 4, 0}; CHECK_THAT(sort8_perm(ve), Equals(epu8{1, 6, 5, 0, 3, 2, 4, 7, 9, 15, 10, - 12, 8, 11, 13, 14})); + 12, 8, 11, 13, 14})); CHECK_THAT(ve, - Equals(epu8{1, 1, 1, 2, 2, 3, 4, 4, 0, 0, 1, 1, 2, 2, 3, 4})); + Equals(epu8{1, 1, 1, 2, 2, 3, 4, 4, 0, 0, 1, 1, 2, 2, 3, 4})); for (auto x : v) { epu8 xsort = x; @@ -342,9 +342,9 @@ TEST_CASE_METHOD(Fix, "Epu8::permutation_of", "[Epu8][022]") { CHECK_THAT(permutation_of(epu8id, RP), Equals(RP)); const uint8_t FF = 0xff; CHECK_THAT((permutation_of(Pv, Pv) | - epu8{FF, FF, FF, FF, 0, 0, FF, 0, 0, 0, FF, 0, FF, 0, 0, 0}), - Equals(epu8{FF, FF, FF, FF, 4, 5, FF, 7, 8, 9, FF, 11, FF, 13, - 14, 15})); + epu8{FF, FF, FF, FF, 0, 0, FF, 0, 0, 0, FF, 0, FF, 0, 0, 0}), + Equals(epu8{FF, FF, FF, FF, 4, 5, FF, 7, 8, 9, FF, 11, FF, 13, + 14, 15})); } TEST_CASE_METHOD(Fix, "Epu8::permutation_of_ref", "[Epu8][022]") { CHECK_THAT(permutation_of_ref(epu8id, epu8id), Equals(epu8id)); @@ -355,19 +355,18 @@ TEST_CASE_METHOD(Fix, "Epu8::permutation_of_ref", "[Epu8][022]") { CHECK_THAT(permutation_of_ref(epu8id, RP), Equals(RP)); const uint8_t FF = 0xff; CHECK_THAT((permutation_of_ref(Pv, Pv) | - epu8{FF, FF, FF, FF, 0, 0, FF, 0, 0, 0, FF, 0, FF, 0, 0, 0}), - Equals(epu8{FF, FF, FF, FF, 4, 5, FF, 7, 8, 9, FF, 11, FF, 13, - 14, 15})); + epu8{FF, FF, FF, FF, 0, 0, FF, 0, 0, 0, FF, 0, FF, 0, 0, 0}), + Equals(epu8{FF, FF, FF, FF, 4, 5, FF, 7, 8, 9, FF, 11, FF, 13, + 14, 15})); } TEST_CASE_METHOD(Fix, "Epu8::remove_dups", "[Epu8][023]") { CHECK_THAT(remove_dups(P1), Equals(P10)); CHECK_THAT(remove_dups(P11), Equals(P10)); CHECK_THAT(remove_dups(sorted(P10)), - Equals(epu8{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1})); - CHECK_THAT( - remove_dups(sorted(Pv)), - Equals(epu8{0, 1, 2, 0, 3, 4, 5, 0, 0, 6, 11, 12, 0, 13, 14, 15})); + Equals(epu8{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1})); + CHECK_THAT(remove_dups(sorted(Pv)), Equals(epu8{0, 1, 2, 0, 3, 4, 5, 0, 0, + 6, 11, 12, 0, 13, 14, 15})); CHECK_THAT(remove_dups(P1, 1), Equals(P1)); CHECK_THAT(remove_dups(P11, 1), Equals(Epu8({1, 1, 0}, 1))); CHECK_THAT(remove_dups(P11, 42), Equals(Epu8({1, 42, 0}, 42))); @@ -411,36 +410,36 @@ TEST_CASE_METHOD(Fix, "Epu8::partial_sums_ref", "[Epu8][029]") { CHECK_THAT(partial_sums_ref(zero), Equals(zero)); CHECK_THAT(partial_sums_ref(P01), Equals(Epu8({0}, 1))); CHECK_THAT(partial_sums_ref(epu8id), - Equals(epu8{0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, - 105, 120})); + Equals(epu8{0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, + 105, 120})); CHECK_THAT(partial_sums_ref(P10), Equals(P1)); CHECK_THAT(partial_sums_ref(P11), Equals(Epu8({1}, 2))); CHECK_THAT(partial_sums_ref(P1), Equals(epu8id + Epu8({}, 1))); CHECK_THAT(partial_sums_ref(P112), - Equals(epu8{1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, - 28, 30})); + Equals(epu8{1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, + 28, 30})); CHECK_THAT(partial_sums_ref(Pa1), - Equals(epu8{4, 6, 11, 12, 14, 21, 28, 31, 35, 37, 38, 39, 40, - 41, 42, 43})); + Equals(epu8{4, 6, 11, 12, 14, 21, 28, 31, 35, 37, 38, 39, 40, 41, + 42, 43})); CHECK_THAT(partial_sums_ref(Pa2), - Equals(epu8{4, 6, 11, 12, 14, 23, 30, 33, 37, 39, 40, 41, 42, - 43, 44, 45})); + Equals(epu8{4, 6, 11, 12, 14, 23, 30, 33, 37, 39, 40, 41, 42, 43, + 44, 45})); CHECK_THAT(partial_sums_ref(P51), - Equals(epu8{5, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, - 78, 84, 90})); + Equals(epu8{5, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78, + 84, 90})); CHECK_THAT(partial_sums_ref(Pv), - Equals(epu8{5, 10, 12, 17, 18, 24, 36, 40, 40, 43, 45, 56, 68, - 81, 95, 110})); + Equals(epu8{5, 10, 12, 17, 18, 24, 36, 40, 40, 43, 45, 56, 68, + 81, 95, 110})); CHECK_THAT(partial_sums_ref(P5), - Equals(epu8{5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, - 70, 75, 80})); + Equals(epu8{5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, + 70, 75, 80})); CHECK_THAT(partial_sums_ref(epu8rev), - Equals(epu8{15, 29, 42, 54, 65, 75, 84, 92, 99, 105, 110, 114, - 117, 119, 120, 120})); + Equals(epu8{15, 29, 42, 54, 65, 75, 84, 92, 99, 105, 110, 114, + 117, 119, 120, 120})); CHECK_THAT(partial_sums_ref(Pc), - Equals(epu8{23, 28, 49, 54, 97, 133, 140, 147, 154, 161, 168, - 175, 182, 189, 196, 203})); + Equals(epu8{23, 28, 49, 54, 97, 133, 140, 147, 154, 161, 168, + 175, 182, 189, 196, 203})); } TEST_AGREES_EPU8_FUN(Fix, partial_sums_ref, partial_sums_gen, v, "[Epu8][030]") TEST_AGREES_EPU8_FUN(Fix, partial_sums_ref, partial_sums_round, v, @@ -481,7 +480,7 @@ TEST_CASE_METHOD(Fix, "Epu8::partial_max_ref", "[Epu8][038]") { CHECK_THAT(partial_max_ref(Pa2), Equals(Epu8({4, 4, 5, 5, 5}, 9))); CHECK_THAT(partial_max_ref(P51), Equals(Epu8({5, 5}, 6))); CHECK_THAT(partial_max_ref(Pv), Equals(epu8{5, 5, 5, 5, 5, 6, 12, 12, 12, - 12, 12, 12, 12, 13, 14, 15})); + 12, 12, 12, 12, 13, 14, 15})); CHECK_THAT(partial_max_ref(P5), Equals(P5)); CHECK_THAT(partial_max_ref(epu8rev), Equals(Epu8({}, 15))); CHECK_THAT(partial_max_ref(Pc), Equals(Epu8({23, 23, 23, 23}, 43))); @@ -544,10 +543,10 @@ TEST_CASE_METHOD(Fix, "Epu8::eval16_ref", "[Epu8][047]") { CHECK_THAT(eval16_ref(P112), Equals(Epu8({0, 2, 14}, 0))); CHECK_THAT(eval16_ref(Pa1), Equals(Epu8({0, 7, 3, 1, 2, 1, 0, 2}, 0))); CHECK_THAT(eval16_ref(Pa2), - Equals(Epu8({0, 7, 3, 1, 2, 1, 0, 1, 0, 1}, 0))); + Equals(Epu8({0, 7, 3, 1, 2, 1, 0, 1, 0, 1}, 0))); CHECK_THAT(eval16_ref(P51), Equals(Epu8({0, 1, 0, 0, 0, 1, 14}, 0))); CHECK_THAT(eval16_ref(Pv), - Equals(epu8{1, 1, 2, 1, 1, 3, 1, 0, 0, 0, 0, 1, 2, 1, 1, 1})); + Equals(epu8{1, 1, 2, 1, 1, 3, 1, 0, 0, 0, 0, 1, 2, 1, 1, 1})); CHECK_THAT(eval16_ref(P5), Equals(Epu8({0, 0, 0, 0, 0, 16}, 0))); CHECK_THAT(eval16_ref(epu8rev), Equals(Epu8({}, 1))); CHECK_THAT(eval16_ref(Pc), Equals(Epu8({0, 0, 0, 0, 0, 2, 0, 10}, 0))); @@ -561,20 +560,20 @@ TEST_AGREES_FUN_EPU8(Fix, eval16_ref, eval16, v, "[Epu8][034]") TEST_CASE("Epu8::popcount4", "[Epu8][048]") { CHECK_THAT(popcount4, - Equals(epu8{0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4})); + Equals(epu8{0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4})); } TEST_CASE_METHOD(Fix, "Epu8::popcount16", "[Epu8][049]") { CHECK_THAT(popcount16(Pv), - Equals(epu8{2, 2, 1, 2, 1, 2, 2, 1, 0, 2, 1, 3, 2, 3, 3, 4})); + Equals(epu8{2, 2, 1, 2, 1, 2, 2, 1, 0, 2, 1, 3, 2, 3, 3, 4})); CHECK_THAT(popcount16(RP), - Equals(epu8{2, 1, 0, 3, 4, 3, 2, 2, 1, 3, 2, 2, 3, 1, 1, 2})); + Equals(epu8{2, 1, 0, 3, 4, 3, 2, 2, 1, 3, 2, 2, 3, 1, 1, 2})); CHECK_THAT(popcount16(RP << 1), - Equals(epu8{2, 1, 0, 3, 4, 3, 2, 2, 1, 3, 2, 2, 3, 1, 1, 2})); + Equals(epu8{2, 1, 0, 3, 4, 3, 2, 2, 1, 3, 2, 2, 3, 1, 1, 2})); CHECK_THAT(popcount16(RP << 2), - Equals(epu8{2, 1, 0, 3, 4, 3, 2, 2, 1, 3, 2, 2, 3, 1, 1, 2})); + Equals(epu8{2, 1, 0, 3, 4, 3, 2, 2, 1, 3, 2, 2, 3, 1, 1, 2})); CHECK_THAT(popcount16(Epu8({0, 1, 5, 0xff, 0xf0, 0x35}, 0x0f)), - Equals(Epu8({0, 1, 2, 8}, 4))); + Equals(Epu8({0, 1, 2, 8}, 4))); } TEST_CASE("random_epu8", "[Epu8][050]") { @@ -608,8 +607,7 @@ TEST_CASE_METHOD(Fix, "is_partial_transformation", "[Epu8][051]") { CHECK(is_partial_transformation(RP, 16)); CHECK(!is_partial_transformation(RP, 15)); CHECK(is_partial_transformation(Epu8({1, 2, 1, 0xFF, 0, 5, 0xFF, 2}, 0))); - CHECK( - !is_partial_transformation(Epu8({1, 2, 1, 0xFF, 0, 16, 0xFF, 2}, 0))); + CHECK(!is_partial_transformation(Epu8({1, 2, 1, 0xFF, 0, 16, 0xFF, 2}, 0))); } TEST_CASE_METHOD(Fix, "is_transformation", "[Epu8][052]") { diff --git a/tests/test_main.hpp b/tests/test_main.hpp index 03bd811f..d2757e34 100644 --- a/tests/test_main.hpp +++ b/tests/test_main.hpp @@ -18,7 +18,8 @@ #include -#include "epu.hpp" +#include "hpcombi/epu.hpp" + #include #include diff --git a/tests/test_perm16.cpp b/tests/test_perm16.cpp index 856b6344..0735eca2 100644 --- a/tests/test_perm16.cpp +++ b/tests/test_perm16.cpp @@ -13,7 +13,7 @@ /* http://www.gnu.org/licenses/ */ /******************************************************************************/ -#include "perm16.hpp" +#include "hpcombi/perm16.hpp" #include "test_main.hpp" #include @@ -76,14 +76,14 @@ TEST_CASE("PTransf16::PTransf16", "[PTransf16][000]") { CHECK(PTransf16({1, 0}) == PTransf16({1, 0, 2})); CHECK(PTransf16({2}) == PTransf16({2, 1, 2})); CHECK(PTransf16({4, 5, 0}, {9, 0, 1}) == - PTransf16( - {1, FF, FF, FF, 9, 0, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF})); + PTransf16( + {1, FF, FF, FF, 9, 0, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF})); CHECK(PTransf16({4, 5, 0, 8}, {9, 0, 1, 2}) == - PTransf16( - {1, FF, FF, FF, 9, 0, FF, FF, 2, FF, FF, FF, FF, FF, FF, FF})); + PTransf16( + {1, FF, FF, FF, 9, 0, FF, FF, 2, FF, FF, FF, FF, FF, FF, FF})); CHECK(PTransf16({4, 5, 0, 8}, {9, 0, 2, 2}) == - PTransf16( - {2, FF, FF, FF, 9, 0, FF, FF, 2, FF, FF, FF, FF, FF, FF, FF})); + PTransf16( + {2, FF, FF, FF, 9, 0, FF, FF, 2, FF, FF, FF, FF, FF, FF, FF})); } TEST_CASE("PTransf16::hash", "[PTransf16][001]") { @@ -97,11 +97,11 @@ TEST_CASE("PTransf16::image_mask", "[PTransf16][002]") { CHECK_THAT(PTransf16({}).image_mask(false), Equals(Epu8(FF))); CHECK_THAT(PTransf16({}).image_mask(true), Equals(Epu8(0))); CHECK_THAT(PTransf16({4, 4, 4, 4}).image_mask(), - Equals(Epu8({0, 0, 0, 0}, FF))); + Equals(Epu8({0, 0, 0, 0}, FF))); CHECK_THAT(PTransf16({4, 4, 4, 4}).image_mask(false), - Equals(Epu8({0, 0, 0, 0}, FF))); + Equals(Epu8({0, 0, 0, 0}, FF))); CHECK_THAT(PTransf16({4, 4, 4, 4}).image_mask(true), - Equals(Epu8({FF, FF, FF, FF}, 0))); + Equals(Epu8({FF, FF, FF, FF}, 0))); CHECK_THAT(PTransf16(Epu8(1)).image_mask(), Equals(Epu8({0, FF}, 0))); CHECK_THAT(PTransf16(Epu8(2)).image_mask(), Equals(Epu8({0, 0, FF}, 0))); CHECK_THAT( @@ -124,14 +124,14 @@ TEST_CASE("PTransf16::image_mask_ref_ref", "[PTransf16][002]") { CHECK_THAT(PTransf16({}).image_mask_ref(false), Equals(Epu8(FF))); CHECK_THAT(PTransf16({}).image_mask_ref(true), Equals(Epu8(0))); CHECK_THAT(PTransf16({4, 4, 4, 4}).image_mask_ref(), - Equals(Epu8({0, 0, 0, 0}, FF))); + Equals(Epu8({0, 0, 0, 0}, FF))); CHECK_THAT(PTransf16({4, 4, 4, 4}).image_mask_ref(false), - Equals(Epu8({0, 0, 0, 0}, FF))); + Equals(Epu8({0, 0, 0, 0}, FF))); CHECK_THAT(PTransf16({4, 4, 4, 4}).image_mask_ref(true), - Equals(Epu8({FF, FF, FF, FF}, 0))); + Equals(Epu8({FF, FF, FF, FF}, 0))); CHECK_THAT(PTransf16(Epu8(1)).image_mask_ref(), Equals(Epu8({0, FF}, 0))); CHECK_THAT(PTransf16(Epu8(2)).image_mask_ref(), - Equals(Epu8({0, 0, FF}, 0))); + Equals(Epu8({0, 0, FF}, 0))); CHECK_THAT( PTransf16(Epu8({2, 2, 2, 0xf}, 2)).image_mask_ref(), Equals(Epu8({0, 0, FF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, FF}, 0))); @@ -155,17 +155,17 @@ TEST_CASE("PTransf16::left_one", "[PTransf16][003]") { CHECK(PTransf16(Epu8(1)).left_one() == PTransf16(Epu8({FF, 1}, FF))); CHECK(PTransf16(Epu8(2)).left_one() == PTransf16(Epu8({FF, FF, 2}, FF))); CHECK(PTransf16(Epu8({2, 2, 2, 0xf}, 2)).left_one() == - PTransf16({FF, FF, 2, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, - FF, 15})); + PTransf16( + {FF, FF, 2, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, 15})); CHECK(PTransf16(Epu8({FF, 2, 2, 0xf}, FF)).left_one() == - PTransf16({FF, FF, 2, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, - FF, 15})); + PTransf16( + {FF, FF, 2, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, 15})); CHECK(PTransf16(Epu8({0, 2, 2, 0xf, 2, 2, 2, 2, 5, 2}, 2)).left_one() == - PTransf16( - {0, FF, 2, FF, FF, 5, FF, FF, FF, FF, FF, FF, FF, FF, FF, 15})); + PTransf16( + {0, FF, 2, FF, FF, 5, FF, FF, FF, FF, FF, FF, FF, FF, FF, 15})); CHECK(PTransf16(Epu8({0, 2, FF, 0xf, 2, FF, 2, FF, 5}, FF)).left_one() == - PTransf16( - {0, FF, 2, FF, FF, 5, FF, FF, FF, FF, FF, FF, FF, FF, FF, 15})); + PTransf16( + {0, FF, 2, FF, FF, 5, FF, FF, FF, FF, FF, FF, FF, FF, FF, 15})); } TEST_CASE("PTransf16::domain_mask", "[PTransf16][004]") { @@ -176,15 +176,15 @@ TEST_CASE("PTransf16::domain_mask", "[PTransf16][004]") { CHECK_THAT(PTransf16(Epu8(1)).domain_mask(), Equals(Epu8(FF))); CHECK_THAT(PTransf16(Epu8(2)).domain_mask(), Equals(Epu8(FF))); CHECK_THAT(PTransf16(Epu8({2, 2, 2, 0xf}, FF)).domain_mask(), - Equals(Epu8({FF, FF, FF, FF}, 0))); + Equals(Epu8({FF, FF, FF, FF}, 0))); CHECK_THAT(PTransf16(Epu8({FF, 2, 2, 0xf}, FF)).domain_mask(), - Equals(Epu8({0, FF, FF, FF}, 0))); + Equals(Epu8({0, FF, FF, FF}, 0))); CHECK_THAT( PTransf16(Epu8({0, 2, FF, 0xf, 2, FF, 2, FF, 5}, FF)).domain_mask(), Equals(Epu8({FF, FF, 0, FF, FF, 0, FF, 0, FF}, 0))); CHECK_THAT(PTransf16(Epu8({0, 2, FF, 0xf, 2, FF, 2, FF, 5}, FF)) - .domain_mask(false), - Equals(Epu8({FF, FF, 0, FF, FF, 0, FF, 0, FF}, 0))); + .domain_mask(false), + Equals(Epu8({FF, FF, 0, FF, FF, 0, FF, 0, FF}, 0))); CHECK_THAT( PTransf16(Epu8({0, 2, FF, 0xf, 2, FF, 2, FF, 5}, FF)).domain_mask(true), Equals(Epu8({0, 0, FF, 0, 0, FF, 0, FF, 0}, FF))); @@ -196,12 +196,12 @@ TEST_CASE("PTransf16::right_one", "[PTransf16][005]") { CHECK(PTransf16(Epu8(1)).right_one() == PTransf16::one()); CHECK(PTransf16(Epu8(2)).right_one() == PTransf16::one()); CHECK(PTransf16(Epu8({2, 2, 2, 0xf}, FF)).right_one() == - PTransf16(Epu8({0, 1, 2, 3}, FF))); + PTransf16(Epu8({0, 1, 2, 3}, FF))); CHECK(PTransf16(Epu8({FF, 2, 2, 0xf}, FF)).right_one() == - PTransf16( - {FF, 1, 2, 3, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF})); + PTransf16( + {FF, 1, 2, 3, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF, FF})); CHECK(PTransf16(Epu8({0, 2, 2, 0xf, 2, 2, 2, 2, 5, 2}, 2)).right_one() == - PTransf16::one()); + PTransf16::one()); CHECK( PTransf16(Epu8({0, 2, FF, 0xf, 2, FF, 2, FF, 5}, FF)).right_one() == PTransf16({0, 1, FF, 3, 4, FF, 6, FF, 8, FF, FF, FF, FF, FF, FF, FF})); @@ -211,33 +211,31 @@ TEST_CASE("PTransf16::rank_ref", "[PTransf16][006]") { CHECK(PTransf16({}).rank_ref() == 16); CHECK(PTransf16({4, 4, 4, 4}).rank_ref() == 12); CHECK(PTransf16({1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) - .rank_ref() == 1); + .rank_ref() == 1); CHECK(PTransf16({2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}) - .rank_ref() == 1); + .rank_ref() == 1); CHECK(PTransf16({2, 2, 2, 0xf, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}) - .rank_ref() == 2); + .rank_ref() == 2); CHECK(PTransf16({0, 2, 2, 0xf, 2, 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, 2}) - .rank_ref() == 4); + .rank_ref() == 4); CHECK(PTransf16({1, 1, 1, FF, 1, 1, FF, 1, 1, FF, 1, FF, 1, 1, 1, 1}) - .rank_ref() == 1); + .rank_ref() == 1); CHECK(PTransf16({2, 2, 2, 2, 2, FF, 2, 2, 2, FF, 2, 2, 2, FF, 2, 2}) - .rank_ref() == 1); + .rank_ref() == 1); CHECK(PTransf16({2, 2, 2, 0xf, 2, FF, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}) - .rank_ref() == 2); + .rank_ref() == 2); CHECK(PTransf16({0, 2, 2, 0xf, 2, 2, FF, 2, 5, 2, FF, 2, 2, 2, 2, 2}) - .rank_ref() == 4); + .rank_ref() == 4); } // TODO uncomment TEST_CASE("PTransf16::rank", "[PTransf16][007]") { CHECK(PTransf16({}).rank() == 16); CHECK(PTransf16({4, 4, 4, 4}).rank() == 12); - CHECK( - PTransf16({1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}).rank() == - 1); - CHECK( - PTransf16({2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}).rank() == - 1); + CHECK(PTransf16({1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}).rank() == + 1); + CHECK(PTransf16({2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}).rank() == + 1); CHECK( PTransf16({2, 2, 2, 0xf, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}).rank() == 2); @@ -251,15 +249,14 @@ TEST_CASE("PTransf16::fix_points_mask", "[PTransf16][008]") { CHECK_THAT(PTransf16({}).fix_points_mask(false), Equals(Epu8(FF))); CHECK_THAT(PTransf16({}).fix_points_mask(true), Equals(Epu8(0))); CHECK_THAT(PTransf16({4, 4, 4, 4}).fix_points_mask(), - Equals(Epu8({0, 0, 0, 0}, FF))); + Equals(Epu8({0, 0, 0, 0}, FF))); CHECK_THAT(PTransf16({4, 4, 4, 4}).fix_points_mask(false), - Equals(Epu8({0, 0, 0, 0}, FF))); + Equals(Epu8({0, 0, 0, 0}, FF))); CHECK_THAT(PTransf16({4, 4, 4, 4}).fix_points_mask(true), - Equals(Epu8({FF, FF, FF, FF}, 0))); - CHECK_THAT(PTransf16(Epu8(1)).fix_points_mask(), - Equals(Epu8({0, FF}, 0))); + Equals(Epu8({FF, FF, FF, FF}, 0))); + CHECK_THAT(PTransf16(Epu8(1)).fix_points_mask(), Equals(Epu8({0, FF}, 0))); CHECK_THAT(PTransf16(Epu8(2)).fix_points_mask(), - Equals(Epu8({0, 0, FF}, 0))); + Equals(Epu8({0, 0, FF}, 0))); CHECK_THAT( PTransf16(Epu8({2, 2, 2, 0xf}, 7)).fix_points_mask(), Equals(Epu8({0, 0, FF, 0, 0, 0, 0, FF, 0, 0, 0, 0, 0, 0, 0, 0}, 0))); @@ -271,8 +268,8 @@ TEST_CASE("PTransf16::fix_points_mask", "[PTransf16][008]") { .fix_points_mask(false), Equals(Epu8({FF, 0, FF, 0, 0, 0, 0, 0, FF, 0, 0, 0, 0, 0, FF, 0}, 0))); CHECK_THAT(PTransf16(Epu8({0, 2, 2, 0xf, 2, 2, 2, 2, 5, 2}, 2)) - .fix_points_mask(true), - Equals(Epu8({0, FF, 0}, FF))); + .fix_points_mask(true), + Equals(Epu8({0, FF, 0}, FF))); } TEST_CASE("PTransf16::fix_points_bitset", "[PTransf16][009]") { @@ -286,11 +283,11 @@ TEST_CASE("PTransf16::fix_points_bitset", "[PTransf16][009]") { CHECK(PTransf16(Epu8(2)).fix_points_bitset() == 0x0004); CHECK(PTransf16(Epu8({2, 2, 2, 0xf}, 7)).fix_points_bitset() == 0x0084); CHECK(PTransf16(Epu8({0, 2, 2, 0xf, 2, 2, 2, 14, 5, 2}, 2)) - .fix_points_bitset() == 0x5); + .fix_points_bitset() == 0x5); CHECK(PTransf16(Epu8({0, 2, 2, 0xf, 2, 2, 2, 2, 8, 2}, 14)) - .fix_points_bitset(false) == 0x4105); + .fix_points_bitset(false) == 0x4105); CHECK(PTransf16(Epu8({0, 2, 2, 0xf, 2, 2, 2, 2, 5, 2}, 2)) - .fix_points_bitset(true) == 0xFFFA); + .fix_points_bitset(true) == 0xFFFA); } TEST_CASE("PTransf16::nb_fix_points", "[PTransf16][010]") { @@ -396,9 +393,8 @@ TEST_CASE_METHOD(Perm16Fixture, "Perm16::fix_points_mask", "[PPerm16][022]") { CHECK_THAT(PTransf16::one().fix_points_mask(), Equals(Epu8(FF))); CHECK_THAT(Perm16::one().fix_points_mask(), Equals(Epu8(FF))); CHECK_THAT(PPa.fix_points_mask(), Equals(Epu8({0, 0, 0, 0, 0}, FF))); - CHECK_THAT( - PPb.fix_points_mask(), - Equals(epu8{0, 0, 0, 0, 0, FF, 0, FF, FF, FF, FF, FF, FF, 0, FF, 0})); + CHECK_THAT(PPb.fix_points_mask(), Equals(epu8{0, 0, 0, 0, 0, FF, 0, FF, FF, + FF, FF, FF, FF, 0, FF, 0})); CHECK_THAT(RandPerm.fix_points_mask(), Equals(Epu8({0, FF}, 0))); CHECK_THAT(Perm16::one().fix_points_mask(false), Equals(Epu8(FF))); @@ -410,7 +406,7 @@ TEST_CASE_METHOD(Perm16Fixture, "Perm16::fix_points_mask", "[PPerm16][022]") { CHECK_THAT(Perm16::one().fix_points_mask(true), Equals(Epu8(0))); CHECK_THAT(PPa.fix_points_mask(true), - Equals(Epu8({FF, FF, FF, FF, FF}, 0))); + Equals(Epu8({FF, FF, FF, FF, FF}, 0))); CHECK_THAT( PPb.fix_points_mask(true), Equals(epu8{FF, FF, FF, FF, FF, 0, FF, 0, 0, 0, 0, 0, 0, FF, 0, FF})); @@ -478,9 +474,9 @@ TEST_AGREES(Perm16Fixture, inverse_ref, inverse, Plist, "[Perm16][031]"); TEST_CASE_METHOD(Perm16Fixture, "Perm16::lehmer_ref", "[Perm16][032]") { CHECK_THAT(Perm16::one().lehmer(), Equals(zero)); CHECK_THAT(PPa.lehmer(), - Equals(epu8{1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})); + Equals(epu8{1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})); CHECK_THAT(PPb.lehmer(), - Equals(epu8{1, 1, 1, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0})); + Equals(epu8{1, 1, 1, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0})); } TEST_AGREES_EPU8(Perm16Fixture, lehmer_ref, lehmer_arr, Plist, "[Perm16][033]"); diff --git a/tests/test_perm_all.cpp b/tests/test_perm_all.cpp index 3264ed4b..eb87ec05 100644 --- a/tests/test_perm_all.cpp +++ b/tests/test_perm_all.cpp @@ -18,8 +18,8 @@ #include #include -#include "perm16.hpp" -#include "perm_generic.hpp" +#include "hpcombi/perm16.hpp" +#include "hpcombi/perm_generic.hpp" #include "test_main.hpp" #include diff --git a/include/simde/arm/neon.h b/third_party/simde/arm/neon.h similarity index 100% rename from include/simde/arm/neon.h rename to third_party/simde/arm/neon.h diff --git a/include/simde/arm/sve.h b/third_party/simde/arm/sve.h similarity index 100% rename from include/simde/arm/sve.h rename to third_party/simde/arm/sve.h diff --git a/include/simde/mips/msa.h b/third_party/simde/mips/msa.h similarity index 100% rename from include/simde/mips/msa.h rename to third_party/simde/mips/msa.h diff --git a/include/simde/wasm/relaxed-simd.h b/third_party/simde/wasm/relaxed-simd.h similarity index 100% rename from include/simde/wasm/relaxed-simd.h rename to third_party/simde/wasm/relaxed-simd.h diff --git a/include/simde/wasm/simd128.h b/third_party/simde/wasm/simd128.h similarity index 100% rename from include/simde/wasm/simd128.h rename to third_party/simde/wasm/simd128.h diff --git a/include/simde/x86/avx.h b/third_party/simde/x86/avx.h similarity index 100% rename from include/simde/x86/avx.h rename to third_party/simde/x86/avx.h diff --git a/include/simde/x86/avx2.h b/third_party/simde/x86/avx2.h similarity index 100% rename from include/simde/x86/avx2.h rename to third_party/simde/x86/avx2.h diff --git a/include/simde/x86/avx512.h b/third_party/simde/x86/avx512.h similarity index 100% rename from include/simde/x86/avx512.h rename to third_party/simde/x86/avx512.h diff --git a/include/simde/x86/clmul.h b/third_party/simde/x86/clmul.h similarity index 100% rename from include/simde/x86/clmul.h rename to third_party/simde/x86/clmul.h diff --git a/include/simde/x86/f16c.h b/third_party/simde/x86/f16c.h similarity index 100% rename from include/simde/x86/f16c.h rename to third_party/simde/x86/f16c.h diff --git a/include/simde/x86/fma.h b/third_party/simde/x86/fma.h similarity index 100% rename from include/simde/x86/fma.h rename to third_party/simde/x86/fma.h diff --git a/include/simde/x86/gfni.h b/third_party/simde/x86/gfni.h similarity index 100% rename from include/simde/x86/gfni.h rename to third_party/simde/x86/gfni.h diff --git a/include/simde/x86/mmx.h b/third_party/simde/x86/mmx.h similarity index 100% rename from include/simde/x86/mmx.h rename to third_party/simde/x86/mmx.h diff --git a/include/simde/x86/sse.h b/third_party/simde/x86/sse.h similarity index 100% rename from include/simde/x86/sse.h rename to third_party/simde/x86/sse.h diff --git a/include/simde/x86/sse2.h b/third_party/simde/x86/sse2.h similarity index 100% rename from include/simde/x86/sse2.h rename to third_party/simde/x86/sse2.h diff --git a/include/simde/x86/sse3.h b/third_party/simde/x86/sse3.h similarity index 100% rename from include/simde/x86/sse3.h rename to third_party/simde/x86/sse3.h diff --git a/include/simde/x86/sse4.1.h b/third_party/simde/x86/sse4.1.h similarity index 100% rename from include/simde/x86/sse4.1.h rename to third_party/simde/x86/sse4.1.h diff --git a/include/simde/x86/sse4.2.h b/third_party/simde/x86/sse4.2.h similarity index 100% rename from include/simde/x86/sse4.2.h rename to third_party/simde/x86/sse4.2.h diff --git a/include/simde/x86/ssse3.h b/third_party/simde/x86/ssse3.h similarity index 100% rename from include/simde/x86/ssse3.h rename to third_party/simde/x86/ssse3.h diff --git a/include/simde/x86/svml.h b/third_party/simde/x86/svml.h similarity index 100% rename from include/simde/x86/svml.h rename to third_party/simde/x86/svml.h diff --git a/include/simde/x86/xop.h b/third_party/simde/x86/xop.h similarity index 100% rename from include/simde/x86/xop.h rename to third_party/simde/x86/xop.h