#include "SMESH_StdMeshers.hxx"#include <vector>#include <math_Function.hxx>#include <ExprIntrp_GenExp.hxx>#include <Expr_Array1OfNamedUnknown.hxx>#include <TColStd_Array1OfReal.hxx>

Go to the source code of this file.
Data Structures | |
| class | Function |
| class | FunctionIntegral |
| class | FunctionTable |
| class | FunctionExpr |
Functions | |
| bool | buildDistribution (const Function &f, const double start, const double end, const int nbSeg, std::vector< double > &data, const double eps) |
| bool | buildDistribution (const TCollection_AsciiString &f, const int conv, const double start, const double end, const int nbSeg, std::vector< double > &data, const double eps) |
| bool | buildDistribution (const std::vector< double > &f, const int conv, const double start, const double end, const int nbSeg, std::vector< double > &data, const double eps) |
| bool buildDistribution | ( | const Function & | f, |
| const double | start, | ||
| const double | end, | ||
| const int | nbSeg, | ||
| std::vector< double > & | data, | ||
| const double | eps | ||
| ) |
Definition at line 320 of file StdMeshers_Distribution.cxx.
References dihotomySolve(), and Function.integral().
{
if( nbSeg<=0 )
return false;
data.resize( nbSeg+1 );
data[0] = start;
double J = func.integral( start, end ) / nbSeg;
if( J<1E-10 )
return false;
bool ok;
//MESSAGE( "distribution:" );
//char buf[1024];
for( int i=1; i<nbSeg; i++ )
{
FunctionIntegral f_int( &func, data[i-1] );
data[i] = dihotomySolve( f_int, J, data[i-1], end, eps, ok );
//sprintf( buf, "%f\n", float( data[i] ) );
//MESSAGE( buf );
if( !ok )
return false;
}
data[nbSeg] = end;
return true;
}
| bool buildDistribution | ( | const std::vector< double > & | f, |
| const int | conv, | ||
| const double | start, | ||
| const double | end, | ||
| const int | nbSeg, | ||
| std::vector< double > & | data, | ||
| const double | eps | ||
| ) |
Definition at line 313 of file StdMeshers_Distribution.cxx.
References buildDistribution().
{
FunctionTable F( f, conv );
return buildDistribution( F, start, end, nbSeg, data, eps );
}
| bool buildDistribution | ( | const TCollection_AsciiString & | f, |
| const int | conv, | ||
| const double | start, | ||
| const double | end, | ||
| const int | nbSeg, | ||
| std::vector< double > & | data, | ||
| const double | eps | ||
| ) |
Definition at line 306 of file StdMeshers_Distribution.cxx.
References buildDistribution().
Referenced by buildDistribution(), StdMeshers_NumberOfSegments.BuildDistributionExpr(), StdMeshers_NumberOfSegments.BuildDistributionTab(), and computeParamByFunc().
{
FunctionExpr F( f.ToCString(), conv );
return buildDistribution( F, start, end, nbSeg, data, eps );
}