00001 #ifndef SUNDANCE_SUMEVALUATOR_H 00002 #define SUNDANCE_SUMEVALUATOR_H 00003 00004 #include "SundanceDefs.hpp" 00005 #include "SundanceBinaryEvaluator.hpp" 00006 #include "Teuchos_TimeMonitor.hpp" 00007 00008 00009 namespace Sundance 00010 { 00011 class SumExpr; 00012 00013 /** 00014 * 00015 */ 00016 class SumEvaluator : public BinaryEvaluator<SumExpr> 00017 { 00018 public: 00019 /** */ 00020 SumEvaluator(const SumExpr* expr, 00021 const EvalContext& context); 00022 00023 /** */ 00024 virtual ~SumEvaluator(){;} 00025 00026 /** */ 00027 virtual void internalEval(const EvalManager& mgr, 00028 Array<double>& constantResults, 00029 Array<RCP<EvalVector> >& vectorResults) const ; 00030 00031 /** */ 00032 TEUCHOS_TIMER(evalTimer, "sum evaluation"); 00033 private: 00034 int sign_; 00035 Array<Array<int> > singleRightConstant_; 00036 Array<Array<int> > singleRightVector_; 00037 Array<Array<int> > singleLeftConstant_; 00038 Array<Array<int> > singleLeftVector_; 00039 Array<Array<int> > ccSums_; 00040 Array<Array<int> > cvSums_; 00041 Array<Array<int> > vcSums_; 00042 Array<Array<int> > vvSums_; 00043 }; 00044 } 00045 00046 00047 #endif