4 #include <boost/bind.hpp>
20 boost::shared_ptr<AnisoSurfaceWaveObjective> CurrObj(
22 IndividualObjectives.push_back(CurrObj);
23 backazimuths.push_back(back);
28 if (IndividualObjectives.empty())
30 "In Multi1DRecObjective: No Objective functions set !");
31 const size_t nobjs = IndividualObjectives.size();
32 for (
size_t i = 0; i < nobjs; ++i)
36 IndividualObjectives.at(i)->PreParallel(member);
43 std::vector<double> values;
44 transform(IndividualObjectives.begin(), IndividualObjectives.end(),
45 back_inserter(values), boost::bind(
47 double sumsquares = inner_product(values.begin(), values.end(),
49 return sqrt(sumsquares / values.size());
55 for_each(IndividualObjectives.begin(), IndividualObjectives.end(),
62 const size_t nobjs = Old.IndividualObjectives.size();
63 IndividualObjectives.clear();
65 copy(Old.backazimuths.begin(), Old.backazimuths.end(), back_inserter(
67 for (
size_t i = 0; i < nobjs; ++i)
69 boost::shared_ptr<AnisoSurfaceWaveObjective> Obj(
70 Old.IndividualObjectives.at(i)->clone());
71 IndividualObjectives.push_back(Obj);
77 const size_t nobjs = IndividualObjectives.size();
78 for (
size_t i = 0; i < nobjs; ++i)
80 IndividualObjectives.at(i)->WriteData(filename + stringify(i));
87 const size_t nobjs = IndividualObjectives.size();
88 for (
size_t i = 0; i < nobjs; ++i)
90 IndividualObjectives.at(i)->WriteModel(filename + stringify(i));
97 IndividualObjectives.front()->WritePlot(filename);
105 const size_t nobjs = source.IndividualObjectives.size();
106 IndividualObjectives.clear();
107 backazimuths.clear();
108 copy(source.backazimuths.begin(), source.backazimuths.end(),
109 back_inserter(backazimuths));
110 for (
size_t i = 0; i < nobjs; ++i)
112 boost::shared_ptr<AnisoSurfaceWaveObjective> Obj(
113 source.IndividualObjectives.at(i)->clone());
114 IndividualObjectives.push_back(Obj);
ublas::vector< double > ttranscribed
MultiAnisoSurfaceWaveObjective()
virtual void SafeParallel(const ttranscribed &member)
The core performance calculation, has to be safe to be done in parallel.
void WriteData(const std::string &filename)
virtual void PreParallel(const ttranscribed &member)
Some operations cannot be done in parallel, these are done before.
Minimize the misfit for several surface wave dispersion curves simultaneously.
MultiAnisoSurfaceWaveObjective & operator=(const MultiAnisoSurfaceWaveObjective &source)
virtual double PostParallel(const ttranscribed &member)
Some operations cannot be done in parallel, these are done after, returns the misfit value...
void WritePlot(const std::string &filename)
This class calculates the misfit for anisotropic surface wave dispersion data.
const std::string & GetParallelID()
Derived classes need to read the ParallelId for their forward calculations.
void AddMeasurement(const ParkSurfaceWaveData &Measured, const double back, const double avel)
virtual ~MultiAnisoSurfaceWaveObjective()
void WriteModel(const std::string &filename)
virtual double PostParallel(const ttranscribed &member)
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.
The basic exception class for all errors that arise in gplib.