00001 /* @HEADER@ */ 00002 // 00003 /* @HEADER@ */ 00004 00005 #ifndef PLAYA_VECTORFUNCTORDECL_HPP 00006 #define PLAYA_VECTORFUNCTORDECL_HPP 00007 00008 #include "PlayaDefs.hpp" 00009 #include "PlayaMPIComm.hpp" 00010 #include "Teuchos_RCP.hpp" 00011 #include "PlayaGeneralizedIndex.hpp" 00012 00013 namespace PlayaFunctors 00014 { 00015 00016 using Playa::GeneralizedIndex; 00017 using Teuchos::RCP; 00018 using Playa::MPIComm; 00019 using Playa::MPIOp; 00020 using Playa::MPIDataType; 00021 00028 template <class Scalar, class FunctorType> 00029 class VectorFunctorTraits 00030 { 00031 public: 00032 typedef Scalar ReturnType; 00033 }; 00034 00035 00036 00042 template <class Scalar> 00043 class ReductionFunctorBase 00044 { 00045 public: 00047 ReductionFunctorBase( 00048 const MPIComm& comm 00049 ) 00050 : comm_(comm) {} 00051 00053 virtual void postProc() const = 0 ; 00054 00055 protected: 00056 00058 const MPIComm& comm() const {return comm_;} 00059 00060 private: 00061 MPIComm comm_; 00062 }; 00063 00064 00069 template <class Scalar> 00070 struct IndexedValue 00071 { 00073 Scalar what; 00075 int where; 00076 }; 00077 00078 } 00079 00080 #endif