ReFRACtor
FullPhysics::CompositeInitialGuess Class Reference

A common way to create an initial guess is to have other classes responsible for portions of the state vector (e.g., an Atmosphere class creates the portion of the initial guess that handles the description of the atmosphere layers). More...

#include <composite_initial_guess.h>

+ Inheritance diagram for FullPhysics::CompositeInitialGuess:
+ Collaboration diagram for FullPhysics::CompositeInitialGuess:

Public Member Functions

virtual ~CompositeInitialGuess ()
 
void add_builder (const boost::shared_ptr< InitialGuessBuilder > &B)
 Add a builder to the build list. More...
 
virtual blitz::Array< double, 1 > apriori () const
 Return the apriori state vector to use. More...
 
virtual blitz::Array< double, 2 > apriori_covariance () const
 Return the apriori state vector covariance to use. More...
 
virtual void attach_notify (CompositeInitialGuess &Comp_ig)
 Called when we get attached to a CompositeInitialGuess. More...
 
virtual void build_apriori (blitz::Array< double, 1 > &v, int index) const
 Called when we need this class to do its part in setting up the apriori state vector. More...
 
virtual void build_apriori_covariance (blitz::Array< double, 2 > &m, int index) const
 Called when we need this class to do its part in setting up the covariance matrix for the a priori state vector. More...
 
virtual void build_initial_value (blitz::Array< double, 1 > &v, int index) const
 Called when we need this class to do its part in setting up the initial state vector. More...
 
virtual blitz::Array< double, 1 > initial_guess () const
 Return the initial state vector to use. More...
 
virtual int number_element () const
 Number of elements that will be in the state vector. More...
 
virtual void print (std::ostream &Os) const
 Print description of object. More...
 
std::string print_to_string () const
 Print to string. More...
 
std::string print_to_string () const
 Print to string. More...
 
void remove_builder (const boost::shared_ptr< InitialGuessBuilder > &B)
 Remove a builder to the build list. More...
 

Detailed Description

A common way to create an initial guess is to have other classes responsible for portions of the state vector (e.g., an Atmosphere class creates the portion of the initial guess that handles the description of the atmosphere layers).

This class implements this division.

This is an example of the "Builder" design pattern. This class is what is commonly called the "Director", and the InitialGuessBuilder classes are the "Builder" classes.

Note that the InitialGuessBuilder objects are called in the order they are added to the CompositeInitialGuess object. A common InitialGuessBuilder adds additional values to the end state vector, so the order is important.

A CompositeInitialGuess is also a InitialGuessBuilder, so you can use this to nest initial guess builders.

Definition at line 102 of file composite_initial_guess.h.

Constructor & Destructor Documentation

◆ ~CompositeInitialGuess()

virtual FullPhysics::CompositeInitialGuess::~CompositeInitialGuess ( )
inlinevirtual

Definition at line 105 of file composite_initial_guess.h.

Member Function Documentation

◆ add_builder()

void FullPhysics::CompositeInitialGuess::add_builder ( const boost::shared_ptr< InitialGuessBuilder > &  B)
inline

Add a builder to the build list.

Definition at line 122 of file composite_initial_guess.h.

◆ apriori()

blitz::Array< double, 1 > CompositeInitialGuess::apriori ( ) const
virtual

Return the apriori state vector to use.

Implements FullPhysics::InitialGuess.

Definition at line 64 of file composite_initial_guess.cc.

◆ apriori_covariance()

blitz::Array< double, 2 > CompositeInitialGuess::apriori_covariance ( ) const
virtual

Return the apriori state vector covariance to use.

Implements FullPhysics::InitialGuess.

Definition at line 79 of file composite_initial_guess.cc.

◆ attach_notify()

virtual void FullPhysics::InitialGuessBuilder::attach_notify ( CompositeInitialGuess Comp_ig)
inlinevirtualinherited

Called when we get attached to a CompositeInitialGuess.

The default is to do nothing, but derived classes can override this if desired.

Definition at line 28 of file composite_initial_guess.h.

◆ build_apriori()

void CompositeInitialGuess::build_apriori ( blitz::Array< double, 1 > &  v,
int  index 
) const
virtual

Called when we need this class to do its part in setting up the apriori state vector.

Parameters
vState vector that should be updated in place.
indexSince we are often adding to the end of the state vector, index is passed in. This is the sum of the number_elements() of all the InitialGuessBuilder that appear before this object in the list.

Implements FullPhysics::InitialGuessBuilder.

Definition at line 112 of file composite_initial_guess.cc.

◆ build_apriori_covariance()

void CompositeInitialGuess::build_apriori_covariance ( blitz::Array< double, 2 > &  m,
int  index 
) const
virtual

Called when we need this class to do its part in setting up the covariance matrix for the a priori state vector.

Parameters
mState vector that should be updated in place.
indexSince we are often adding to the end of the state vector, index is passed in. This is the sum of the number_elements() of all the InitialGuessBuilder that appear before this object in the list.

Implements FullPhysics::InitialGuessBuilder.

Definition at line 120 of file composite_initial_guess.cc.

◆ build_initial_value()

void CompositeInitialGuess::build_initial_value ( blitz::Array< double, 1 > &  v,
int  index 
) const
virtual

Called when we need this class to do its part in setting up the initial state vector.

Parameters
vState vector that should be updated in place.
indexSince we are often adding to the end of the state vector, index is passed in. This is the sum of the number_elements() of all the InitialGuessBuilder that appear before this object in the list.

Implements FullPhysics::InitialGuessBuilder.

Definition at line 104 of file composite_initial_guess.cc.

◆ initial_guess()

blitz::Array< double, 1 > CompositeInitialGuess::initial_guess ( ) const
virtual

Return the initial state vector to use.

Implements FullPhysics::InitialGuess.

Definition at line 37 of file composite_initial_guess.cc.

◆ number_element()

int CompositeInitialGuess::number_element ( ) const
virtual

Number of elements that will be in the state vector.

Implements FullPhysics::InitialGuessBuilder.

Definition at line 52 of file composite_initial_guess.cc.

◆ print()

void CompositeInitialGuess::print ( std::ostream &  Os) const
virtual

Print description of object.

Reimplemented from FullPhysics::InitialGuessBuilder.

Definition at line 98 of file composite_initial_guess.cc.

◆ print_to_string() [1/2]

std::string FullPhysics::Printable< InitialGuess >::print_to_string ( ) const
inlineinherited

Print to string.

This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.

Definition at line 31 of file printable.h.

◆ print_to_string() [2/2]

std::string FullPhysics::Printable< InitialGuessBuilder >::print_to_string ( ) const
inlineinherited

Print to string.

This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.

Definition at line 31 of file printable.h.

◆ remove_builder()

void FullPhysics::CompositeInitialGuess::remove_builder ( const boost::shared_ptr< InitialGuessBuilder > &  B)
inline

Remove a builder to the build list.

Definition at line 132 of file composite_initial_guess.h.


The documentation for this class was generated from the following files:

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