summaryrefslogtreecommitdiff
path: root/include/phat/representations
diff options
context:
space:
mode:
authorjan.reininghaus <jan.reininghaus@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-04-10 14:06:30 +0000
committerjan.reininghaus <jan.reininghaus@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-04-10 14:06:30 +0000
commit198c068da370c3b96163e11d99ece6201b029232 (patch)
treeea1c2c467b41ee31934a191ae9520f5b7b239294 /include/phat/representations
parent86eb37d00d31531476b639a5392f30b19cb547fb (diff)
clean up of bit_tree_column
git-svn-id: https://phat.googlecode.com/svn/branches/bit-tree@26 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d
Diffstat (limited to 'include/phat/representations')
-rw-r--r--include/phat/representations/bit_tree_pivot_column.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/include/phat/representations/bit_tree_pivot_column.h b/include/phat/representations/bit_tree_pivot_column.h
index 0e2a1fc..da1e628 100644
--- a/include/phat/representations/bit_tree_pivot_column.h
+++ b/include/phat/representations/bit_tree_pivot_column.h
@@ -1,5 +1,5 @@
/* Copyright 2013 IST Austria
- Contributed by: Ulrich Bauer, Michael Kerber, Jan Reininghaus, Hubert Wagner
+ Contributed by: Hubert Wagner
This file is part of PHAT.
@@ -43,9 +43,9 @@ namespace phat {
// (-x)&x isolates the rightmost bit.
// The whole method is much faster than calling log2i, and very comparable to using ScanBitForward/Reverse intrinsic,
// which should be one CPU instruction, but is not portable.
- inline size_t rightmost_pos(const block_type value) const
+ size_t rightmost_pos(const block_type value) const
{
- return 64 - 1 - debrujin_magic_table[((value & (-value))*0x07EDD5E59A4E28C2) >> 58];
+ return 64 - 1 - debrujin_magic_table[((value & ((uint64_t)0 - value))*0x07EDD5E59A4E28C2) >> 58];
}
public:
@@ -64,7 +64,7 @@ namespace phat {
std::copy(debrujin_for_64_bit, debrujin_for_64_bit+64, debrujin_magic_table);
- int64_t n = 1; // in case of overflow
+ uint64_t n = 1; // in case of overflow
size_t bottom_blocks_needed = (num_cols+block_size_in_bits-1)/block_size_in_bits;
size_t upper_blocks = 1;
@@ -79,7 +79,7 @@ namespace phat {
data.resize(upper_blocks + bottom_blocks_needed, 0);
}
- inline index max_index() const
+ index max_index() const
{
if (!data[0])
return -1;
@@ -105,12 +105,12 @@ namespace phat {
return -1;
}
- inline bool empty() const
+ bool empty() const
{
return data[0] == 0;
}
- inline void add_index(const size_t entry)
+ void add_index(const size_t entry)
{
const block_type ONE = 1;
const block_type block_modulo_mask = ((ONE << block_shift) - 1);
@@ -159,10 +159,6 @@ namespace phat {
add_index(col[i]);
}
}
-
- inline bool empty() {
- return !data[0];
- }
};
typedef abstract_pivot_column<bit_tree_column> bit_tree_pivot_column;