37 #include "BlockOrderer.hpp"
40 template<
typename T >
51 this->
datatype->push_back( NORMAL_DS );
56 virtual void in_readout (
const unsigned long int index ) {
60 typename std::vector< Triplet< T > >::iterator it = this->
items[ index ].begin();
61 std::vector< Triplet< T > > cur1;
62 std::vector< Triplet< T > > cur2;
63 std::vector< Triplet< T > > cur3;
64 std::vector< Triplet< T > > cur4;
65 std::vector< Triplet< T > > rep;
67 for( ; it != this->
items[ index ].end(); ++it ) {
70 cur1.push_back( *it );
71 else if( this->
middle( index, *it ) )
72 cur2.push_back( *it );
74 cur3.push_back( *it );
76 cur4.push_back( *it );
80 if( cur1.size() + cur2.size() + cur3.size() + cur4.size() > 0 )
81 this->
items[ index ] = rep;
82 this->
output->push_back( cur1 );
83 this->
output->push_back( cur2 );
84 this->
output->push_back( cur3 );
85 this->
output->push_back( cur4 );
87 this->
datatype->push_back( HORIZONTAL_DS );
88 this->
datatype->push_back( NORMAL_DS );
89 this->
datatype->push_back( VERTICAL_DS );
90 this->
datatype->push_back( VERTICAL_DS );
99 typename std::vector< Triplet< T > >::iterator it = this->
items[ index ].begin();
100 std::vector< Triplet< T > > cur;
101 std::vector< Triplet< T > > rep;
103 for( ; it != this->
items[ index ].end(); ++it ) {
106 cur.push_back( *it );
108 rep.push_back( *it );
111 this->
items[ index ] = rep;
112 assert( rep.size() == 0 );
113 this->
output->push_back( cur );
115 this->
datatype->push_back( HORIZONTAL_DS );
Induces a block order by fully traversing an SBDTree.
Definition: BlockOrderer.hpp:48
SBDTree * tree
The SBD tree to order the blocks of.
Definition: BlockOrderer.hpp:53
virtual void post_readout(const unsigned long int index)
Postfix operations during SBD tree traversal.
Definition: U2.hpp:95
char isLeaf(const unsigned long int index)
Whether the given node is a leaf node.
Definition: SBDTree.cpp:214
bool left_horizontal(const unsigned long int index, const Triplet< T > triplet)
Helper function for determining place of a nonzero within a separator cross.
Definition: BlockOrderer.hpp:203
bool upper_vertical(const unsigned long int index, const Triplet< T > triplet)
Helper function for determining place of a nonzero within a separator cross.
Definition: BlockOrderer.hpp:221
Codes the Minimal CCS block order.
Definition: U2.hpp:41
virtual void pre_readout(const unsigned long int index)
Prefix operations during SBD tree traversal.
Definition: U2.hpp:45
virtual void in_readout(const unsigned long int index)
Infix operations during SBD tree traversal.
Definition: U2.hpp:56
bool right_horizontal(const unsigned long int index, const Triplet< T > triplet)
Helper function for determining place of a nonzero within a separator cross.
Definition: BlockOrderer.hpp:212
bool lower_vertical(const unsigned long int index, const Triplet< T > triplet)
Helper function for determining place of a nonzero within a separator cross.
Definition: BlockOrderer.hpp:230
std::vector< std::vector< Triplet< T > > > * output
Output structure after SBD readout (series of blocks in the correct order).
Definition: BlockOrderer.hpp:197
bool middle(const unsigned long int index, const Triplet< T > triplet)
Helper function for determining place of a nonzero within a separator cross.
Definition: BlockOrderer.hpp:239
std::vector< signed char > * datatype
The data type of each block.
Definition: BlockOrderer.hpp:200
std::vector< Triplet< T > > * items
Nonzero storage at each node.
Definition: BlockOrderer.hpp:194