12 #ifndef BOGUS_BLOCK_STREAMS_HPP
13 #define BOGUS_BLOCK_STREAMS_HPP
16 #include "SparseBlockMatrix.hpp"
17 #include "SparseBlockIndexComputer.hpp"
19 template <
typename Derived >
20 std::ostream& operator<<( std::ostream &out, const bogus::SparseBlockMatrixBase< Derived > &sbm )
24 IndexComputerType indexComputer( sbm ) ;
25 typedef typename IndexComputerType::ReturnType SourceIndexType ;
26 const SourceIndexType &sourceIndex = indexComputer.get() ;
28 out <<
" Total rows: " << sbm.rows() <<
" / cols: " << sbm.cols() << std::endl ;
29 for (
unsigned i = 0 ; i < (unsigned) sourceIndex.outerSize() ; ++ i )
31 out <<
"Row " << i <<
": " ;
32 for(
typename SourceIndexType::InnerIterator it( sourceIndex, i ) ;
35 out <<
" " << it.inner() <<
"@" << it.ptr() <<
"; " ;
39 out <<
" Blocks (" << sbm.nBlocks() <<
")" << std::endl ;
40 for (
unsigned i = 0 ; i < sbm.nBlocks() ; ++ i )
42 out << sbm.block(i) << std::endl ;
43 out <<
"^-- " << i << std::endl ;
Definition: SparseBlockIndexComputer.hpp:75