From fb02e45712d44f217dfbd71910ea533894c065e6 Mon Sep 17 00:00:00 2001 From: "jan.reininghaus@gmail.com" Date: Sun, 12 May 2013 20:42:59 +0000 Subject: simplified pivot column representations git-svn-id: https://phat.googlecode.com/svn/trunk@84 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d --- .../phat/representations/bit_tree_pivot_column.h | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include/phat/representations/bit_tree_pivot_column.h') diff --git a/include/phat/representations/bit_tree_pivot_column.h b/include/phat/representations/bit_tree_pivot_column.h index 9e72530..f997434 100644 --- a/include/phat/representations/bit_tree_pivot_column.h +++ b/include/phat/representations/bit_tree_pivot_column.h @@ -152,6 +152,31 @@ namespace phat { bool empty() { return !data[0]; + } + + void clear() { + while(true) + { + index mx = this->max_index(); + if (mx == -1) + break; + add_index(mx); + } + } + + void remove_max() { + add_index( max_index() ); + } + + void set_col( const column& col ) { + clear(); + add_column( col ); + } + + void get_col( column& col ) { + col.clear(); + get_column_and_clear( col ); + add_column( col ); } }; -- cgit v1.2.3