ReFRACtor
nlls_max_likelihood.h
Go to the documentation of this file.
1 #ifndef NLLS_MAX_LIKELIHOOD_H
2 #define NLLS_MAX_LIKELIHOOD_H
3 #include <max_likelihood.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 likelihood problem into the
11  Nonlinear Least Squares problem.
12 *******************************************************************/
14  public NLLSProblem, public NLLSProblemState {
15 
16 public:
17 
18 //-----------------------------------------------------------------------
20 //-----------------------------------------------------------------------
21 
23  : NLLSProblem(), NLLSProblemState(), ML(ml)
24  {}
25 
26  virtual ~NLLSMaxLikelihood() {}
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 ML->measurement_size(); }
55 
56 
57 //-----------------------------------------------------------------------
59 //-----------------------------------------------------------------------
60 
61  virtual int expected_parameter_size() const
62  { return ML->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 
88  { return ML; }
89 
90 
91 //-----------------------------------------------------------------------
93 //-----------------------------------------------------------------------
94 
95  virtual void print(std::ostream& Os) const
96  { Os << "NLLSMaxLikelihood"; }
97 
98 
99 protected:
100 
102 
103 };
104 }
105 #endif
virtual blitz::Array< double, 1 > parameters() const
Returns the current parameters.
virtual int residual_size() const
Return the size of the residual that will be returned by residual()
virtual blitz::Array< double, 1 > parameters() const
Just returns the current values of parameters.
boost::shared_ptr< MaxLikelihood > max_likelihood()
The state for a NLLS problem with implemented residual function and its Jacobian. ...
NLLSMaxLikelihood(const boost::shared_ptr< MaxLikelihood > &ml)
Constructor.
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. ...
virtual int expected_parameter_size() const
Return the size of the parameter X.
virtual void print(std::ostream &Os) const
Print description of object.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
virtual blitz::Array< double, 1 > residual()
Return the residual of the NLLS problem at the current set point.
const boost::shared_ptr< MaxLikelihood > ML

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