49 const unsigned int blkRows,
50 const unsigned int blkColumns,
51 const unsigned int blkDim,
57 int rowcoord, localRow, blkRowCoord;
58 int colcoord, localCol, blkColCoord;
60 for(entry = cooMat.begin(); entry != cooMat.end(); entry++)
62 rowcoord = (entry->first).first;
63 colcoord = (entry->first).second;
65 blkRowCoord = rowcoord / blkDim;
66 blkColCoord = colcoord / blkDim;
68 CoordType blkCoords = std::make_pair(blkRowCoord,blkColCoord);
69 blk = bcoMat.find(blkCoords);
70 if (blk == bcoMat.end())
73 bcoMat[blkCoords] = b;
76 localRow = rowcoord % blkDim;
77 localCol = colcoord % blkDim;
81 const unsigned int localoffset = localRow + localCol*blkDim;
82 (bcoMat[blkCoords])[localoffset] = entry->second;
86 template<
typename SparseStorageType>
87 std::ostream& operator<<(std::ostream& os, const NekSparseMatrix<SparseStorageType>& rhs)
92 for(
unsigned int i = 0; i < rhs.GetRows(); ++i)
95 for(
unsigned int j = 0; j < rhs.GetColumns(); ++j)
98 os.precision(osprecision);
100 if( j != rhs.GetColumns() - 1 )
106 if( i != rhs.GetRows()-1 )
114 template<
typename SparseStorageType>
115 std::ostream& operator<<(std::ostream& os, const NekSparseDiagBlkMatrix<SparseStorageType>& rhs)
120 for(
unsigned int i = 0; i < rhs.GetRows(); ++i)
123 for(
unsigned int j = 0; j < rhs.GetColumns(); ++j)
126 os.precision(osprecision);
128 if( j != rhs.GetColumns() - 1 )
134 if( i != rhs.GetRows()-1 )
142 template std::ostream& operator<<(std::ostream& os, const NekSparseMatrix<StorageSmvBsr<NekDouble> >& rhs);
143 template std::ostream& operator<<(std::ostream& os, const NekSparseDiagBlkMatrix<StorageSmvBsr<NekDouble> >& rhs);
std::map< CoordType, NekDouble > COOMatType
COOMatType::const_iterator COOMatTypeConstIt
BCOMatType::const_iterator BCOMatTypeConstIt
std::map< CoordType, BCOEntryType > BCOMatType
void convertCooToBco(const unsigned int blkRows, const unsigned int blkColumns, const unsigned int blkDim, const COOMatType &cooMat, BCOMatType &bcoMat)
std::pair< IndexType, IndexType > CoordType