Fix for Bug IPAL11055:

It is impossible to input negative value as f(t) in table function.
This commit is contained in:
enk 2006-03-21 07:24:22 +00:00
parent e55d3a081b
commit 06c42e9c95

View File

@ -122,10 +122,11 @@ double FunctionTable::integral( const int i ) const
double FunctionTable::integral( const int i, const double d ) const
{
double f, res = 0.0;
if( value( myData[2*i]+d, f ) )
res = ( myData[2*i+1] + f ) / 2.0 * d;
double f1,f2, res = 0.0;
if( value( myData[2*i]+d, f1 ) )
if(!value(myData[2*i], f2))
f2 = myData[2*i+1];
res = (f2+f1) * d / 2.0;
return res;
}