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 #ifndef RTOPPACK_RTOP_NEW_T_DECL_HPP
00030 #define RTOPPACK_RTOP_NEW_T_DECL_HPP
00031
00032 #include "RTOpPack_Types.hpp"
00033 #include "Teuchos_RefCountPtr.hpp"
00034 #include "Teuchos_PrimitiveTypeTraits.hpp"
00035
00036 namespace RTOpPack {
00037
00041
00044 class ReductTarget {
00045 public:
00046 virtual ~ReductTarget() {}
00047 };
00048
00157 template<class Scalar>
00158 class RTOpT {
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
00261 virtual ~RTOpT();
00271 virtual const char* op_name() const;
00279 virtual RTOpT<Scalar>& operator=(const RTOpT<Scalar>& op);
00288 virtual void get_op_type_num_entries(
00289 int* num_values
00290 ,int* num_indexes
00291 ,int* num_chars
00292 ) const;
00315 virtual void extract_op_state(
00316 int num_values
00317 ,primitive_value_type value_data[]
00318 ,int num_indexes
00319 ,index_type index_data[]
00320 ,int num_chars
00321 ,char_type char_data[]
00322 ) const;
00345 virtual void load_op_state(
00346 int num_values
00347 ,const primitive_value_type value_data[]
00348 ,int num_indexes
00349 ,const index_type index_data[]
00350 ,int num_chars
00351 ,const char_type char_data[]
00352 );
00358 virtual bool coord_invariant() const;
00426 virtual void apply_op(
00427 const int num_vecs, const SubVectorT<Scalar> sub_vecs[]
00428 ,const int num_targ_vecs, const MutableSubVectorT<Scalar> targ_sub_vecs[]
00429 ,ReductTarget *reduct_obj
00430 ) const = 0;
00431
00433
00434 private:
00435
00436 std::string op_name_;
00437
00438 };
00439
00440 }
00441
00442 #endif // RTOPPACK_RTOP_NEW_T_DECL_HPP