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

adjust index ranges

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.

SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3982
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 7444ba85
......@@ -73,6 +73,19 @@ namespace stfinv {
{
Mweights=1.;
}
// align index ranges; first index will be zero
if (Mstf.series.first()!=0) { Mstf.series.shift(-Mstf.series.first()); }
stfinv::Tvectoroftriples::iterator I=Mtriples.begin();
while (I!=Mtriples.end())
{
if (I->data.first()!=0) { I->data.shift(-(I->data.first())); }
if (I->synthetics.first()!=0)
{ I->synthetics.shift(-(I->synthetics.first())); }
if (I->convolvedsynthetics.first()!=0)
{ I->convolvedsynthetics.shift(-(I->convolvedsynthetics.first())); }
++I;
} // while (I!=Mtriples.end())
} // STFBaseEngine::STFBaseEngine(const stfinv::Tvectoroftriples& triples,
/*----------------------------------------------------------------------*/
......@@ -81,6 +94,8 @@ namespace stfinv {
{
const unsigned int& n=Mstf.sampling.n;
const double& dt=Mstf.sampling.dt;
STFINV_assert(Mstf.sampling.n==Mstf.series.size(),
"inconsistent number of samples");
const double tolerance=1.e-4;
stfinv::Tvectoroftriples::const_iterator I=Mtriples.begin();
while (I!=Mtriples.end())
......@@ -88,6 +103,12 @@ namespace stfinv {
CTripleHeader header=I->header;
STFINV_assert(header.sampling.n==n,
"inconsistent number of samples");
STFINV_assert(header.sampling.n==I->data.size(),
"inconsistent number of samples");
STFINV_assert(header.sampling.n==I->synthetics.size(),
"inconsistent number of samples");
STFINV_assert(header.sampling.n==I->convolvedsynthetics.size(),
"inconsistent number of samples");
STFINV_assert(std::abs(1.-header.sampling.dt/dt)<tolerance,
"inconsistent values of sampling interval");
} // while (I!=Mtriples.end())
......
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