37 #include "BlockOrderer.hpp"
40 template<
typename T >
49 this->
datatype->push_back( NORMAL_DS );
53 virtual void in_readout (
const unsigned long int index ) {
62 typename std::vector< Triplet< T > >::iterator it = this->
items[ index ].begin();
63 std::vector< Triplet< T > > cur1;
64 std::vector< Triplet< T > > cur2;
65 std::vector< Triplet< T > > cur3;
66 std::vector< Triplet< T > > cur4;
67 std::vector< Triplet< T > > cur5;
68 std::vector< Triplet< T > > rep;
70 for( ; it != this->
items[ index ].end(); ++it ) {
73 cur1.push_back( *it );
74 else if( this->
middle( index, *it ) )
75 cur2.push_back( *it );
77 cur3.push_back( *it );
79 cur4.push_back( *it );
81 cur5.push_back( *it );
85 if( cur1.size() + cur2.size() + cur3.size() + cur4.size() + cur5.size() > 0 )
86 this->
items[ index ] = rep;
87 this->
output->push_back( cur1 );
88 this->
output->push_back( cur2 );
89 this->
output->push_back( cur3 );
90 this->
output->push_back( cur4 );
91 this->
output->push_back( cur5 );
93 this->
datatype->push_back( HORIZONTAL_DS );
94 this->
datatype->push_back( NORMAL_DS );
95 this->
datatype->push_back( VERTICAL_DS );
96 this->
datatype->push_back( VERTICAL_DS );
97 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 pre_readout(const unsigned long int index)
Prefix traversal code.
Definition: SepLast.hpp:43
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
virtual void in_readout(const unsigned long int index)
Infix traversal code.
Definition: SepLast.hpp:53
virtual void post_readout(const unsigned long int index)
Postfix traversal code.
Definition: SepLast.hpp:57
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
Codes the Minimal CCS block order.
Definition: SepLast.hpp:41
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