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

The basic object for any objective function, mainly an interface class and some storage. More...

#include <GeneralObjective.h>

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

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 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...
 
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)
 
GeneralObjectiveoperator= (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)
 
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

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.

Constructor & Destructor Documentation

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.

gplib::GeneralObjective::~GeneralObjective ( )
virtual

Definition at line 12 of file GeneralObjective.cpp.

Member Function Documentation

double gplib::GeneralObjective::CalcMisfit ( const double  measured,
const double  predicted,
const double  measerror,
const double  errorlevel,
const int  index 
)
protected
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().

virtual GeneralObjective* gplib::GeneralObjective::clone ( ) const
pure virtual
int gplib::GeneralObjective::GetFitExponent ( )
inline
const tmisfit& gplib::GeneralObjective::GetMisfit ( )
inline

Return the misfit vector.

Definition at line 83 of file GeneralObjective.h.

Referenced by misfit(), gplib::MTRecObjective::PostParallel(), and gplib::AbsVelRecObjective::PostParallel().

const std::string& gplib::GeneralObjective::GetParallelID ( )
inline
double gplib::GeneralObjective::GetRMS ( )
inline
const tdata& gplib::GeneralObjective::GetSynthData ( )
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)
virtual double gplib::GeneralObjective::PostParallel ( const ttranscribed member)
pure virtual
void gplib::GeneralObjective::PreParallel ( const ttranscribed member)
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().

void gplib::GeneralObjective::SafeParallel ( const ttranscribed member)
virtual
void gplib::GeneralObjective::SetFitExponent ( const int  x)
inline

Set the Fit exponent.

Definition at line 58 of file GeneralObjective.h.

tmisfit& gplib::GeneralObjective::SetMisfit ( )
inlineprotected
void gplib::GeneralObjective::SetMisfit ( const tmisfit LocalMisfit)
inlineprotected

Definition at line 42 of file GeneralObjective.h.

void gplib::GeneralObjective::SetParallelID ( const std::string &  s)
inline

We need to set the parallel ID outside the Objective function object.

Definition at line 78 of file GeneralObjective.h.

void gplib::GeneralObjective::SetRMS ( const double  x)
inlineprotected
tdata& gplib::GeneralObjective::SetSynthData ( )
inlineprotected
void gplib::GeneralObjective::SetSynthData ( const tdata LocalSynthData)
inlineprotected

Definition at line 52 of file GeneralObjective.h.


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