GPLIB++
|
The basic object for any objective function, mainly an interface class and some storage. More...
#include <GeneralObjective.h>
Public Member Functions | |
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... | |
virtual double | PostParallel (const ttranscribed &member)=0 |
Some operations cannot be done in parallel, these are done after, returns the misfit value. More... | |
virtual void | SafeParallel (const ttranscribed &member) |
The core performance calculation, has to be safe to be done in parallel. 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 | |
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) |
The basic object for any objective function, mainly an interface class and some storage.
All objective functions should be derived from this class to be usable with the genetic algorithms. Also the linearized classes use this base class to access objective functions. The main functionality is implemented in the three functions PreParallel, SafeParallel and PostParallel. This division is ncessary to account for various types of computations in a parallel environment. In addition derived classes have to implement the clone function and a copy constructor and operator.
Definition at line 17 of file GeneralObjective.h.
gplib::GeneralObjective::GeneralObjective | ( | ) |
Definition at line 7 of file GeneralObjective.cpp.
gplib::GeneralObjective::GeneralObjective | ( | const GeneralObjective & | Old | ) |
Definition at line 16 of file GeneralObjective.cpp.
|
virtual |
Definition at line 12 of file GeneralObjective.cpp.
|
protected |
Definition at line 53 of file GeneralObjective.cpp.
References GetFitExponent(), SetMisfit(), and SetSynthData().
Referenced by gplib::AbsVelRecObjective::PostParallel(), gplib::C1DRecObjective::PostParallel(), gplib::PTensor1DMTObjective::SafeParallel(), gplib::C1DMTObjective::SafeParallel(), gplib::SurfaceWaveObjective::SafeParallel(), and gplib::AnisoSurfaceWaveObjective::SafeParallel().
double gplib::GeneralObjective::CalcPerformance | ( | const ttranscribed & | member | ) |
For serial execution CalcPerformance calls the three Parallel functions for more convenient use.
Definition at line 46 of file GeneralObjective.cpp.
References PostParallel(), PreParallel(), and SafeParallel().
Referenced by init(), main(), misfit(), and gplib::MTRecObjective::PostParallel().
|
pure virtual |
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.
Implemented in gplib::C1DRecObjective, gplib::AnisoSurfaceWaveObjective, gplib::PTensor1DMTObjective, gplib::SurfaceWaveObjective, gplib::Iso1DMTObjective, gplib::MTAnisoRoughness, gplib::MTRecObjective, gplib::SWAnisoRoughness, gplib::AbsVelRecObjective, gplib::Aniso1DMTObjective, gplib::MultiAnisoSurfaceWaveObjective, gplib::Multi1DRecObjective, gplib::CombinedRoughness, gplib::SeismicModelDiff, gplib::TestObjective2, gplib::TestObjective, and gplib::MTRoughness.
|
inline |
Get the Fit exponent.
Definition at line 63 of file GeneralObjective.h.
Referenced by CalcMisfit(), gplib::AbsVelRecObjective::PostParallel(), gplib::C1DRecObjective::PostParallel(), gplib::MTRoughness::SafeParallel(), gplib::SWAnisoRoughness::SafeParallel(), gplib::PTensor1DMTObjective::SafeParallel(), gplib::CombinedRoughness::SafeParallel(), gplib::MTAnisoRoughness::SafeParallel(), gplib::C1DMTObjective::SafeParallel(), gplib::SurfaceWaveObjective::SafeParallel(), and gplib::AnisoSurfaceWaveObjective::SafeParallel().
|
inline |
Return the misfit vector.
Definition at line 83 of file GeneralObjective.h.
Referenced by misfit(), gplib::MTRecObjective::PostParallel(), and gplib::AbsVelRecObjective::PostParallel().
|
inline |
Derived classes need to read the ParallelId for their forward calculations.
Definition at line 73 of file GeneralObjective.h.
Referenced by gplib::C1DRecObjective::PostParallel(), gplib::MultiAnisoSurfaceWaveObjective::PreParallel(), gplib::SurfaceWaveObjective::PreParallel(), gplib::AnisoSurfaceWaveObjective::PreParallel(), gplib::C1DRecObjective::PreParallel(), gplib::SurfaceWaveObjective::SafeParallel(), gplib::AnisoSurfaceWaveObjective::SafeParallel(), and gplib::C1DRecObjective::SafeParallel().
|
inline |
Get the current RMS.
Definition at line 68 of file GeneralObjective.h.
Referenced by gplib::MTRoughness::PostParallel(), gplib::SeismicModelDiff::PostParallel(), gplib::SWAnisoRoughness::PostParallel(), gplib::PTensor1DMTObjective::PostParallel(), gplib::CombinedRoughness::PostParallel(), gplib::MTAnisoRoughness::PostParallel(), gplib::C1DMTObjective::PostParallel(), gplib::AbsVelRecObjective::PostParallel(), gplib::SurfaceWaveObjective::PostParallel(), gplib::AnisoSurfaceWaveObjective::PostParallel(), and gplib::C1DRecObjective::PostParallel().
|
inline |
Return the current synthetic data.
Definition at line 88 of file GeneralObjective.h.
Referenced by main(), gplib::MTRecObjective::PostParallel(), and gplib::AbsVelRecObjective::PostParallel().
GeneralObjective & gplib::GeneralObjective::operator= | ( | const GeneralObjective & | source | ) |
Definition at line 22 of file GeneralObjective.cpp.
Referenced by gplib::MTRoughness::operator=(), gplib::SeismicModelDiff::operator=(), gplib::SWAnisoRoughness::operator=(), gplib::PlottableObjective::operator=(), gplib::CombinedRoughness::operator=(), and gplib::MTAnisoRoughness::operator=().
|
pure virtual |
Some operations cannot be done in parallel, these are done after, returns the misfit value.
Implemented in gplib::C1DRecObjective, gplib::AnisoSurfaceWaveObjective, gplib::SurfaceWaveObjective, gplib::AbsVelRecObjective, gplib::C1DMTObjective, gplib::Multi1DRecObjective, gplib::MTAnisoRoughness, gplib::CombinedRoughness, gplib::MTRecObjective, gplib::PTensor1DMTObjective, gplib::MultiAnisoSurfaceWaveObjective, gplib::SWAnisoRoughness, gplib::SeismicModelDiff, gplib::TestObjective2, gplib::TestObjective, and gplib::MTRoughness.
Referenced by CalcPerformance().
|
virtual |
Some operations cannot be done in parallel, these are done before.
Reimplemented in gplib::C1DRecObjective, gplib::AnisoSurfaceWaveObjective, gplib::SurfaceWaveObjective, gplib::Multi1DRecObjective, and gplib::MultiAnisoSurfaceWaveObjective.
Definition at line 36 of file GeneralObjective.cpp.
Referenced by CalcPerformance().
|
virtual |
The core performance calculation, has to be safe to be done in parallel.
Reimplemented in gplib::C1DRecObjective, gplib::AnisoSurfaceWaveObjective, gplib::SurfaceWaveObjective, gplib::Multi1DRecObjective, gplib::C1DMTObjective, gplib::MultiAnisoSurfaceWaveObjective, gplib::MTAnisoRoughness, gplib::CombinedRoughness, gplib::PTensor1DMTObjective, gplib::SWAnisoRoughness, gplib::SeismicModelDiff, and gplib::MTRoughness.
Definition at line 41 of file GeneralObjective.cpp.
Referenced by CalcPerformance().
|
inline |
Set the Fit exponent.
Definition at line 58 of file GeneralObjective.h.
|
inlineprotected |
Only derived classes can write access the Misfit.
Definition at line 38 of file GeneralObjective.h.
Referenced by CalcMisfit(), gplib::MTRecObjective::PostParallel(), gplib::AbsVelRecObjective::PostParallel(), gplib::C1DRecObjective::PostParallel(), gplib::PTensor1DMTObjective::SafeParallel(), gplib::C1DMTObjective::SafeParallel(), gplib::SurfaceWaveObjective::SafeParallel(), and gplib::AnisoSurfaceWaveObjective::SafeParallel().
|
inlineprotected |
Definition at line 42 of file GeneralObjective.h.
|
inline |
We need to set the parallel ID outside the Objective function object.
Definition at line 78 of file GeneralObjective.h.
|
inlineprotected |
Definition at line 33 of file GeneralObjective.h.
Referenced by gplib::MTRecObjective::PostParallel(), gplib::AbsVelRecObjective::PostParallel(), gplib::C1DRecObjective::PostParallel(), gplib::MTRoughness::SafeParallel(), gplib::SeismicModelDiff::SafeParallel(), gplib::SWAnisoRoughness::SafeParallel(), gplib::PTensor1DMTObjective::SafeParallel(), gplib::CombinedRoughness::SafeParallel(), gplib::MTAnisoRoughness::SafeParallel(), gplib::C1DMTObjective::SafeParallel(), gplib::SurfaceWaveObjective::SafeParallel(), and gplib::AnisoSurfaceWaveObjective::SafeParallel().
|
inlineprotected |
Only derived classes can write access the Synthetic data.
Definition at line 47 of file GeneralObjective.h.
Referenced by CalcMisfit(), gplib::MTRecObjective::PostParallel(), gplib::AbsVelRecObjective::PostParallel(), gplib::C1DRecObjective::PostParallel(), gplib::PTensor1DMTObjective::SafeParallel(), gplib::C1DMTObjective::SafeParallel(), gplib::SurfaceWaveObjective::SafeParallel(), and gplib::AnisoSurfaceWaveObjective::SafeParallel().
|
inlineprotected |
Definition at line 52 of file GeneralObjective.h.