From 5406b8bc87c7aa658ef71f572aa00a9d1682f8bd Mon Sep 17 00:00:00 2001 From: "jan.reininghaus" Date: Thu, 20 Jun 2013 11:44:53 +0000 Subject: removed static code form bit_tree_column git-svn-id: https://phat.googlecode.com/svn/trunk@132 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d --- .../phat/representations/bit_tree_pivot_column.h | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/phat/representations/bit_tree_pivot_column.h b/include/phat/representations/bit_tree_pivot_column.h index 888e338..4d48e88 100644 --- a/include/phat/representations/bit_tree_pivot_column.h +++ b/include/phat/representations/bit_tree_pivot_column.h @@ -36,8 +36,8 @@ namespace phat { typedef uint64_t block_type; std::vector< block_type > data; - // this static is not a problem with OMP, it's initialized just after program starts - static const size_t debrujin_magic_table[ 64 ]; + + size_t debrujin_magic_table[ 64 ]; enum { block_size_in_bits = 64 }; enum { block_shift = 6 }; @@ -66,6 +66,18 @@ namespace phat { offset = upper_blocks; data.resize( upper_blocks + bottom_blocks_needed, 0 ); + + std::size_t temp_array[ 64 ] = { + 63, 0, 58, 1, 59, 47, 53, 2, + 60, 39, 48, 27, 54, 33, 42, 3, + 61, 51, 37, 40, 49, 18, 28, 20, + 55, 30, 34, 11, 43, 14, 22, 4, + 62, 57, 46, 52, 38, 26, 32, 41, + 50, 36, 17, 19, 29, 10, 13, 21, + 56, 45, 25, 31, 35, 16, 9, 12, + 44, 24, 15, 8, 23, 7, 6, 5 }; + + std::copy( &temp_array[ 0 ], &temp_array[ 64 ], &debrujin_magic_table[ 0 ] ); } index get_max_index() const { @@ -149,15 +161,5 @@ namespace phat { } }; - const size_t bit_tree_column::debrujin_magic_table[ 64 ] = { - 63, 0, 58, 1, 59, 47, 53, 2, - 60, 39, 48, 27, 54, 33, 42, 3, - 61, 51, 37, 40, 49, 18, 28, 20, - 55, 30, 34, 11, 43, 14, 22, 4, - 62, 57, 46, 52, 38, 26, 32, 41, - 50, 36, 17, 19, 29, 10, 13, 21, - 56, 45, 25, 31, 35, 16, 9, 12, - 44, 24, 15, 8, 23, 7, 6, 5 }; - typedef abstract_pivot_column bit_tree_pivot_column; } -- cgit v1.2.3