qtbwave.cpp bad value check

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

qtbwave.cpp bad value check

Postby valerio » Sun Oct 25, 2009 11:03 am

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

Return to “Developer's corner”

Who is online

Users browsing this forum: No registered users and 1 guest