Browse Source

feat: add const `ALL_CASES_SIZE_SUM`

master
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 <vector>
#include <cstdint>
#include <numeric>
#include "basic_ranges.h"
namespace klotski {
@ -37,6 +38,9 @@ namespace klotski {
2322050, 1876945, 2322050, 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 {
public:

4
src/klotski/ffi/tmain.cc

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

2
test/all_cases.cc

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

Loading…
Cancel
Save