ARTS  2.3.1285(git:92a29ea9-dirty)
agenda_wrapper.h
Go to the documentation of this file.
1 
9 #ifndef agenda_wrapper_h
10 #define agenda_wrapper_h
11 
12 #include "oem.h"
13 
15 
25 {
26 public:
27 
28  const unsigned int m, n;
29  OEMMatrixReference jacobian;
30  OEMVector yi;
31 
33 
46  unsigned int m_,
47  unsigned int n_,
48  Matrix & jacobian_,
49  Vector & yi_,
50  const Agenda *inversion_iterate_agenda_ ) :
51  m(m_),
52  n(n_),
53  jacobian(jacobian_), yi(yi_), ws(ws_),
54  inversion_iterate_agenda( inversion_iterate_agenda_ ),
55  reuse_jacobian((jacobian_.nrows() != 0) &&
56  (jacobian_.ncols() != 0) &&
57  (yi_.nelem() != 0)),
59  {}
60 
61  AgendaWrapper(const AgendaWrapper &) = delete;
62  AgendaWrapper( AgendaWrapper &&) = delete;
63  AgendaWrapper& operator=(const AgendaWrapper &) = delete;
64  AgendaWrapper& operator=( AgendaWrapper &&) = delete;
65 
66 
68 
79  OEMMatrixReference Jacobian(const OEMVector & xi,
80  OEMVector & yi_)
81  {
82  if (!reuse_jacobian)
83  {
85  *ws, yi, jacobian, xi, 1, 0,
87  yi_ = yi;
88  iteration_counter += 1;
89  } else {
90  reuse_jacobian = false;
91  yi_ = yi;
92  }
93  return jacobian;
94  }
95 
97 
105  OEMVector evaluate(const OEMVector &xi)
106  {
107  if (!reuse_jacobian)
108  {
109  Matrix dummy;
111  *ws, yi, dummy, xi, 0, iteration_counter,
113  } else {
114  reuse_jacobian = false;
115  }
116  return yi;
117  }
118 
119 private:
120 
124  unsigned int iteration_counter;
125 
126 };
127 
128 #endif // agenda_wrappers_h
const Agenda * inversion_iterate_agenda
Wrapper class for forward model.
The Agenda class.
Definition: agenda_class.h:44
void inversion_iterate_agendaExecute(Workspace &ws, Vector &yf, Matrix &jacobian, const Vector &x, const Index jacobian_do, const Index inversion_iteration_counter, const Agenda &input_agenda)
Definition: auto_md.cc:23933
The Vector class.
Definition: matpackI.h:860
AgendaWrapper & operator=(const AgendaWrapper &)=delete
const unsigned int m
OEMVector yi
OEMVector evaluate(const OEMVector &xi)
Evaluate forward model.
const unsigned int n
The Matrix class.
Definition: matpackI.h:1193
AgendaWrapper(Workspace *ws_, unsigned int m_, unsigned int n_, Matrix &jacobian_, Vector &yi_, const Agenda *inversion_iterate_agenda_)
Create inversion_iterate_agendaExecute wrapper.
OEMMatrixReference Jacobian(const OEMVector &xi, OEMVector &yi_)
Evaluate forward model and compute Jacobian.
unsigned int iteration_counter
OEMMatrixReference jacobian
Defines the ARTS interface to the invlib library.
Index nelem(const Lines &l)
Number of lines.
Workspace class.
Definition: workspace_ng.h:40
Workspace * ws