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>
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 )
113 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::pair< IndexType, IndexType > CoordType
void convertCooToBco(const unsigned int blkDim, const COOMatType &cooMat, BCOMatType &bcoMat)
std::map< CoordType, NekDouble > COOMatType
std::map< CoordType, BCOEntryType > BCOMatType
std::ostream & operator<<(std::ostream &os, const NekMatrix< DataType, FormType > &rhs)
BCOMatType::const_iterator BCOMatTypeConstIt