37 #include "BlockOrderer.hpp"
40 template<
typename T >
51 this->
datatype->push_back( NORMAL_DS );
54 typename std::vector< Triplet< T > >::iterator it = this->
items[ index ].begin();
55 std::vector< Triplet< T > > cur;
56 std::vector< Triplet< T > > rep;
58 for( ; it != this->
items[ index ].end(); ++it ) {
66 this->
items[ index ] = rep;
67 this->
output->push_back( cur );
69 this->
datatype->push_back( VERTICAL_DS );
74 virtual void in_readout (
const unsigned long int index ) {
78 typename std::vector< Triplet< T > >::iterator it = this->
items[ index ].begin();
79 std::vector< Triplet< T > > cur1;
80 std::vector< Triplet< T > > cur2;
81 std::vector< Triplet< T > > cur3;
82 std::vector< Triplet< T > > rep;
84 for( ; it != this->
items[ index ].end(); ++it ) {
87 cur1.push_back( *it );
88 else if( this->
middle( index, *it ) )
89 cur2.push_back( *it );
91 cur3.push_back( *it );
95 if( cur1.size() + cur2.size() + cur3.size() > 0 )
96 this->
items[ index ] = rep;
97 this->
output->push_back( cur1 );
98 this->
output->push_back( cur2 );
99 this->
output->push_back( cur3 );
101 this->
datatype->push_back( HORIZONTAL_DS );
102 this->
datatype->push_back( NORMAL_DS );
103 this->
datatype->push_back( HORIZONTAL_DS );
112 typename std::vector< Triplet< T > >::iterator it = this->
items[ index ].begin();
113 std::vector< Triplet< T > > cur;
114 std::vector< Triplet< T > > rep;
116 for( ; it != this->
items[ index ].end(); ++it ) {
119 cur.push_back( *it );
121 rep.push_back( *it );
124 this->
items[ index ] = rep;
125 assert( rep.size() == 0 );
126 this->
output->push_back( cur );
128 this->
datatype->push_back( VERTICAL_DS );
Induces a block order by fully traversing an SBDTree.
Definition: BlockOrderer.hpp:48
virtual void pre_readout(const unsigned long int index)
Prefix operations during SBD tree traversal.
Definition: MinCRS.hpp:45
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
virtual void post_readout(const unsigned long int index)
Postfix operations during SBD tree traversal.
Definition: MinCRS.hpp:108
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
virtual void in_readout(const unsigned long int index)
Infix operations during SBD tree traversal.
Definition: MinCRS.hpp:74
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
Codes the Minimal CRS block order.
Definition: MinCRS.hpp:41
std::vector< Triplet< T > > * items
Nonzero storage at each node.
Definition: BlockOrderer.hpp:194