コード例 #1
0
void CoordExprEvaluator::internalEval(const EvalManager& mgr,
  Array<double>& constantResults,
  Array<RCP<EvalVector> >& vectorResults) const 
{
  Tabs tabs(0);

  SUNDANCE_MSG1(mgr.verb(), tabs << "CoordExprEvaluator::eval() expr=" << expr()->toString());

  SUNDANCE_MSG2(mgr.verb(), tabs << "sparsity = " << std::endl 
    << *(this->sparsity)())

  if (doValue_)
    {
      Tabs tab2;
      SUNDANCE_MSG3(mgr.verb(), tab2 << "computing value");
      vectorResults.resize(1);
      vectorResults[0] = mgr.popVector();
      mgr.evalCoordExpr(expr(), vectorResults[0]);
      mgr.stack().setVecSize(vectorResults[0]->length());
      vectorResults[0]->setString(stringRep_);
    }
  
  if (doDeriv_)
    {
      Tabs tab2;
      SUNDANCE_MSG3(mgr.verb(), tab2 << "computing derivative");
      constantResults.resize(1);
      constantResults[0] = 1.0;
    }

  if (mgr.verb() > 1)
    {
      Tabs tab1;
      Out::os() << tab1 << "results " << std::endl;
      mgr.showResults(Out::os(), this->sparsity(), vectorResults,
                            constantResults);
    }

}