11 #ifndef OOPS_ASSIMILATION_HESSIANMATRIX_H_ 12 #define OOPS_ASSIMILATION_HESSIANMATRIX_H_ 14 #include <boost/noncopyable.hpp> 21 #include "oops/util/PrintAdjTest.h" 24 template<
typename MODEL>
class JqTermTLAD;
33 template<
typename MODEL>
class HessianMatrix :
private boost::noncopyable {
41 const bool test =
false);
53 template<
typename MODEL>
55 : j_(
j), test_(
test), iter_(0)
60 template<
typename MODEL>
71 for (
unsigned jj = 0; jj < j_.nterms(); ++jj) {
77 j_.runTLM(mdx, costtl);
88 j_.jb().finalizeTL(jqtl, dx, dw);
89 j_.jb().multiplyBinv(dw,
tmp);
99 for (
unsigned jj = 0; jj < j_.nterms(); ++jj) {
101 zz.
append(j_.jterm(jj).multiplyCoInv(*ww.
getv(jj)));
106 j_.runADJ(dw, costad);
108 j_.jb().finalizeAD(jqad);
112 double adj_tst_fwd = dot_product(ww, zz);
114 double adj_tst_bwd = dot_product(dx, dw);
116 Log::info() <<
"Online adjoint test, iteration: " << iter_ << std::endl
117 << util::PrintAdjTest(adj_tst_fwd, adj_tst_bwd,
"G")
126 #endif // OOPS_ASSIMILATION_HESSIANMATRIX_H_ GeneralizedDepartures * releaseOutputFromTL(unsigned int ii)
Get TL dual space output.
Container of dual space vectors for all terms of the cost function.
Increment< MODEL > Increment_
CostFunction< MODEL > CostFct_
void initializeTL(const Increment_ &dx, const util::DateTime &end, const util::Duration &step)
Tangent linear methods.
ControlIncrement< MODEL > CtrlInc_
l_size ! loop over number of fields ke do j
HessianMatrix(const CostFct_ &j, const bool test=false)
The namespace for the main oops code.
void initializeAD(Increment_ &dx, const util::DateTime &bgn, const util::Duration &step)
Adjoint methods.
subroutine, public info(self)
JqTermTLAD< MODEL > JqTermTLAD_
Control model post processing.
void enrollProcessor(PostBaseTLAD_ *pp)
Increment Class: Difference between two states.
void multiply(const CtrlInc_ &dx, CtrlInc_ &dz) const
void append(GeneralizedDepartures *)
void zero()
Linear algebra operators.
boost::shared_ptr< const GeneralizedDepartures > getv(const unsigned) const