コード例 #1
0
void DiscreteFuncElementEvaluator
::internalEval(const EvalManager& mgr,
               Array<double>& constantResults,
               Array<RCP<EvalVector> >& vectorResults) const 
{
  Tabs tabs(0);
  SUNDANCE_MSG1(mgr.verb(),
    tabs << "DiscreteFuncElementEvaluator::eval: expr=" 
    << expr()->toString());

  vectorResults.resize(mi_.size());
  for (int i=0; i<mi_.size(); i++)
    {
      Tabs tab2;
      vectorResults[i] = mgr.popVector();
      TEUCHOS_TEST_FOR_EXCEPTION(!vectorResults[i]->isValid(), 
                         std::logic_error,
                         "invalid evaluation vector allocated in "
                         "DiscreteFuncElementEvaluator::internalEval()");
      SUNDANCE_MSG2(mgr.verb(),tab2<< "setting string rep " << stringReps_[i]);
      vectorResults[i]->setString(stringReps_[i]);
    }
  mgr.evalDiscreteFuncElement(expr(), mi_, vectorResults);
  mgr.stack().setVecSize(vectorResults[0]->length());
  
  if (mgr.verb() > 1)
    {
      Out::os() << tabs << "results " << std::endl;
      mgr.showResults(Out::os(), sparsity(), vectorResults,
                            constantResults);
    }
  SUNDANCE_MSG1(mgr.verb(), tabs << "DiscreteFuncEvaluator::eval() done"); 
}