本文整理汇总了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) );
}
示例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) );
}
示例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) );
}
示例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) );
}
示例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;
}
}
示例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);
}