ReFRACtor
nlls_max_a_posteriori.h
Go to the documentation of this file.
1 #ifndef NLLS_MAX_A_POSTERIORI_H
2 #define NLLS_MAX_A_POSTERIORI_H
3 #include <max_a_posteriori.h>
4 #include <nlls_problem.h>
5 #include <nlls_problem_state.h>
6 #include <boost/shared_ptr.hpp>
7 
8 namespace FullPhysics {
9 /******************************************************************
10  This class casts a maximum a posteriori problem into the
11  Nonlinear Least Squares problem.
12 *******************************************************************/
14  public NLLSProblem, public NLLSProblemState {
15 
16 public:
17 
18 //-----------------------------------------------------------------------
20 //-----------------------------------------------------------------------
21 
23  : NLLSProblem(), NLLSProblemState(), MAP(map)
24  {}
25 
26  virtual ~NLLSMaxAPosteriori() {}
27 
28 
29 //-----------------------------------------------------------------------
34 //-----------------------------------------------------------------------
35 
36  virtual blitz::Array<double, 1> residual();
37 
38 
39 //-----------------------------------------------------------------------
44 //-----------------------------------------------------------------------
45 
46  virtual blitz::Array<double, 2> jacobian();
47 
48 
49 //-----------------------------------------------------------------------
51 //-----------------------------------------------------------------------
52 
53  virtual int residual_size() const
54  { return MAP->measurement_size()+MAP->expected_parameter_size(); }
55 
56 
57 //-----------------------------------------------------------------------
59 //-----------------------------------------------------------------------
60 
61  virtual int expected_parameter_size() const
62  { return MAP->expected_parameter_size(); }
63 
64 
65 //-----------------------------------------------------------------------
69 //-----------------------------------------------------------------------
70 
71  virtual void parameters(const blitz::Array<double, 1>& x);
72 
73 
74 //-----------------------------------------------------------------------
81 //-----------------------------------------------------------------------
82 
83  virtual blitz::Array<double, 1> parameters() const
84  { return NLLSProblemState::parameters(); }
85 
86 
87 
89  { return MAP; }
90 
91 
92 //-----------------------------------------------------------------------
94 //-----------------------------------------------------------------------
95 
96  virtual void print(std::ostream& Os) const
97  { Os << "NLLSMaxAPosteriori"; }
98 
99 
100 protected:
101 
103 
104 };
105 }
106 #endif
virtual blitz::Array< double, 1 > residual()
Return the residual of the NLLS problem at the current set point.
virtual blitz::Array< double, 1 > parameters() const
Returns the current parameters.
virtual void print(std::ostream &Os) const
Print description of object.
The state for a NLLS problem with implemented residual function and its Jacobian. ...
virtual int residual_size() const
Return the size of the residual that will be returned by residual()
The base class for the Non-Linear Least Squares problem.
Definition: nlls_problem.h:54
virtual blitz::Array< double, 2 > jacobian()
Return the Jacobian of the residual of the NLLS problem at the current set point. ...
const boost::shared_ptr< MaxAPosteriori > MAP
virtual blitz::Array< double, 1 > parameters() const
Just returns the current values of parameters.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
NLLSMaxAPosteriori(const boost::shared_ptr< MaxAPosteriori > &map)
Constructor.
virtual int expected_parameter_size() const
Return the expected size of the parameter X.
boost::shared_ptr< MaxAPosteriori > max_a_posteriori()

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:10