Browse Source

feat: add const `ALL_CASES_SIZE_SUM`

legacy
Dnomd343 2 years ago
parent
commit
6df91e4d11
  1. 4
      src/klotski/all_cases/all_cases.h
  2. 4
      src/klotski/ffi/tmain.cc
  3. 2
      test/all_cases.cc

4
src/klotski/all_cases/all_cases.h

@ -27,6 +27,7 @@
#include <mutex> #include <mutex>
#include <vector> #include <vector>
#include <cstdint> #include <cstdint>
#include <numeric>
#include "basic_ranges.h" #include "basic_ranges.h"
namespace klotski { namespace klotski {
@ -37,6 +38,9 @@ namespace klotski {
2322050, 1876945, 2322050, 0, 2322050, 1876945, 2322050, 0,
2942906, 2260392, 2942906, 0, 2942906, 2260392, 2942906, 0,
}; };
const uint32_t ALL_CASES_SIZE_SUM = std::accumulate( // aka 29334498
ALL_CASES_SIZE, ALL_CASES_SIZE + 16, (uint32_t)0
);
class AllCases : public BasicRanges { class AllCases : public BasicRanges {
public: public:

4
src/klotski/ffi/tmain.cc

@ -9,11 +9,15 @@
#include "common.h" #include "common.h"
#include "benchmark.h" #include "benchmark.h"
#include "all_cases.h"
using namespace klotski; using namespace klotski;
void tmain() { void tmain() {
printf("tmain start\n"); printf("tmain start\n");
std::cout << ALL_CASES_SIZE_SUM << std::endl;
// uint64_t common_code = 0x1A9BC0C00; // uint64_t common_code = 0x1A9BC0C00;
// klotski::Common::range_reverse(common_code); // klotski::Common::range_reverse(common_code);

2
test/all_cases.cc

@ -7,12 +7,12 @@ using klotski::AllCases;
using klotski::BasicRanges; using klotski::BasicRanges;
using klotski::ALL_CASES_SIZE; using klotski::ALL_CASES_SIZE;
using klotski::BASIC_RANGES_SIZE; using klotski::BASIC_RANGES_SIZE;
using klotski::ALL_CASES_SIZE_SUM;
/// basic ranges constants /// basic ranges constants
const char BASIC_RANGES_MD5[] = "6f385dc171e201089ff96bb010b47212"; const char BASIC_RANGES_MD5[] = "6f385dc171e201089ff96bb010b47212";
/// all cases constants /// all cases constants
const uint32_t ALL_CASES_SIZE_SUM = 29334498;
const char ALL_CASES_MD5[] = "3888e9fab8d3cbb50908b12b147cfb23"; const char ALL_CASES_MD5[] = "3888e9fab8d3cbb50908b12b147cfb23";
/// basic ranges size check /// basic ranges size check

Loading…
Cancel
Save