本文整理汇总了C++中DataPoint::Print方法的典型用法代码示例。如果您正苦于以下问题:C++ DataPoint::Print方法的具体用法?C++ DataPoint::Print怎么用?C++ DataPoint::Print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataPoint
的用法示例。
在下文中一共展示了DataPoint::Print方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoNumericalIntegral
//Actually perform the numerical integration
double RapidFitIntegrator::DoNumericalIntegral( const DataPoint * NewDataPoint, PhaseSpaceBoundary * NewBoundary, const vector<string> DontIntegrateThese, ComponentRef* componentIndex, const bool IntegrateDataPoint )
{
//Make lists of observables to integrate and not to integrate
vector<string> doIntegrate, dontIntegrate;
StatisticsFunctions::DoDontIntegrateLists( functionToWrap, NewBoundary, &DontIntegrateThese, doIntegrate, dontIntegrate );
dontIntegrate = StringProcessing::CombineUniques( dontIntegrate, DontIntegrateThese );
dontIntegrate = this->DontNumericallyIntegrateList( NewDataPoint, dontIntegrate );
vector<string> CANNOT_INTEGRATE_LIST = NewBoundary->GetDiscreteNames();
dontIntegrate = StringProcessing::CombineUniques( dontIntegrate, CANNOT_INTEGRATE_LIST );
vector<string> safeDoIntegrate;
for( unsigned int i=0; i< doIntegrate.size(); ++i )
{
if( StringProcessing::VectorContains( &dontIntegrate, &(doIntegrate[i]) ) == -1 )
{
safeDoIntegrate.push_back( doIntegrate[i] );
}
}
doIntegrate = safeDoIntegrate;
vector<DataPoint*> DiscreteIntegrals;
vector<string> required = functionToWrap->GetPrototypeDataPoint();
bool isFixed=true;
for( unsigned int i=0; i< required.size(); ++i )
{
isFixed = isFixed && NewBoundary->GetConstraint( required[i] )->IsDiscrete();
}
if( isFixed )
{
if( NewDataPoint != NULL )
{
DataPoint* thisDataPoint = new DataPoint( *NewDataPoint );
thisDataPoint->SetPhaseSpaceBoundary( NewBoundary );
ratioOfIntegrals = 1.;
double returnVal=0.;
try{
returnVal = functionToWrap->Evaluate( thisDataPoint );
thisDataPoint->Print();
}
catch(...)
{
cerr << "Function fails to Evaluate!" << endl;
}
delete thisDataPoint;
return returnVal;
}
else
{
vector<DataPoint*> theseCombs = NewBoundary->GetDiscreteCombinations();
for( unsigned int i=0; i< theseCombs.size(); ++i ) DiscreteIntegrals.push_back( new DataPoint( *(theseCombs[i]) ) );
ratioOfIntegrals = 1.;
double returnVal=0.;
for( unsigned int i=0; i< DiscreteIntegrals.size(); ++i )
{
try{
returnVal+=functionToWrap->Evaluate( DiscreteIntegrals[i] );
}
catch(...)
{
cerr << "Function fails to Evaluate!" << endl;
DiscreteIntegrals[i]->Print();
}
}
while( !DiscreteIntegrals.empty() )
{
if( DiscreteIntegrals.back() != NULL ) delete DiscreteIntegrals.back();
DiscreteIntegrals.pop_back();
}
return returnVal;
}
}
if( IntegrateDataPoint )
{
DiscreteIntegrals.push_back( new DataPoint(*NewDataPoint) );
DiscreteIntegrals.back()->SetPhaseSpaceBoundary( NewBoundary );
}
else
{
vector<DataPoint*> theseCombs = NewBoundary->GetDiscreteCombinations();
for( unsigned int i=0; i< theseCombs.size(); ++i ) DiscreteIntegrals.push_back( new DataPoint( *(theseCombs[i]) ) );
}
double output_val = 0.;
//If there are no observables left to integrate over, just evaluate the function
if( doIntegrate.empty() || doIntegrate.size() == 0 )
{
for( vector<DataPoint*>::iterator dataPoint_i = DiscreteIntegrals.begin(); dataPoint_i != DiscreteIntegrals.end(); ++dataPoint_i )
{
try{
output_val += functionToWrap->Integral( *dataPoint_i, NewBoundary );
}
catch(...)
{
cerr << "Analytical Integral Fell over!" << endl;
//.........这里部分代码省略.........