|
@ -2,19 +2,16 @@ |
|
|
|
|
|
|
|
|
#include <cstdint> |
|
|
#include <cstdint> |
|
|
|
|
|
|
|
|
|
|
|
#include "utils/utility.h" |
|
|
|
|
|
#include "all_cases/all_cases.h" |
|
|
|
|
|
|
|
|
namespace klotski::codec::offset { |
|
|
namespace klotski::codec::offset { |
|
|
|
|
|
|
|
|
/// This is the head index, the offset [0, 29334498) in all cases is obtained
|
|
|
/// This is the head index, the offset [0, 29334498) in all cases is obtained
|
|
|
/// according to the `head` (0 ~ 15). In other words, the short code range can
|
|
|
/// according to the `head` (0 ~ 15). In other words, the short code range can
|
|
|
/// be obtained according to the position of the 2x2 block.
|
|
|
/// be obtained according to the position of the 2x2 block.
|
|
|
|
|
|
|
|
|
// TODO: using std::array
|
|
|
constexpr auto ALL_CASES_OFFSET = to_offset(cases::ALL_CASES_NUM); |
|
|
constexpr uint32_t ALL_CASES_OFFSET[16] { |
|
|
|
|
|
0, 2942906, 5203298, 8146204, |
|
|
|
|
|
8146204, 10468254, 12345199, 14667249, |
|
|
|
|
|
14667249, 16989299, 18866244, 21188294, |
|
|
|
|
|
21188294, 24131200, 26391592, 29334498, |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/// This is the index for basic ranges, and its position (0 ~ 7311884) in all
|
|
|
/// This is the index for basic ranges, and its position (0 ~ 7311884) in all
|
|
|
/// basic ranges is located according to the first 12-bit (0 ~ 4095) within the
|
|
|
/// basic ranges is located according to the first 12-bit (0 ~ 4095) within the
|
|
|