GPLIB++
|
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>
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_t > | datafuncvector_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_t & | GetErrorFunctions () 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 () |
C1DMTObjective & | operator= (const C1DMTObjective &source) |
Public Member Functions inherited from gplib::PlottableObjective | |
PlottableObjective () | |
PlottableObjective (const PlottableObjective &Old) | |
PlottableObjective & | operator= (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 tmisfit & | GetMisfit () |
Return the misfit vector. More... | |
const tdata & | GetSynthData () |
Return the current synthetic data. More... | |
virtual GeneralObjective * | clone () 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) | |
GeneralObjective & | operator= (const GeneralObjective &source) |
virtual | ~GeneralObjective () |
Protected Member Functions | |
virtual MTStation & | GetMTSynth ()=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) |
tmisfit & | SetMisfit () |
Only derived classes can write access the Misfit. More... | |
void | SetMisfit (const tmisfit &LocalMisfit) |
tdata & | SetSynthData () |
Only derived classes can write access the Synthetic data. More... | |
void | SetSynthData (const tdata &LocalSynthData) |
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.
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.
typedef std::vector<datafunc_t> gplib::C1DMTObjective::datafuncvector_t |
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.
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.
|
virtual |
Definition at line 31 of file C1DMTObjective.cpp.
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.
TheDataFunc | The data to fit. A reference to function that takes a MTTensor* const and returns a double. e.g. &MTTensor::GetPhixy to fit xy phase |
TheErrorFunc | The error associated with the data. Also a reference to function that takes a MTTensor* const and returns a double. e.g. &MTTensor::GetdPhixy |
TheErrLevel | The relative error floor for this type of data |
Definition at line 96 of file C1DMTObjective.cpp.
Referenced by gplib::SetupMTFitParameters().
|
inline |
return a vector with pointers to the functions used to calculate the errors
Definition at line 45 of file C1DMTObjective.h.
|
protectedpure virtual |
Referenced by SafeParallel().
C1DMTObjective & gplib::C1DMTObjective::operator= | ( | const C1DMTObjective & | source | ) |
Definition at line 42 of file C1DMTObjective.cpp.
References gplib::PlottableObjective::operator=().
Referenced by gplib::Aniso1DMTObjective::operator=(), and gplib::Iso1DMTObjective::operator=().
|
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().
|
virtual |
Calc misfit for a model given by member.
Calculate synthetics from the model given by member and compare with Data given the fitparameters
Reimplemented from gplib::GeneralObjective.
Definition at line 120 of file C1DMTObjective.cpp.
References gplib::GeneralObjective::CalcMisfit(), gplib::GeneralObjective::GetFitExponent(), gplib::MTStation::GetFrequencies(), gplib::MTStation::GetMTData(), GetMTSynth(), gplib::MTStation::SetFrequencies(), gplib::GeneralObjective::SetMisfit(), gplib::GeneralObjective::SetRMS(), and gplib::GeneralObjective::SetSynthData().
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
TheDataV | A vector containing pointers to functions that return the data to fit as a double when given a *MTTensor |
TheErrorV | A similar vector of pointers to functions that return the corresponding error |
TheErrLevel | The 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.
|
pure virtual |
Write current data to a file.
Reimplemented from gplib::PlottableObjective.
Implemented in gplib::Iso1DMTObjective, and gplib::Aniso1DMTObjective.
|
pure virtual |
write the current model to a file
Reimplemented from gplib::PlottableObjective.
Implemented in gplib::Iso1DMTObjective, and gplib::Aniso1DMTObjective.
|
pure virtual |
write the current model for plotting to a file
Reimplemented from gplib::PlottableObjective.
Implemented in gplib::Iso1DMTObjective, and gplib::Aniso1DMTObjective.