From b94c19293448ba50fc3dba09d2ae1effb91341ca Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 9 Jul 2020 14:12:30 +0100 Subject: [PATCH] Hex not binary (requires c++14) --- src/tree_distances.h | 81 ++++++++++---------------------------------- 1 file changed, 17 insertions(+), 64 deletions(-) diff --git a/src/tree_distances.h b/src/tree_distances.h index 08f440320..4631a45fd 100644 --- a/src/tree_distances.h +++ b/src/tree_distances.h @@ -27,70 +27,23 @@ const cost BIG = ((std::numeric_limits::max)() / MAX_SPLITS); const splitbit right16bits = 65535U; const splitbit powers_of_two[64] = { - 0b1, - 0b10, - 0b100, - 0b1000, - 0b10000, - 0b100000, - 0b1000000, - 0b10000000, - 0b100000000, - 0b1000000000, - 0b10000000000, - 0b100000000000, - 0b1000000000000, - 0b10000000000000, - 0b100000000000000, - 0b1000000000000000, - 0b10000000000000000, - 0b100000000000000000, - 0b1000000000000000000, - 0b10000000000000000000, - 0b100000000000000000000, - 0b1000000000000000000000, - 0b10000000000000000000000, - 0b100000000000000000000000, - 0b1000000000000000000000000, - 0b10000000000000000000000000, - 0b100000000000000000000000000, - 0b1000000000000000000000000000, - 0b10000000000000000000000000000, - 0b100000000000000000000000000000, - 0b1000000000000000000000000000000, - 0b10000000000000000000000000000000, - 0b100000000000000000000000000000000, - 0b1000000000000000000000000000000000, - 0b10000000000000000000000000000000000, - 0b100000000000000000000000000000000000, - 0b1000000000000000000000000000000000000, - 0b10000000000000000000000000000000000000, - 0b100000000000000000000000000000000000000, - 0b1000000000000000000000000000000000000000, - 0b10000000000000000000000000000000000000000, - 0b100000000000000000000000000000000000000000, - 0b1000000000000000000000000000000000000000000, - 0b10000000000000000000000000000000000000000000, - 0b100000000000000000000000000000000000000000000, - 0b1000000000000000000000000000000000000000000000, - 0b10000000000000000000000000000000000000000000000, - 0b100000000000000000000000000000000000000000000000, - 0b1000000000000000000000000000000000000000000000000, - 0b10000000000000000000000000000000000000000000000000, - 0b100000000000000000000000000000000000000000000000000, - 0b1000000000000000000000000000000000000000000000000000, - 0b10000000000000000000000000000000000000000000000000000, - 0b100000000000000000000000000000000000000000000000000000, - 0b1000000000000000000000000000000000000000000000000000000, - 0b10000000000000000000000000000000000000000000000000000000, - 0b100000000000000000000000000000000000000000000000000000000, - 0b1000000000000000000000000000000000000000000000000000000000, - 0b10000000000000000000000000000000000000000000000000000000000, - 0b100000000000000000000000000000000000000000000000000000000000, - 0b1000000000000000000000000000000000000000000000000000000000000, - 0b10000000000000000000000000000000000000000000000000000000000000, - 0b100000000000000000000000000000000000000000000000000000000000000, - 0b1000000000000000000000000000000000000000000000000000000000000000}; + 0x1, 0x2, 0x4, 0x8, + 0x10, 0x20, 0x40, 0x80, + 0x100, 0x200, 0x400, 0x800, + 0x1000, 0x2000, 0x4000, 0x8000, + 0x10000, 0x20000, 0x40000, 0x80000, + 0x100000, 0x200000, 0x400000, 0x800000, + 0x1000000, 0x2000000, 0x4000000, 0x8000000, + 0x10000000, 0x20000000, 0x40000000, 0x80000000, + 0x100000000, 0x200000000, 0x400000000, 0x800000000, + 0x1000000000, 0x2000000000, 0x4000000000, 0x8000000000, + 0x10000000000, 0x20000000000, 0x40000000000, 0x80000000000, + 0x100000000000, 0x200000000000, 0x400000000000, 0x800000000000, + 0x1000000000000, 0x2000000000000, 0x4000000000000, 0x8000000000000, + 0x10000000000000, 0x20000000000000, 0x40000000000000, 0x80000000000000, + 0x100000000000000, 0x200000000000000, 0x400000000000000, 0x800000000000000, + 0x1000000000000000, 0x2000000000000000, 0x4000000000000000, 0x8000000000000000 + }; const cost ROUND_PRECISION = 2048 * 2048;