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 ) {
57 typename std::vector< Triplet< T > >::iterator it = this->
items[ index ].begin();
58 std::vector< Triplet< T > > cur1;
59 std::vector< Triplet< T > > cur2;
60 std::vector< Triplet< T > > cur3;
61 std::vector< Triplet< T > > cur4;
62 std::vector< Triplet< T > > rep;
64 for( ; it != this->
items[ index ].end(); ++it ) {
67 cur1.push_back( *it );
68 else if( this->
middle( index, *it ) )
69 cur2.push_back( *it );
71 cur3.push_back( *it );
73 cur4.push_back( *it );
77 if( cur1.size() + cur2.size() + cur3.size() + cur4.size() > 0 )
78 this->
items[ index ] = rep;
79 this->
output->push_back( cur1 );
80 this->
output->push_back( cur2 );
81 this->
output->push_back( cur3 );
82 this->
output->push_back( cur4 );
84 this->
datatype->push_back( VERTICAL_DS );
85 this->
datatype->push_back( NORMAL_DS );
86 this->
datatype->push_back( HORIZONTAL_DS );
87 this->
datatype->push_back( HORIZONTAL_DS );
95 typename std::vector< Triplet< T > >::iterator it = this->
items[ index ].begin();
96 std::vector< Triplet< T > > cur;
97 std::vector< Triplet< T > > rep;
99 for( ; it != this->
items[ index ].end(); ++it ) {
102 cur.push_back( *it );
104 rep.push_back( *it );
107 this->
items[ index ] = rep;
108 assert( rep.size() == 0 );
109 this->
output->push_back( cur );
111 this->
datatype->push_back( VERTICAL_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
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: Duck.hpp:41
virtual void in_readout(const unsigned long int index)
Infix traversal code.
Definition: Duck.hpp:53
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
virtual void post_readout(const unsigned long int index)
Postfix traversal code.
Definition: Duck.hpp:91
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
virtual void pre_readout(const unsigned long int index)
Prefix traversal code.
Definition: Duck.hpp:43
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