本文整理汇总了C++中teuchos::LAPACK::GECON方法的典型用法代码示例。如果您正苦于以下问题:C++ LAPACK::GECON方法的具体用法?C++ LAPACK::GECON怎么用?C++ LAPACK::GECON使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类teuchos::LAPACK
的用法示例。
在下文中一共展示了LAPACK::GECON方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
else if (nIter > accelerationStartIteration) {
if (nStore == storeParam) {
Teuchos::RCP<NOX::Abstract::Vector> tempPtr = xMat[0];
for (int ii = 0; ii<nStore-1; ii++)
xMat[ii] = xMat[ii+1];
xMat[nStore-1] = tempPtr;
qrDelete();
}
oldPrecF->update(1.0, *precF, -1.0);
qrAdd(*oldPrecF);
xMat[nStore-1]->update(1.0, solnPtr->getX(), -1.0, oldSolnPtr->getX(), 0.0);
}
}
// Reorthogonalize
if ( (nStore > 1) && (orthoFrequency > 0) )
if (nIter % orthoFrequency == 0)
reorthogonalize();
// Copy current soln to the old soln.
*oldSolnPtr = *solnPtr;
*oldPrecF = *precF;
// Adjust for condition number
if (nStore > 0) {
Teuchos::LAPACK<int,double> lapack;
char normType = '1';
double invCondNum = 0.0;
int info = 0;
if ( WORK.size() < static_cast<std::size_t>(4*nStore) )
WORK.resize(4*nStore);
if (IWORK.size() < static_cast<std::size_t>(nStore))
IWORK.resize(nStore);
lapack.GECON(normType,nStore,rMat.values(),nStore,rMat.normOne(),&invCondNum,&WORK[0],&IWORK[0],&info);
if (utilsPtr->isPrintType(Utils::Details))
utilsPtr->out() << " R condition number estimate ("<< nStore << ") = " << 1.0/invCondNum << std::endl;
if (adjustForConditionNumber) {
while ( (1.0/invCondNum > dropTolerance) && (nStore > 1) ) {
Teuchos::RCP<NOX::Abstract::Vector> tempPtr = xMat[0];
for (int ii = 0; ii<nStore-1; ii++)
xMat[ii] = xMat[ii+1];
xMat[nStore-1] = tempPtr;
qrDelete();
lapack.GECON(normType,nStore,rMat.values(),nStore,rMat.normOne(),&invCondNum,&WORK[0],&IWORK[0],&info);
if (utilsPtr->isPrintType(Utils::Details))
utilsPtr->out() << " Adjusted R condition number estimate ("<< nStore << ") = " << 1.0/invCondNum << std::endl;
}
}
}
// Solve the least-squares problem.
Teuchos::SerialDenseMatrix<int,double> gamma(nStore,1), RHS(nStore,1), Rgamma(nStore,1);
for (int ii = 0; ii<nStore; ii++)
RHS(ii,0) = precF->innerProduct( *(qMat[ii]) );
//Back-solve for gamma
for (int ii = nStore-1; ii>=0; ii--) {
gamma(ii,0) = RHS(ii,0);
for (int jj = ii+1; jj<nStore; jj++) {
gamma(ii,0) -= rMat(ii,jj)*gamma(jj,0);
}
gamma(ii,0) /= rMat(ii,ii);
}
if (nStore > 0)