本文整理汇总了C++中teuchos::RefCountPtr::NumMyNonzeros方法的典型用法代码示例。如果您正苦于以下问题:C++ RefCountPtr::NumMyNonzeros方法的具体用法?C++ RefCountPtr::NumMyNonzeros怎么用?C++ RefCountPtr::NumMyNonzeros使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类teuchos::RefCountPtr
的用法示例。
在下文中一共展示了RefCountPtr::NumMyNonzeros方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
Ifpack_IlukGraph ILU1(A, 1, 0);
assert(ILU1.ConstructFilledGraph()==0);
assert(check(L1, U1, ILU1, NumGlobalPoints, NumMyPoints, 1, verbose)==0);
if (verbose) cout << "\n\n*****Testing ILU(2) constructor on A" << endl<< endl;
Ifpack_IlukGraph ILU2(A, 2, 0);
assert(ILU2.ConstructFilledGraph()==0);
assert(check(L2, U2, ILU2, NumGlobalPoints, NumMyPoints, 2, verbose)==0);
if (verbose) cout << "\n\n*****Testing copy constructor" << endl<< endl;
Ifpack_IlukGraph ILUC(ILU2);
assert(check(L2, U2, ILUC, NumGlobalPoints, NumMyPoints, 2, verbose)==0);
if (verbose) cout << "\n\n*****Testing copy constructor" << endl<< endl;
Teuchos::RefCountPtr<Ifpack_IlukGraph> OverlapGraph;
for (int overlap = 1; overlap < 4; overlap++) {
if (verbose) cout << "\n\n*********************************************" << endl;
if (verbose) cout << "\n\nConstruct Level 1 fill with Overlap = " << overlap << ".\n\n" << endl;
OverlapGraph = Teuchos::rcp( new Ifpack_IlukGraph(A, 1, overlap) );
assert(OverlapGraph->ConstructFilledGraph()==0);
if (verbose) {
cout << "Number of Global Rows = " << OverlapGraph->NumGlobalRows() << endl;
cout << "Number of Global Nonzeros = " << OverlapGraph->NumGlobalNonzeros() << endl;
cout << "Number of Local Rows = " << OverlapGraph->NumMyRows() << endl;
cout << "Number of Local Nonzeros = " << OverlapGraph->NumMyNonzeros() << endl;
}
}
if (verbose1) {
// Test ostream << operator (if verbose1)
// Construct a Map that puts 6 equations on each PE
int NumElements1 = 6;
int NumPoints1 = NumElements1;
// Create an integer vector NumNz that is used to build the Petra Matrix.
// NumNz[i] is the Number of terms for the ith global equation on this processor
std::vector<int> NumNz1(NumPoints1);
// We are building a tridiagonal matrix where each row has (-1 2 -1)
// So we need 2 off-diagonal terms (except for the first and last equation)
for (i=0; i<NumPoints1; i++)
if (i==0 || i == NumPoints1-1)
NumNz1[i] = 2;
else
NumNz1[i] = 3;
// Create a Epetra_Matrix
Epetra_Map Map1(NumPoints1, NumPoints1, 1, Comm);
Epetra_CrsGraph A1(Copy, Map1, &NumNz1[0]);
// Add rows one-at-a-time
// Need some vectors to help
// Off diagonal Values will always be -1