本文整理汇总了C++中Epetra_SerialDenseMatrix::NormInf方法的典型用法代码示例。如果您正苦于以下问题:C++ Epetra_SerialDenseMatrix::NormInf方法的具体用法?C++ Epetra_SerialDenseMatrix::NormInf怎么用?C++ Epetra_SerialDenseMatrix::NormInf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Epetra_SerialDenseMatrix
的用法示例。
在下文中一共展示了Epetra_SerialDenseMatrix::NormInf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
ierr = check(solver, A1, LDA1, i, NRHS, OneNorm1, B1, LDB1, X1, LDX1, Transpose, verbose);
assert (ierr>-1);
delete Matrix;
if (ierr!=0) {
if (verbose) cout << "Factorization failed due to bad conditioning. This is normal if RCOND is small."
<< endl;
break;
}
}
}
delete [] A;
delete [] A1;
delete [] X;
delete [] X1;
delete [] B;
delete [] B1;
/////////////////////////////////////////////////////////////////////
// Now test norms and scaling functions
/////////////////////////////////////////////////////////////////////
Epetra_SerialDenseMatrix D;
double ScalarA = 2.0;
int DM = 10;
int DN = 8;
D.Shape(DM, DN);
for (j=0; j<DN; j++)
for (i=0; i<DM; i++) D[j][i] = (double) (1+i+j*DM) ;
//cout << D << endl;
double NormInfD_ref = (double)(DM*(DN*(DN+1))/2);
double NormOneD_ref = (double)((DM*DN*(DM*DN+1))/2 - (DM*(DN-1)*(DM*(DN-1)+1))/2 );
double NormInfD = D.NormInf();
double NormOneD = D.NormOne();
if (verbose) {
cout << " *** Before scaling *** " << endl
<< " Computed one-norm of test matrix = " << NormOneD << endl
<< " Expected one-norm = " << NormOneD_ref << endl
<< " Computed inf-norm of test matrix = " << NormInfD << endl
<< " Expected inf-norm = " << NormInfD_ref << endl;
}
D.Scale(ScalarA); // Scale entire D matrix by this value
NormInfD = D.NormInf();
NormOneD = D.NormOne();
if (verbose) {
cout << " *** After scaling *** " << endl
<< " Computed one-norm of test matrix = " << NormOneD << endl
<< " Expected one-norm = " << NormOneD_ref*ScalarA << endl
<< " Computed inf-norm of test matrix = " << NormInfD << endl
<< " Expected inf-norm = " << NormInfD_ref*ScalarA << endl;
}
/////////////////////////////////////////////////////////////////////
// Now test that A.Multiply(false, x, y) produces the same result
// as y.Multiply('N','N', 1.0, A, x, 0.0).
/////////////////////////////////////////////////////////////////////
N = 10;
int M = 10;
LDA = N;