11 #ifndef OOPS_ASSIMILATION_SADDLEPOINTMINIMIZER_H_ 12 #define OOPS_ASSIMILATION_SADDLEPOINTMINIMIZER_H_ 17 #include <boost/scoped_ptr.hpp> 19 #include "eckit/config/Configuration.h" 32 #include "oops/util/Logger.h" 51 const std::string
classname()
const override {
return "SaddlePointMinimizer";}
62 std::vector< SaddlePointVector<MODEL> >
xyVEC_;
63 std::vector< SaddlePointVector<MODEL> >
pqVEC_;
68 template<
typename MODEL>
71 int ninner = config.getInt(
"ninner");
72 int gnreduc = config.getDouble(
"gradient_norm_reduction");
76 Log::info() <<
"SaddlePointMinimizer: max iter = " << ninner
77 <<
", requested norm reduction = " << gnreduc << std::endl;
82 for (
unsigned jj = 0; jj < J_.nterms(); ++jj) {
83 pdxx->
append(J_.jterm(jj).newDualVector());
92 for (
unsigned jj = 0; jj < J_.nterms(); ++jj) {
93 boost::scoped_ptr<GeneralizedDepartures> ww(J_.jterm(jj).newGradientFG());
94 pdfg->
append(J_.jterm(jj).multiplyCovar(*ww));
116 double reduc =
GMRESR(spdx, rhs, A, Pinv, ninner, gnreduc);
120 Log::test() <<
"SaddlePointMinimizer: reduction in residual norm = " << reduc << std::endl;
121 Log::info() <<
"SaddlePointMinimizer output" << *dx << std::endl;
133 #endif // OOPS_ASSIMILATION_SADDLEPOINTMINIMIZER_H_ double GMRESR(VECTOR &xx, const VECTOR &bb, const AMATRIX &A, const PMATRIX &precond, const int maxiter, const double tolerance)
std::vector< SaddlePointVector< MODEL > > xyVEC_
FullGMRES solver for Ax=b.
Container of dual space vectors for all terms of the cost function.
ControlIncrement< MODEL > CtrlInc_
CostFunction< MODEL > CostFct_
The namespace for the main oops code.
The preconditioner for the saddle-point minimizer.
subroutine, public info(self)
CtrlInc_ * doMinimize(const eckit::Configuration &) override
Minimizer< MODEL > Minimizer_
void append(GeneralizedDepartures *)
SaddlePointMinimizer(const eckit::Configuration &, const CostFct_ &J)
Control vector for the saddle point formulation.
A Minimizer knows how to minimize a cost function.
DualVector< MODEL > Multipliers_
const std::string classname() const override
std::vector< SaddlePointVector< MODEL > > pqVEC_
boost::scoped_ptr< CtrlInc_ > gradJb_