From: enk Date: Tue, 21 Mar 2006 07:24:22 +0000 (+0000) Subject: Fix for Bug IPAL11055: X-Git-Tag: T3_2_0b1~6 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=06c42e9c9528a8d54fed01e266c949676fa0d929;ds=sidebyside Fix for Bug IPAL11055: It is impossible to input negative value as f(t) in table function. --- 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; }