本文整理汇总了C++中EvalContext::setSetupVerbosity方法的典型用法代码示例。如果您正苦于以下问题:C++ EvalContext::setSetupVerbosity方法的具体用法?C++ EvalContext::setSetupVerbosity怎么用?C++ EvalContext::setSetupVerbosity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EvalContext
的用法示例。
在下文中一共展示了EvalContext::setSetupVerbosity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupVariations
//.........这里部分代码省略.........
/* put together the set of functions that are active differentiation
* variables */
SUNDANCE_MSG2(verb, tab << "forming active set");
Array<Sundance::Set<MultiSet<int> > > activeFuncIDs(3);
if (context.needsDerivOrder(0)) activeFuncIDs[0].put(MultiSet<int>());
if (context.topLevelDiffOrder() >= 1)
{
for (Set<int>::const_iterator i=varID.begin(); i != varID.end(); i++)
{
if (context.needsDerivOrder(1)) activeFuncIDs[1].put(makeMultiSet<int>(*i));
if (context.topLevelDiffOrder()==2)
{
for (Set<int>::const_iterator j=unkID.begin(); j != unkID.end(); j++)
{
activeFuncIDs[2].put(makeMultiSet<int>(*i, *j));
}
if (compType==MatrixAndVector)
{
for (Set<int>::const_iterator
j=unkParamID.begin(); j != unkParamID.end(); j++)
{
activeFuncIDs[2].put(makeMultiSet<int>(*i, *j));
}
}
else if (compType==Sensitivities)
{
for (Set<int>::const_iterator
j=fixedParamID.begin(); j != fixedParamID.end(); j++)
{
activeFuncIDs[2].put(makeMultiSet<int>(*i, *j));
}
}
}
}
}
SUNDANCE_MSG1(verb, tab << std::endl << tab
<< " ************* Finding nonzeros for expr " << std::endl << tab);
for (int i=0; i<=context.topLevelDiffOrder(); i++)
{
Tabs tab2;
SUNDANCE_MSG4(verb, tab2 << "diff order=" << i << ", active funcs="
<< activeFuncIDs[i]);
}
Set<MultiIndex> miSet;
miSet.put(MultiIndex());
e->registerSpatialDerivs(context, miSet);
SUNDANCE_MSG2(verb,
tab << std::endl << tab
<< " ************* finding required functions" << std::endl << tab);
SUNDANCE_MSG2(verb,
tab << "activeFuncIDs are = " << activeFuncIDs);
SUNDANCE_MSG2(verb,
tab << "spatial derivs are = " << spatialDerivs);
Array<Set<MultipleDeriv> > RInput
= e->computeInputR(context, activeFuncIDs, spatialDerivs);
SUNDANCE_MSG3(verb,
tab << std::endl << tab
<< " ************* Top-level required funcs are " << RInput << std::endl << tab);
SUNDANCE_MSG2(verb,
tab << std::endl << tab
<< " ************* Calling determineR()" << std::endl << tab);
e->determineR(context, RInput);
SUNDANCE_MSG1(verb,
tab << std::endl << tab
<< " ************* Finding sparsity structure " << std::endl << tab);
DerivSet derivs = e->sparsitySuperset(context)->derivSet();
SUNDANCE_MSG1(verb,
tab << std::endl << tab
<< "Nonzero deriv set = " << derivs);
SUNDANCE_MSG1(verb,
tab << std::endl << tab
<< " ************* Setting up evaluators for expr " << std::endl << tab);
int saveVerb = context.setupVerbosity();
context.setSetupVerbosity(0);
e->setupEval(context);
if (verb>1)
{
SUNDANCE_MSG1(verb,
tab << std::endl << tab
<< " ************* Nonzeros are:");
e->displayNonzeros(Out::os(), context);
}
context.setSetupVerbosity(saveVerb);
return derivs;
}