diff options
author | jan.reininghaus <jan.reininghaus@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d> | 2013-05-14 09:59:44 +0000 |
---|---|---|
committer | jan.reininghaus <jan.reininghaus@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d> | 2013-05-14 09:59:44 +0000 |
commit | 595ce965ef6e07c554a91ebb8b41c8e1c06b8b32 (patch) | |
tree | 47f7578d613334b6a37e50028f20f60e316b1782 /include/phat/representations/full_pivot_column.h | |
parent | fb02e45712d44f217dfbd71910ea533894c065e6 (diff) |
cleaned up pivot column source
git-svn-id: https://phat.googlecode.com/svn/trunk@85 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d
Diffstat (limited to 'include/phat/representations/full_pivot_column.h')
-rw-r--r-- | include/phat/representations/full_pivot_column.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/include/phat/representations/full_pivot_column.h b/include/phat/representations/full_pivot_column.h index ce7b9f1..b83683f 100644 --- a/include/phat/representations/full_pivot_column.h +++ b/include/phat/representations/full_pivot_column.h @@ -35,7 +35,7 @@ namespace phat { m_isInHistory.resize( total_size, false );
}
- void add_column( const column& col ) {
+ void add_col( const column& col ) {
for( index idx = 0; idx < (index) col.size(); idx++ ) {
add_index( col[ idx ] );
}
@@ -49,7 +49,7 @@ namespace phat { m_data[ idx ] = !m_data[ idx ];
}
- index max_index() {
+ index get_max_index() {
while( m_history.size() > 0 ) {
index topIndex = m_history.top();
if( m_data[ topIndex ] ) {
@@ -63,37 +63,37 @@ namespace phat { return -1;
}
- void get_column_and_clear( column& col ) {
+ void get_col_and_clear( column& col ) {
col.clear();
- while( !empty() ) {
- col.push_back( max_index() );
- add_index( max_index() );
+ while( !is_empty() ) {
+ col.push_back( get_max_index() );
+ add_index( get_max_index() );
}
std::reverse( col.begin(), col.end() );
}
- bool empty() {
- return (max_index() == -1);
+ bool is_empty() {
+ return (get_max_index() == -1);
}
void clear() {
- while( !empty() )
- add_index( max_index() );
+ while( !is_empty() )
+ add_index( get_max_index() );
}
void remove_max() {
- add_index( max_index() );
+ add_index( get_max_index() );
}
void set_col( const column& col ) {
clear();
- add_column( col );
+ add_col( col );
}
void get_col( column& col ) {
col.clear();
- get_column_and_clear( col );
- add_column( col );
+ get_col_and_clear( col );
+ add_col( col );
}
};
|