Page 1 of 1

qtbwave.cpp bad value check

Posted: Sun Oct 25, 2009 11:03 am
by valerio
Hi Marc,
I propose the following (or a similar) modification to the code in qtbwave.cpp, in order to avoid bad values in output.
Ciao!


MODIFIED CODE:
-----------------------
for(int iMode = 0;iMode<*nModes;iMode++) {
const QtbValue * mode = dispersion.mode( iMode );
for (int iSample = 0; iSample<*nSamples; iSample++) {
if ( mode[iSample].isValid() )
*(slowness++) = mode[iSample].value();
else
*(slowness++) = -1;
}
}

ORIGINAL CODE
-----------------------
for(int iMode = 0;iMode<*nModes;iMode++) {
const QtbValue * mode = dispersion.mode( iMode );
for (int iSample = 0; iSample<*nSamples; iSample++) {
*(slowness++) = mode[iSample].value();
}
}