GPLIB++
Public Types | Public Member Functions | Protected Member Functions | List of all members
gplib::C1DMTObjective Class Referenceabstract

C1DMTObjective is the base class for MT misfit calculations from 1D models, it provides common functionality to calculate the misfit of various MT parameters. More...

#include <C1DMTObjective.h>

Inheritance diagram for gplib::C1DMTObjective:
Inheritance graph
[legend]

Public Types

typedef boost::function
< double(const MTTensor *const )> 
datafunc_t
 A function that returns a real valued quantity calculated from an MT impedance tensor. More...
 
typedef std::vector< datafunc_tdatafuncvector_t
 A vector of MT data functions. This is used to store the types of data to fit. More...
 

Public Member Functions

void SetFitParameters (const datafuncvector_t TheDataV, const datafuncvector_t TheErrorV, const std::vector< double > TheErrLevel)
 function to set the parameters that determine the type of fit More...
 
void AppendFitParameters (const datafunc_t TheDataFunc, const datafunc_t TheErrorFunc, const double TheErrLevel)
 
virtual void SafeParallel (const ttranscribed &member)
 Calc misfit for a model given by member. More...
 
virtual double PostParallel (const ttranscribed &member)
 All calculation has been done in SafeParallel we only return the stored result. More...
 
const datafuncvector_tGetErrorFunctions () const
 return a vector with pointers to the functions used to calculate the errors More...
 
virtual void WriteModel (const std::string &filename)=0
 write the current model to a file More...
 
virtual void WritePlot (const std::string &filename)=0
 write the current model for plotting to a file More...
 
virtual void WriteData (const std::string &filename)=0
 Write current data to a file. More...
 
 C1DMTObjective (const MTStation &LocalMTData)
 We need data to fit for any objective function, so we want it as constructor parameter, but no implicit conversion. More...
 
 C1DMTObjective (const C1DMTObjective &Old)
 
virtual ~C1DMTObjective ()
 
C1DMTObjectiveoperator= (const C1DMTObjective &source)
 
- Public Member Functions inherited from gplib::PlottableObjective
 PlottableObjective ()
 
 PlottableObjective (const PlottableObjective &Old)
 
PlottableObjectiveoperator= (const PlottableObjective &source)
 
virtual ~PlottableObjective ()
 
- Public Member Functions inherited from gplib::GeneralObjective
void SetFitExponent (const int x)
 Set the Fit exponent. More...
 
int GetFitExponent ()
 Get the Fit exponent. More...
 
double GetRMS ()
 Get the current RMS. More...
 
const std::string & GetParallelID ()
 Derived classes need to read the ParallelId for their forward calculations. More...
 
void SetParallelID (const std::string &s)
 We need to set the parallel ID outside the Objective function object. More...
 
const tmisfitGetMisfit ()
 Return the misfit vector. More...
 
const tdataGetSynthData ()
 Return the current synthetic data. More...
 
virtual GeneralObjectiveclone () const =0
 We need clone and create for building an array of derived objects, see FAQ lite 20.8, the return type depends on the derived class. More...
 
virtual void PreParallel (const ttranscribed &member)
 Some operations cannot be done in parallel, these are done before. More...
 
double CalcPerformance (const ttranscribed &member)
 For serial execution CalcPerformance calls the three Parallel functions for more convenient use. More...
 
 GeneralObjective ()
 
 GeneralObjective (const GeneralObjective &Old)
 
GeneralObjectiveoperator= (const GeneralObjective &source)
 
virtual ~GeneralObjective ()
 

Protected Member Functions

virtual MTStationGetMTSynth ()=0
 
- Protected Member Functions inherited from gplib::GeneralObjective
double CalcMisfit (const double measured, const double predicted, const double measerror, const double errorlevel, const int index)
 
void SetRMS (const double x)
 
tmisfitSetMisfit ()
 Only derived classes can write access the Misfit. More...
 
void SetMisfit (const tmisfit &LocalMisfit)
 
tdataSetSynthData ()
 Only derived classes can write access the Synthetic data. More...
 
void SetSynthData (const tdata &LocalSynthData)
 

Detailed Description

C1DMTObjective is the base class for MT misfit calculations from 1D models, it provides common functionality to calculate the misfit of various MT parameters.

