38 #include <boost/core/ignore_unused.hpp>
54 int rowcoord, localRow, blkRowCoord;
55 int colcoord, localCol, blkColCoord;
57 for (entry = cooMat.begin(); entry != cooMat.end(); entry++)
59 rowcoord = (entry->first).first;
60 colcoord = (entry->first).second;
62 blkRowCoord = rowcoord / blkDim;
63 blkColCoord = colcoord / blkDim;
65 CoordType blkCoords = std::make_pair(blkRowCoord, blkColCoord);
66 blk = bcoMat.find(blkCoords);
67 if (blk == bcoMat.end())
70 bcoMat[blkCoords] = b;
73 localRow = rowcoord % blkDim;
74 localCol = colcoord % blkDim;
78 const unsigned int localoffset = localRow + localCol * blkDim;
79 (bcoMat[blkCoords])[localoffset] = entry->second;
83 template <
typename SparseStorageType>
90 for (
unsigned int i = 0; i < rhs.
GetRows(); ++i)
93 for (
unsigned int j = 0; j < rhs.
GetColumns(); ++j)
96 os.precision(osprecision);
98 if (j != rhs.GetColumns() - 1)
112 template <
typename SparseStorageType>
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)
IndexType GetRows() const
IndexType GetColumns() const
IndexType GetRows() const
IndexType GetColumns() const
The above copyright notice and this permission notice shall be included.
COOMatType::const_iterator COOMatTypeConstIt
std::map< CoordType, BCOEntryType > BCOMatType
std::pair< IndexType, IndexType > CoordType
void convertCooToBco(const unsigned int blkDim, const COOMatType &cooMat, BCOMatType &bcoMat)
std::map< CoordType, NekDouble > COOMatType
std::ostream & operator<<(std::ostream &os, const NekMatrix< DataType, FormType > &rhs)
BCOMatType::const_iterator BCOMatTypeConstIt