00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef RTOPPACK_RTOP_NEW_T_DECL_HPP
00031 #define RTOPPACK_RTOP_NEW_T_DECL_HPP
00032
00033 #include "RTOpPack_Types.hpp"
00034 #include "Teuchos_RefCountPtr.hpp"
00035 #include "Teuchos_PrimitiveTypeTraits.hpp"
00036 #include "Teuchos_Describable.hpp"
00037
00038 namespace RTOpPack {
00039
00043
00046 class ReductTarget : public Teuchos::Describable
00047 {};
00048
00157 template<class Scalar>
00158 class RTOpT : public Teuchos::Describable {
00159 public:
00160
00163
00165 typedef typename Teuchos::PrimitiveTypeTraits<Scalar>::primitiveType primitive_value_type;
00166
00168
00170 RTOpT( const std::string &op_name_base );
00171
00174
00190 virtual void get_reduct_type_num_entries(
00191 int* num_values
00192 ,int* num_indexes
00193 ,int* num_chars
00194 ) const;
00205 virtual Teuchos::RefCountPtr<ReductTarget> reduct_obj_create() const;
00211 virtual void reduce_reduct_objs(
00212 const ReductTarget& in_reduct_obj, ReductTarget* inout_reduct_obj
00213 ) const;
00221 virtual void reduct_obj_reinit( ReductTarget* reduct_obj ) const;
00231 virtual void extract_reduct_obj_state(
00232 const ReductTarget &reduct_obj
00233 ,int num_values
00234 ,primitive_value_type value_data[]
00235 ,int num_indexes
00236 ,index_type index_data[]
00237 ,int num_chars
00238 ,char_type char_data[]
00239 ) const;
00245 virtual void load_reduct_obj_state(
00246 int num_values
00247 ,const primitive_value_type value_data[]
00248 ,int num_indexes
00249 ,const index_type index_data[]
00250 ,int num_chars
00251 ,const char_type char_data[]
00252 ,ReductTarget *reduct_obj
00253 ) const;
00254
00256
00259
00269 virtual const char* op_name() const;
00277 virtual RTOpT<Scalar>& operator=(const RTOpT<Scalar>& op);
00286 virtual void get_op_type_num_entries(
00287 int* num_values
00288 ,int* num_indexes
00289 ,int* num_chars
00290 ) const;
00313 virtual void extract_op_state(
00314 int num_values
00315 ,primitive_value_type value_data[]
00316 ,int num_indexes
00317 ,index_type index_data[]
00318 ,int num_chars
00319 ,char_type char_data[]
00320 ) const;
00343 virtual void load_op_state(
00344 int num_values
00345 ,const primitive_value_type value_data[]
00346 ,int num_indexes
00347 ,const index_type index_data[]
00348 ,int num_chars
00349 ,const char_type char_data[]
00350 );
00356 virtual bool coord_invariant() const;
00424 virtual void apply_op(
00425 const int num_vecs, const ConstSubVectorView<Scalar> sub_vecs[]
00426 ,const int num_targ_vecs, const SubVectorView<Scalar> targ_sub_vecs[]
00427 ,ReductTarget *reduct_obj
00428 ) const = 0;
00429
00431
00432 private:
00433
00434 std::string op_name_;
00435
00436 };
00437
00438 }
00439
00440 #endif // RTOPPACK_RTOP_NEW_T_DECL_HPP