From e9800d103fcdd19f0417e89781761f7f85d8ec9b Mon Sep 17 00:00:00 2001 From: Michael Kerber Date: Fri, 18 May 2018 10:52:51 +0200 Subject: Column types are separated, and the matrix representation is more general in its container type --- include/phat/representations/heap_pivot_column.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'include/phat/representations/heap_pivot_column.h') diff --git a/include/phat/representations/heap_pivot_column.h b/include/phat/representations/heap_pivot_column.h index 33cd07b..c5e4313 100644 --- a/include/phat/representations/heap_pivot_column.h +++ b/include/phat/representations/heap_pivot_column.h @@ -19,7 +19,6 @@ #pragma once #include -#include namespace phat { class heap_column { @@ -71,6 +70,18 @@ namespace phat { clear(); } + + template + void add_col(InputIterator begin, InputIterator end) { + for(InputIterator it=begin;it!=end;it++) { + data.push(*it); + inserts_since_last_prune++; + } + if( 2 * inserts_since_last_prune >( index ) data.size( ) ) + prune(); + } + + void add_col( const column& col ) { for( index idx = 0; idx < (index) col.size(); idx++ ) data.push( col[ idx ] ); @@ -122,5 +133,4 @@ namespace phat { } }; - typedef abstract_pivot_column< heap_column > heap_pivot_column; } -- cgit v1.2.3