本文整理汇总了C++中MapVector::mapSize方法的典型用法代码示例。如果您正苦于以下问题:C++ MapVector::mapSize方法的具体用法?C++ MapVector::mapSize怎么用?C++ MapVector::mapSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapVector
的用法示例。
在下文中一共展示了MapVector::mapSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: totalSize
void
MatrixBlockMonolithicEpetra<DataType>::setBlockStructure (const MapVector<MapEpetra>& mapVector)
{
ASSERT ( mapVector.nbMap() > 0 , "Map vector empty, impossible to set the block structure");
M_blockNumRows.resize (mapVector.nbMap() );
M_blockNumColumns.resize (mapVector.nbMap() );
M_blockFirstRows.resize (mapVector.nbMap() );
M_blockFirstColumns.resize (mapVector.nbMap() );
UInt totalSize (0);
for (UInt i (0); i < mapVector.nbMap(); ++i)
{
M_blockNumRows[i] = mapVector.mapSize (i);
M_blockNumColumns[i] = mapVector.mapSize (i);
M_blockFirstRows[i] = totalSize;
M_blockFirstColumns[i] = totalSize;
totalSize += mapVector.mapSize (i);
}
ASSERT ( this->matrixPtr()->NumGlobalCols() == totalSize, " Incompatible block structure (global size does not match) ");
ASSERT ( this->matrixPtr()->NumGlobalRows() == totalSize, " Incompatible block structure (global size does not match) ");
}
示例2: myMap
MatrixBlockMonolithicEpetra<DataType>::MatrixBlockMonolithicEpetra ( const MapVector<MapEpetra>& vector, int numEntries)
:
MatrixEpetra<DataType> (vector.totalMap() )
//MatrixEpetra<DataType>( typename MatrixEpetra<DataType>::matrix_ptrtype())
{
ASSERT ( vector.nbMap() > 0 , "Map vector empty, impossible to construct a MatrixBlockMonolithicEpetra!");
MapEpetra myMap (vector.map (0) );
M_blockNumRows.push_back (vector.mapSize (0) );
M_blockNumColumns.push_back (vector.mapSize (0) );
M_blockFirstRows.push_back (0);
M_blockFirstColumns.push_back (0);
UInt totalRows (vector.mapSize (0) );
UInt totalColumns (vector.mapSize (0) );
for (UInt i (1); i < vector.nbMap(); ++i)
{
myMap += vector.map (i);
M_blockNumRows.push_back (vector.mapSize (i) );
M_blockNumColumns.push_back (vector.mapSize (i) );
M_blockFirstRows.push_back (totalRows);
M_blockFirstColumns.push_back (totalColumns);
totalRows += vector.mapSize (i);
totalColumns += vector.mapSize (i);
}
this->mapPtr().reset (new MapEpetra (myMap) );
this->matrixPtr().reset ( new typename MatrixEpetra<DataType>::matrix_type ( Copy, *myMap.map ( Unique ), numEntries, false) );
}