00001 #ifndef SUNDANCE_DERIVOFSYMBFUNCEVALUATOR_H 00002 #define SUNDANCE_DERIVOFSYMBFUNCEVALUATOR_H 00003 00004 #include "SundanceDefs.hpp" 00005 #include "SundanceUnaryEvaluator.hpp" 00006 #include "Teuchos_TimeMonitor.hpp" 00007 00008 namespace Sundance 00009 { 00010 class DerivOfSymbFunc; 00011 class DiscreteFuncElementEvaluator; 00012 00013 /** 00014 * 00015 */ 00016 class DerivOfSymbFuncEvaluator : public UnaryEvaluator<DerivOfSymbFunc> 00017 { 00018 public: 00019 /** */ 00020 DerivOfSymbFuncEvaluator(const DerivOfSymbFunc* expr, 00021 const EvalContext& context); 00022 00023 /** */ 00024 virtual ~DerivOfSymbFuncEvaluator(){;} 00025 00026 /** */ 00027 virtual void internalEval(const EvalManager& mgr, 00028 Array<double>& constantResults, 00029 Array<RCP<EvalVector> >& vectorResults) const ; 00030 00031 /** We need a specialized resetting method for diff op 00032 * evaluators that also resets the discrete func evaluators 00033 * used in the functional chain rule */ 00034 virtual void resetNumCalls() const ; 00035 00036 /** */ 00037 TEUCHOS_TIMER(evalTimer, "DerivOfSymbFunc evaluation"); 00038 private: 00039 00040 Array<const DiscreteFuncElementEvaluator*> funcEvaluator_; 00041 00042 int funcMiIndex_; 00043 00044 bool evalPtIsZero_; 00045 00046 int constResultIndex_; 00047 00048 RCP<SparsitySuperset> funcSparsitySuperset_; 00049 }; 00050 } 00051 00052 #endif