Definition at line 11 of file C1DMTObjective.h.

Member Typedef Documentation

typedef boost::function<double(const MTTensor* const )> gplib::C1DMTObjective::datafunc_t

A function that returns a real valued quantity calculated from an MT impedance tensor.

Definition at line 16 of file C1DMTObjective.h.

A vector of MT data functions. This is used to store the types of data to fit.

Definition at line 18 of file C1DMTObjective.h.

Constructor & Destructor Documentation

gplib::C1DMTObjective::C1DMTObjective ( const MTStation LocalMTData)

We need data to fit for any objective function, so we want it as constructor parameter, but no implicit conversion.

Definition at line 19 of file C1DMTObjective.cpp.

References gplib::MTTensor::GetdPhixy(), and gplib::MTTensor::GetPhixy().

gplib::C1DMTObjective::C1DMTObjective ( const C1DMTObjective Old)

Definition at line 35 of file C1DMTObjective.cpp.

gplib::C1DMTObjective::~C1DMTObjective ( )
virtual

Definition at line 31 of file C1DMTObjective.cpp.

Member Function Documentation

void gplib::C1DMTObjective::AppendFitParameters ( const datafunc_t  TheDataFunc,
const datafunc_t  TheErrorFunc,
const double  TheErrLevel 
)

Add a new type of MT data to the vector of quantities to fit. The first call overrides the default xy phase that is set by the constructor.

Parameters
TheDataFuncThe data to fit. A reference to function that takes a MTTensor* const and returns a double. e.g. &MTTensor::GetPhixy to fit xy phase
TheErrorFuncThe error associated with the data. Also a reference to function that takes a MTTensor* const and returns a double. e.g. &MTTensor::GetdPhixy
TheErrLevelThe relative error floor for this type of data

Definition at line 96 of file C1DMTObjective.cpp.

Referenced by gplib::SetupMTFitParameters().

const datafuncvector_t& gplib::C1DMTObjective::GetErrorFunctions ( ) const
inline

return a vector with pointers to the functions used to calculate the errors

Definition at line 45 of file C1DMTObjective.h.

virtual MTStation& gplib::C1DMTObjective::GetMTSynth ( )
protectedpure virtual

Referenced by SafeParallel().

C1DMTObjective & gplib::C1DMTObjective::operator= ( const C1DMTObjective source)
double gplib::C1DMTObjective::PostParallel ( const ttranscribed member)
virtual

All calculation has been done in SafeParallel we only return the stored result.

Implements gplib::GeneralObjective.

Definition at line 183 of file C1DMTObjective.cpp.

References gplib::GeneralObjective::GetRMS().

void gplib::C1DMTObjective::SafeParallel ( const ttranscribed member)
virtual
void gplib::C1DMTObjective::SetFitParameters ( const datafuncvector_t  TheDataV,
const datafuncvector_t  TheErrorV,
const std::vector< double >  TheErrLevel 
)

function to set the parameters that determine the type of fit

Instead of seperate access functions, we force the user to set all of them if he doesn't want defaults

This functions takes three parameters

Parameters
TheDataVA vector containing pointers to functions that return the data to fit as a double when given a *MTTensor
TheErrorVA similar vector of pointers to functions that return the corresponding error
TheErrLevelThe relative errorlevel that corresponds to the data function

All three vectors have to be of the same size and have at least one entry to work

Definition at line 70 of file C1DMTObjective.cpp.

virtual void gplib::C1DMTObjective::WriteData ( const std::string &  filename)
pure virtual

Write current data to a file.

Reimplemented from gplib::PlottableObjective.

Implemented in gplib::Iso1DMTObjective, and gplib::Aniso1DMTObjective.

virtual void gplib::C1DMTObjective::WriteModel ( const std::string &  filename)
pure virtual

write the current model to a file

Reimplemented from gplib::PlottableObjective.

Implemented in gplib::Iso1DMTObjective, and gplib::Aniso1DMTObjective.

virtual void gplib::C1DMTObjective::WritePlot ( const std::string &  filename)
pure virtual

write the current model for plotting to a file

Reimplemented from gplib::PlottableObjective.

Implemented in gplib::Iso1DMTObjective, and gplib::Aniso1DMTObjective.


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