GeneralObjective Class Reference

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

#include <GeneralObjective.h>

Inheritance diagram for GeneralObjective:

Inheritance graph
[legend]

List of all members.

Public Member Functions

void SetFitExponent (const int x)
 Set the Fit exponent.
int GetFitExponent ()
 Get the Fit exponent.
double GetRMS ()
 Get the current RMS.
const std::string & GetParallelID ()
 Derived classes need to read the ParallelId for their forward calculations.
void SetParallelID (const std::string &s)
 We need to set the parallel ID outside the Objective function object.
const tmisfitGetMisfit ()
 Return the misfit vector.
const tdataGetSynthData ()
 Return the current synthetic data.
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.
virtual void PreParallel (const ttranscribed &member)
 Some operations cannot be done in parallel, these are done before.
virtual double PostParallel (const ttranscribed &member)=0
 Some operations cannot be done in parallel, these are done after, returns the misfit value.
virtual void SafeParallel (const ttranscribed &member)
 The core performance calculation, has to be safe to be done in parallel.
double CalcPerformance (const ttranscribed &member)
 For serial execution CalcPerformance calls the three Parallel functions for more convenient use.
 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.
void SetMisfit (const tmisfit &LocalMisfit)
tdataSetSynthData ()
 Only derived classes can write access the Synthetic data.
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 13 of file GeneralObjective.h.


Constructor & Destructor Documentation

GeneralObjective::GeneralObjective (  ) 

Definition at line 5 of file GeneralObjective.cpp.

GeneralObjective::GeneralObjective ( const GeneralObjective Old  ) 

Definition at line 14 of file GeneralObjective.cpp.

GeneralObjective::~GeneralObjective (  )  [virtual]

Definition at line 10 of file GeneralObjective.cpp.


Member Function Documentation

double GeneralObjective::CalcMisfit ( const double  measured,
const double  predicted,
const double  measerror,
const double  errorlevel,
const int  index 
) [protected]

double GeneralObjective::CalcPerformance ( const ttranscribed member  ) 

For serial execution CalcPerformance calls the three Parallel functions for more convenient use.

Definition at line 43 of file GeneralObjective.cpp.

References PostParallel(), PreParallel(), and SafeParallel().

Referenced by CalcGradient(), CalcPartialDerivs(), init(), main(), misfit(), and MTRecObjective::PostParallel().

virtual GeneralObjective* GeneralObjective::clone (  )  const [pure virtual]

int GeneralObjective::GetFitExponent (  )  [inline]

const tmisfit& GeneralObjective::GetMisfit (  )  [inline]

Return the misfit vector.

Definition at line 79 of file GeneralObjective.h.

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

const std::string& GeneralObjective::GetParallelID (  )  [inline]

double GeneralObjective::GetRMS (  )  [inline]

const tdata& GeneralObjective::GetSynthData (  )  [inline]

Return the current synthetic data.

Definition at line 84 of file GeneralObjective.h.

Referenced by CalcPartialDerivs(), main(), MTRecObjective::PostParallel(), and AbsVelRecObjective::PostParallel().

GeneralObjective & GeneralObjective::operator= ( const GeneralObjective source  ) 

Definition at line 20 of file GeneralObjective.cpp.

References FitExponent, Misfit, ParallelId, RMS, and SynthData.

virtual double GeneralObjective::PostParallel ( const ttranscribed member  )  [pure virtual]

void GeneralObjective::PreParallel ( const ttranscribed member  )  [virtual]

Some operations cannot be done in parallel, these are done before.

Reimplemented in C1DRecObjective, Multi1DRecObjective, AnisoSurfaceWaveObjective, MultiAnisoSurfaceWaveObjective, and SurfaceWaveObjective.

Definition at line 33 of file GeneralObjective.cpp.

Referenced by CalcPerformance().

void GeneralObjective::SafeParallel ( const ttranscribed member  )  [virtual]

void GeneralObjective::SetFitExponent ( const int  x  )  [inline]

Set the Fit exponent.

Definition at line 54 of file GeneralObjective.h.

Referenced by main().

void GeneralObjective::SetMisfit ( const tmisfit LocalMisfit  )  [inline, protected]

Definition at line 38 of file GeneralObjective.h.

tmisfit& GeneralObjective::SetMisfit (  )  [inline, protected]

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

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

Definition at line 74 of file GeneralObjective.h.

void GeneralObjective::SetRMS ( const double  x  )  [inline, protected]

void GeneralObjective::SetSynthData ( const tdata LocalSynthData  )  [inline, protected]

Definition at line 48 of file GeneralObjective.h.

tdata& GeneralObjective::SetSynthData (  )  [inline, protected]


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

Generated on Tue Aug 4 16:04:19 2009 for GPLIB++ by  doxygen 1.5.8