38 #include <boost/core/ignore_unused.hpp> 50 const unsigned int blkDim,
56 int rowcoord, localRow, blkRowCoord;
57 int colcoord, localCol, blkColCoord;
59 for(entry = cooMat.begin(); entry != cooMat.end(); entry++)
61 rowcoord = (entry->first).first;
62 colcoord = (entry->first).second;
64 blkRowCoord = rowcoord / blkDim;
65 blkColCoord = colcoord / blkDim;
67 CoordType blkCoords = std::make_pair(blkRowCoord,blkColCoord);
68 blk = bcoMat.find(blkCoords);
69 if (blk == bcoMat.end())
72 bcoMat[blkCoords] = b;
75 localRow = rowcoord % blkDim;
76 localCol = colcoord % blkDim;
80 const unsigned int localoffset = localRow + localCol*blkDim;
81 (bcoMat[blkCoords])[localoffset] = entry->second;
85 template<
typename SparseStorageType>
86 std::ostream& operator<<(std::ostream& os, const NekSparseMatrix<SparseStorageType>&
rhs)
91 for(
unsigned int i = 0; i <
rhs.GetRows(); ++i)
94 for(
unsigned int j = 0; j <
rhs.GetColumns(); ++j)
97 os.precision(osprecision);
99 if( j != rhs.GetColumns() - 1 )
105 if( i !=
rhs.GetRows()-1 )
113 template<
typename SparseStorageType>
114 std::ostream& operator<<(std::ostream& os, const NekSparseDiagBlkMatrix<SparseStorageType>&
rhs)
119 for(
unsigned int i = 0; i <
rhs.GetRows(); ++i)
122 for(
unsigned int j = 0; j <
rhs.GetColumns(); ++j)
125 os.precision(osprecision);
127 if( j != rhs.GetColumns() - 1 )
133 if( i !=
rhs.GetRows()-1 )
141 template std::ostream& operator<<(std::ostream& os, const NekSparseMatrix<StorageSmvBsr<NekDouble> >&
rhs);
142 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 blkDim, const COOMatType &cooMat, BCOMatType &bcoMat)
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs
std::pair< IndexType, IndexType > CoordType