ReFRACtor
composite_initial_guess.h
Go to the documentation of this file.
1 #ifndef COMPOSITE_INITIAL_GUESS_H
2 #define COMPOSITE_INITIAL_GUESS_H
3 #include "initial_guess.h"
4 #include <vector>
5 #include <list>
6 #include <boost/shared_ptr.hpp>
7 
8 namespace FullPhysics {
9 class CompositeInitialGuess;
10 /****************************************************************/
19 class InitialGuessBuilder : public Printable<InitialGuessBuilder> {
20 public:
21  virtual ~InitialGuessBuilder() {}
22 
23 //-----------------------------------------------------------------------
26 //-----------------------------------------------------------------------
27 
28  virtual void attach_notify(CompositeInitialGuess& Comp_ig)
29  { }
30 
31 //-----------------------------------------------------------------------
34 //-----------------------------------------------------------------------
35 
36  virtual int number_element() const = 0;
37 
38 //-----------------------------------------------------------------------
47 //-----------------------------------------------------------------------
48 
49  virtual void build_initial_value(blitz::Array<double, 1>& v, int index)
50  const = 0;
51 
52 //-----------------------------------------------------------------------
61 //-----------------------------------------------------------------------
62 
63  virtual void build_apriori(blitz::Array<double, 1>& v, int index) const = 0;
64 
65 //-----------------------------------------------------------------------
75 //-----------------------------------------------------------------------
76 
77  virtual void build_apriori_covariance(blitz::Array<double, 2>& m,
78  int index) const = 0;
79  virtual void print(std::ostream& Os) const {Os << "InitialGuessBuilder";}
80 };
81 
82 /****************************************************************/
103  public InitialGuessBuilder {
104 public:
106  virtual blitz::Array<double, 1> initial_guess() const;
107  virtual blitz::Array<double, 1> apriori() const;
108  virtual blitz::Array<double, 2> apriori_covariance() const;
109  virtual void print(std::ostream& Os) const;
110  virtual int number_element() const;
111 
112  virtual void build_initial_value(blitz::Array<double, 1>& v, int index)
113  const;
114  virtual void build_apriori(blitz::Array<double, 1>& v, int index) const;
115  virtual void build_apriori_covariance(blitz::Array<double, 2>& m,
116  int index) const;
117 
118 //-----------------------------------------------------------------------
120 //-----------------------------------------------------------------------
121 
123  {
124  blist.push_back(B);
125  B->attach_notify(*this);
126  }
127 
128 //-----------------------------------------------------------------------
130 //-----------------------------------------------------------------------
131 
133  {
134  blist.remove(B);
135  }
136 private:
137  std::list<boost::shared_ptr<InitialGuessBuilder> > blist;
138 };
139 }
140 #endif
void remove_builder(const boost::shared_ptr< InitialGuessBuilder > &B)
Remove a builder to the build list.
void add_builder(const boost::shared_ptr< InitialGuessBuilder > &B)
Add a builder to the build list.
virtual void build_apriori_covariance(blitz::Array< double, 2 > &m, int index) const =0
Called when we need this class to do its part in setting up the covariance matrix for the a priori st...
virtual void build_apriori(blitz::Array< double, 1 > &v, int index) const =0
Called when we need this class to do its part in setting up the apriori state vector.
virtual void build_initial_value(blitz::Array< double, 1 > &v, int index) const =0
Called when we need this class to do its part in setting up the initial state vector.
A common way to create an initial guess is to have other classes responsible for portions of the stat...
virtual void print(std::ostream &Os) const
This is a Mixin for classes that can be printed.
Definition: printable.h:24
Class that builds a portion of the state vector.
virtual void attach_notify(CompositeInitialGuess &Comp_ig)
Called when we get attached to a CompositeInitialGuess.
const Unit m("m", 1.0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
virtual int number_element() const =0
Number of elements we will be adding to the state vector.
This gets the initial guess and the apriori state vector values.
Definition: initial_guess.h:12

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