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


C++ Epetra_IntSerialDenseVector::Length方法代码示例

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


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

示例1: return

int EpetraVector<T>::ReplaceGlobalValues(const Epetra_IntSerialDenseVector & GIDs,
                                         const Epetra_SerialDenseVector & values)
{
  if (GIDs.Length() != values.Length()) {
    return(-1);
  }

  return( inputValues( GIDs.Length(), GIDs.Values(), values.Values(), false) );
}
开发者ID:rossisimone,项目名称:libmesh,代码行数:9,代码来源:trilinos_epetra_vector.C

示例2: ReplaceGlobalValues

int Epetra_FEVector::ReplaceGlobalValues(const Epetra_IntSerialDenseVector& GIDs,
                       const Epetra_SerialDenseVector& values,
                                         int vectorIndex)
{
  if (GIDs.Length() != values.Length()) {
    return(-1);
  }

  return( inputValues( GIDs.Length(), GIDs.Values(), values.Values(), false,
                       vectorIndex) );
}
开发者ID:cakeisalie,项目名称:oomphlib_003,代码行数:11,代码来源:Epetra_FEVector.cpp

示例3: ReplaceGlobalValues

int Epetra_FECrsMatrix::ReplaceGlobalValues(const Epetra_IntSerialDenseVector& indices,
              const Epetra_SerialDenseMatrix& values,
              int format)
{
  if (indices.Length() != values.M() || indices.Length() != values.N()) {
    return(-1);
  }

  return( ReplaceGlobalValues(indices.Length(), indices.Values(),
            values.A(), format) );
}
开发者ID:00liujj,项目名称:trilinos,代码行数:11,代码来源:Epetra_FECrsMatrix.cpp

示例4: InsertGlobalValues

int Epetra_FECrsMatrix::InsertGlobalValues(const Epetra_IntSerialDenseVector& rows,
             const Epetra_IntSerialDenseVector& cols,
             const Epetra_SerialDenseMatrix& values,
             int format)
{
  if (rows.Length() != values.M() || cols.Length() != values.N()) {
    return(-1);
  }

  return( InsertGlobalValues(rows.Length(), rows.Values(),
           cols.Length(), cols.Values(),
            values.A(), format) );
}
开发者ID:00liujj,项目名称:trilinos,代码行数:13,代码来源:Epetra_FECrsMatrix.cpp

示例5:

void
MapEpetra::bubbleSort (Epetra_IntSerialDenseVector& elements)
{
    Int hold;

    for ( Int pass (0); pass < elements.Length() - 1; pass++ )
        for ( Int j (0); j < elements.Length() - 1; j++ )
            if ( elements[j] > elements[j + 1] )
            {
                hold          = elements[j];
                elements[j]   = elements[j + 1];
                elements[j + 1] = hold;
            }
}
开发者ID:lifev,项目名称:lifev,代码行数:14,代码来源:MapEpetra.cpp

示例6: main

int main(int argc, char *argv[]) {

#ifdef HAVE_MPI
  MPI_Init(&argc, &argv);
  Epetra_MpiComm Comm(MPI_COMM_WORLD);
#else
  Epetra_SerialComm Comm;
#endif

  int NumGlobalElements = 4; // global dimension of the problem

  int NumMyElements; // local nodes
  Epetra_IntSerialDenseVector MyGlobalElements;

  if( Comm.MyPID() == 0 ) {
    NumMyElements = 3;
    MyGlobalElements.Size(NumMyElements);
    MyGlobalElements[0] = 0;
    MyGlobalElements[1] = 1;
    MyGlobalElements[2] = 2;
  } else {
    NumMyElements = 3;
    MyGlobalElements.Size(NumMyElements);
    MyGlobalElements[0] = 1;
    MyGlobalElements[1] = 2;
    MyGlobalElements[2] = 3;
  }

  // create a map
  Epetra_Map Map(-1,MyGlobalElements.Length(),
      MyGlobalElements.Values(),0, Comm);

  // create a vector based on map
  Epetra_Vector x(Map);
  for( int i=0 ; i<NumMyElements ; ++i )
    x[i] = 10*( Comm.MyPID()+1 );
  cout << x;

  // create a target map, in which all the elements are on proc 0
  int NumMyElements_target;

  if( Comm.MyPID() == 0 )
    NumMyElements_target = NumGlobalElements;
  else
    NumMyElements_target = 0;

  Epetra_Map TargetMap(-1,NumMyElements_target,0,Comm);

  Epetra_Export Exporter(Map,TargetMap);

  // work on vectors
  Epetra_Vector y(TargetMap);

  y.Export(x,Exporter,Add);

  cout << y;

#ifdef HAVE_MPI
  MPI_Finalize();
#endif

  return(EXIT_SUCCESS);

}
开发者ID:EllieGong,项目名称:trilinos,代码行数:64,代码来源:ex9.cpp


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