- Handle( ExprIntrp_GenExp ) gen = ExprIntrp_GenExp::Create();
- gen->Process(TCollection_AsciiString((char*)expr));
- if (gen->IsDone())
+ double f, res = 0.0;
+ if( value( myData[2*i]+d, f ) )
+ res = ( myData[2*i] + f ) / 2.0 * d;
+
+ return res;
+}
+
+double FunctionTable::integral( const double a, const double b )
+{
+ int x1s, x1f, x2s, x2f;
+ findBounds( a, x1s, x1f );
+ findBounds( b, x2s, x2f );
+ double J = 0;
+ for( int i=x1s; i<x2s; i++ )
+ J+=integral( i );
+ J-=integral( x1s, a-myData[2*x1s] );
+ J+=integral( x2s, b-myData[2*x2s] );
+ return J;
+}
+
+bool FunctionTable::findBounds( const double x, int& x_ind_1, int& x_ind_2 ) const
+{
+ int n = myData.size();
+ if( n==0 || x<myData[0] )