Commit c509bb17 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

1. use a vector instead of a liast for triples; lists are efficient

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.
where sorting is required; we are not going to sort the triples, but we
want random access; vectors provide random access
2. recorded data and synthetics are not going to be modified; use Tcoc
types for their containers


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3921
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 84927510
......@@ -88,7 +88,7 @@ void initstfinvengine(struct CTriples triples,
cxxstf.sampling.n));
// convert pointer triples
stfinv::Tlistoftriples cxxtriples;
stfinv::Tvectoroftriples cxxtriples;
STFINV_assert(triples.n>0, "no triples provided");
for (int i=0; i<triples.n; ++i)
{
......@@ -98,11 +98,11 @@ void initstfinvengine(struct CTriples triples,
const int& n=triple.header.sampling.n;
shape=aff::LinearShape(0, n-1, 0);
triple.data
=stfinv::Tseries(shape,
aff::SharedHeap<Tvalue>(ctriple.data, n));
=stfinv::Tseries::Tcoc(shape,
aff::SharedHeap<Tvalue>::Tcoc(ctriple.data, n));
triple.synthetics
=stfinv::Tseries(shape,
aff::SharedHeap<Tvalue>(ctriple.synthetics, n));
=stfinv::Tseries::Tcoc(shape,
aff::SharedHeap<Tvalue>::Tcoc(ctriple.synthetics, n));
triple.convolvedsynthetics
=stfinv::Tseries(shape,
aff::SharedHeap<Tvalue>(ctriple.convolvedsynthetics, n));
......
......@@ -58,7 +58,7 @@ namespace stfinv {
class STFEngine {
public:
//! \brief Constructor.
STFEngine(const stfinv::Tlistoftriples& triples,
STFEngine(const stfinv::Tvectoroftriples& triples,
const stfinv::Waveform& stf,
const std::string& parameters);
//! \brief Destructor must remove engine.
......
......@@ -46,7 +46,7 @@
#include<stfinv/error.h>
#include<aff/series.h>
#include<iostream>
#include<list>
#include<vector>
namespace stfinv {
......@@ -68,11 +68,11 @@ namespace stfinv {
CTripleHeader header;
/*! \brief Time series of recorded data.
*/
Tseries data;
Tseries::Tcoc data;
/*! \brief Time series of synthetic data.
* This is understood as the impulse response of the subsurface.
*/
Tseries synthetics;
Tseries::Tcoc synthetics;
/*! \brief Time series of convolved synthetic data.
* This will contain the synthetic data convolved with the obtained source
* time function as a result of a call to the library functions.
......@@ -100,7 +100,7 @@ namespace stfinv {
/*! \brief List of triples.
* \ingroup cxxinterface
*/
typedef std::list<stfinv::WaveformTriple> Tlistoftriples;
typedef std::vector<stfinv::WaveformTriple> Tvectoroftriples;
/*----------------------------------------------------------------------*/
......@@ -116,7 +116,7 @@ namespace stfinv {
public:
/*! \brief Constructor.
*/
STFBaseEngine(const stfinv::Tlistoftriples& triples,
STFBaseEngine(const stfinv::Tvectoroftriples& triples,
const stfinv::Waveform& stf,
const std::string& parameters)
: Mtriples(triples), Mstf(stf), Mparameters(parameters)
......@@ -136,7 +136,7 @@ namespace stfinv {
protected:
// protected members are accessed directly from derived classes
//! \brief Waveform triples.
stfinv::Tlistoftriples Mtriples;
stfinv::Tvectoroftriples Mtriples;
//! \brief Source time function.
stfinv::Waveform Mstf;
//! \brief Control parameters encoded in a string.
......
......@@ -59,7 +59,7 @@ namespace stfinv {
static const char* const description;
/*! \brief Constructor.
*/
STFEngineBlindDeconvolution(const stfinv::Tlistoftriples& triples,
STFEngineBlindDeconvolution(const stfinv::Tvectoroftriples& triples,
const stfinv::Waveform& stf,
const std::string& parameters)
:Tbase(triples, stf, parameters) { }
......
......@@ -59,7 +59,7 @@ namespace stfinv {
static const char* const description;
/*! \brief Constructor.
*/
STFEngineFixedWavelet(const stfinv::Tlistoftriples& triples,
STFEngineFixedWavelet(const stfinv::Tvectoroftriples& triples,
const stfinv::Waveform& stf,
const std::string& parameters)
:Tbase(triples, stf, parameters) { }
......
......@@ -59,7 +59,7 @@ namespace stfinv {
static const char* const description;
/*! \brief Constructor.
*/
STFEngineIdentity(const stfinv::Tlistoftriples& triples,
STFEngineIdentity(const stfinv::Tvectoroftriples& triples,
const stfinv::Waveform& stf,
const std::string& parameters)
:Tbase(triples, stf, parameters) { }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment