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 > > cur5;
66 std::vector< Triplet< T > > rep;
68 for( ; it != this->
items[ index ].end(); ++it ) {
71 cur1.push_back( *it );
73 cur2.push_back( *it );
74 else if( this->
middle( index, *it ) )
75 cur3.push_back( *it );
77 cur4.push_back( *it );
79 cur5.push_back( *it );
83 if( cur1.size() + cur2.size() + cur3.size() + cur4.size() + cur5.size() > 0 )
84 this->
items[ index ] = rep;
85 this->
output->push_back( cur1 );
86 this->
output->push_back( cur2 );
87 this->
output->push_back( cur3 );
88 this->
output->push_back( cur4 );
89 this->
output->push_back( cur5 );
91 this->
datatype->push_back( VERTICAL_DS );
92 this->
datatype->push_back( HORIZONTAL_DS );
93 this->
datatype->push_back( NORMAL_DS );
94 this->
datatype->push_back( HORIZONTAL_DS );
95 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
Codes the CRS block order.
Definition: BlockCRS.hpp:41
char isLeaf(const unsigned long int index)
Whether the given node is a leaf node.
Definition: SBDTree.cpp:214
virtual void in_readout(const unsigned long int index)
Infix operations during SBD tree traversal.
Definition: BlockCRS.hpp:56
virtual void pre_readout(const unsigned long int index)
Prefix operations during SBD tree traversal.
Definition: BlockCRS.hpp:45
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 post_readout(const unsigned long int index)
Postfix operations during SBD tree traversal.
Definition: BlockCRS.hpp:100
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