00001 #ifndef SUNDANCE_PRODUCTEVALUATOR_H 00002 #define SUNDANCE_PRODUCTEVALUATOR_H 00003 00004 #include "SundanceDefs.hpp" 00005 #include "SundanceBinaryEvaluator.hpp" 00006 #include "SundanceProductExpr.hpp" 00007 #include "Teuchos_TimeMonitor.hpp" 00008 00009 00010 namespace Sundance 00011 { 00012 /** 00013 * 00014 */ 00015 class ProductEvaluator : public BinaryEvaluator<ProductExpr> 00016 { 00017 public: 00018 /** */ 00019 ProductEvaluator(const ProductExpr* expr, 00020 const EvalContext& context); 00021 00022 00023 /** */ 00024 virtual ~ProductEvaluator(){;} 00025 00026 /** */ 00027 virtual void internalEval(const EvalManager& mgr, 00028 Array<double>& constantResults, 00029 Array<RCP<EvalVector> >& vectorResults) const ; 00030 00031 00032 /** */ 00033 TEUCHOS_TIMER(evalTimer, "product evaluation"); 00034 00035 private: 00036 /** */ 00037 enum ProductParity {VecVec, VecConst, ConstVec}; 00038 00039 int maxOrder_; 00040 Array<Array<int> > resultIndex_; 00041 Array<Array<int> > resultIsConstant_; 00042 00043 Array<Array<int> > hasWorkspace_; 00044 Array<Array<int> > workspaceIsLeft_; 00045 Array<Array<int> > workspaceIndex_; 00046 Array<Array<int> > workspaceCoeffIndex_; 00047 Array<Array<int> > workspaceCoeffIsConstant_; 00048 00049 Array<Array<Array<Array<int> > > > ccTerms_; 00050 Array<Array<Array<Array<int> > > > cvTerms_; 00051 Array<Array<Array<Array<int> > > > vcTerms_; 00052 Array<Array<Array<Array<int> > > > vvTerms_; 00053 00054 Array<Array<Array<int> > > startingVectors_; 00055 Array<Array<ProductParity> > startingParities_; 00056 00057 00058 00059 00060 }; 00061 00062 } 00063 00064 #endif