80 const double beta)
const {
81 Teko_DEBUG_SCOPE(
"DiagnosticLinearOp::implicityApply", 10);
84 Teuchos::TimeMonitor monitor(timer_,
false);
89 wrapOpA_lo_->apply(Thyra::NOTRANS, *x, y.ptr(), alpha, beta);
92 bool printResidual = (fwdOp_ != Teuchos::null);
98 fwdOp_->apply(Thyra::NOTRANS, *y, residual.ptr(), -1.0, alpha);
99 if (beta != 0.0) fwdOp_->apply(Thyra::NOTRANS, *z, residual.ptr(), beta, 1.0);
102 std::vector<double> norms(y->domain()->dim());
103 std::vector<double> rhsNorms(x->domain()->dim());
104 Thyra::norms_2<double>(*residual, Teuchos::arrayViewFromVector(norms));
105 Thyra::norms_2<double>(*x, Teuchos::arrayViewFromVector(rhsNorms));
108 (*outputStream_) <<
"DiagnosticLinearOp \"" << diagString_ <<
"\": residual = [";
109 for (std::size_t i = 0; i < norms.size(); ++i)
110 (*outputStream_) <<
" " << std::scientific << std::setprecision(4)
111 << norms[i] / rhsNorms[i];
112 (*outputStream_) <<
" ]" << std::endl;
114 residualNorm_ = norms[0];
DiagnosticLinearOp(const Teuchos::RCP< std::ostream > &ostrm, const ModifiableLinearOp &A, const std::string &diagnosticString)
This constructor explicitly takes the linear operator that needs to be wrapped and a string for outpu...