Skip to content
Snippets Groups Projects
Commit 44dc9916 authored by Oliver Sander's avatar Oliver Sander Committed by sander@PCPOOL.MI.FU-BERLIN.DE
Browse files

Directly compute the iteration radius when no preconditioner is given

[[Imported from SVN: r2452]]
parent d4ccfacd
Branches
Tags
No related merge requests found
......@@ -108,6 +108,22 @@ void TruncatedCGSolver<MatrixType, VectorType>::solve()
<< std::endl;
#endif
if (preconditioner_==NULL) {
correctionNormSquared = trustRegionScalarProduct(p,p);
solutionTimesCorrection = trustRegionScalarProduct(*x_,p);
solutionNormSquared = trustRegionScalarProduct(*x_,*x_);
}
if (correctionNormSquared <= 0) {
if (this->historyBuffer_!="")
this->writeIterate(*x_, i);
return;
}
// if energy is concave in the search direction go to the boundary and stop there
if (energyNormSquared <= 0) {
......@@ -146,7 +162,7 @@ void TruncatedCGSolver<MatrixType, VectorType>::solve()
// std::cout << "tentative radius^2: " << trustRegionScalarProduct(tentativeNewIterate,tentativeNewIterate)
// << std::endl;
std::cout << "tentative length^2: " << tentativeLengthSquared << std::endl;
//std::cout << "tentative length^2: " << tentativeLengthSquared << std::endl;
if (tentativeLengthSquared >= trustRegionRadius_*trustRegionRadius_) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment