From 06c42e9c9528a8d54fed01e266c949676fa0d929 Mon Sep 17 00:00:00 2001 From: enk Date: Tue, 21 Mar 2006 07:24:22 +0000 Subject: [PATCH] Fix for Bug IPAL11055: It is impossible to input negative value as f(t) in table function. --- src/StdMeshers/StdMeshers_Distribution.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index 1223fc009..5b0416db6 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -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; } -- 2.30.2