当前位置: 首页>>代码示例>>C++>>正文


C++ MapVector::nbMap方法代码示例

本文整理汇总了C++中MapVector::nbMap方法的典型用法代码示例。如果您正苦于以下问题:C++ MapVector::nbMap方法的具体用法?C++ MapVector::nbMap怎么用?C++ MapVector::nbMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MapVector的用法示例。


在下文中一共展示了MapVector::nbMap方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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) );
}
开发者ID:lifev,项目名称:lifev,代码行数:31,代码来源:MatrixBlockMonolithicEpetra.hpp

示例2: ASSERT

void
MatrixEpetraStructured<DataType>::setBlockStructure ( const MapVector<MapEpetra>& mapVector )
{
    ASSERT ( mapVector.nbMap() > 0 , "Map vector empty, impossible to set the block structure" );

    M_blockStructure.setBlockStructure ( mapVector );

    ASSERT ( this->matrixPtr()->NumGlobalCols() == M_blockStructure.numRows(), " Incompatible block structure (global size does not match) " );
    ASSERT ( this->matrixPtr()->NumGlobalRows() == M_blockStructure.numColumns(), " Incompatible block structure (global size does not match) " );
}
开发者ID:Danniel-UCAS,项目名称:lifev,代码行数:10,代码来源:MatrixEpetraStructured.hpp

示例3: myMap

MatrixEpetraStructured<DataType>::MatrixEpetraStructured ( const MapVector<MapEpetra>& vector, int numEntries, bool ignoreNonLocalValues ) :
    MatrixEpetra<DataType> ( typename MatrixEpetra<DataType>::matrix_ptrtype() ), M_blockStructure ( vector )
{
    ASSERT ( vector.nbMap() > 0 , "Map vector empty, impossible to construct a MatrixBlockMonolithicEpetra!" );

    MapEpetra myMap ( vector.totalMap() );

    this->mapPtr().reset ( new MapEpetra ( myMap ) );
    this->matrixPtr().reset ( new typename MatrixEpetra<DataType>::matrix_type ( Copy, *myMap.map ( Unique ), numEntries, ignoreNonLocalValues ) );
}
开发者ID:Danniel-UCAS,项目名称:lifev,代码行数:10,代码来源:MatrixEpetraStructured.hpp

示例4: 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) ");
}
开发者ID:lifev,项目名称:lifev,代码行数:27,代码来源:MatrixBlockMonolithicEpetra.hpp


注:本文中的MapVector::nbMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。