qtbwave.cpp bad value check

Place here all posts related to implementation and source codes. This forum is rather technical and reserved for programmers.
Post Reply
valerio
Posts: 10
Joined: Mon Jan 14, 2008 1:56 pm

qtbwave.cpp bad value check

Post 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();
}
}

Post Reply