44#ifndef RTOPPACK_RTOP_NEW_T_DECL_HPP
45#define RTOPPACK_RTOP_NEW_T_DECL_HPP
48#include "RTOpPack_Types.hpp"
49#include "Teuchos_Describable.hpp"
168template<
class Scalar>
169class RTOpT :
public Teuchos::Describable {
200 const Ptr<int> &num_values,
201 const Ptr<int> &num_indexes,
202 const Ptr<int> &num_chars
225 const ReductTarget& in_reduct_obj,
const Ptr<ReductTarget>& inout_reduct_obj
254 const ArrayView<primitive_value_type> &value_data,
255 const ArrayView<index_type> &index_data,
256 const ArrayView<char_type> &char_data
260 value_data, index_data, char_data );
269 const ArrayView<const primitive_value_type> &value_data,
270 const ArrayView<const index_type> &index_data,
271 const ArrayView<const char_type> &char_data,
272 const Ptr<ReductTarget> &reduct_obj
395 const ArrayView<
const ConstSubVectorView<Scalar> > &sub_vecs,
396 const ArrayView<
const SubVectorView<Scalar> > &targ_sub_vecs,
397 const Ptr<ReductTarget> &reduct_obj
412 const Ptr<int> &num_values,
413 const Ptr<int> &num_indexes,
414 const Ptr<int> &num_chars
422 const ReductTarget& in_reduct_obj,
const Ptr<ReductTarget>& inout_reduct_obj
431 const ArrayView<primitive_value_type> &value_data,
432 const ArrayView<index_type> &index_data,
433 const ArrayView<char_type> &char_data
438 const ArrayView<const primitive_value_type> &value_data,
439 const ArrayView<const index_type> &index_data,
440 const ArrayView<const char_type> &char_data,
441 const Ptr<ReductTarget> &reduct_obj
455 const ArrayView<
const ConstSubVectorView<Scalar> > &sub_vecs,
456 const ArrayView<
const SubVectorView<Scalar> > &targ_sub_vecs,
457 const Ptr<ReductTarget> &reduct_obj
467 RTOpT(
const std::string &op_name_base =
"" );
479 std::string op_name_;
481 void throwNoReductError()
const;
Templated interface to vector reduction/transformation operators {abstract}.
virtual void apply_op_impl(const ArrayView< const ConstSubVectorView< Scalar > > &sub_vecs, const ArrayView< const SubVectorView< Scalar > > &targ_sub_vecs, const Ptr< ReductTarget > &reduct_obj) const =0
virtual std::string op_name_impl() const
virtual void extract_reduct_obj_state_impl(const ReductTarget &reduct_obj, const ArrayView< primitive_value_type > &value_data, const ArrayView< index_type > &index_data, const ArrayView< char_type > &char_data) const
virtual void reduce_reduct_objs_impl(const ReductTarget &in_reduct_obj, const Ptr< ReductTarget > &inout_reduct_obj) const
Teuchos::RCP< ReductTarget > reduct_obj_create() const
Creates a new reduction target object initialized and ready to be used in a reduction.
bool coord_invariant() const
Returns true if this operator is coordinate invariant.
virtual Teuchos::RCP< ReductTarget > reduct_obj_create_impl() const
void apply_op(const ArrayView< const ConstSubVectorView< Scalar > > &sub_vecs, const ArrayView< const SubVectorView< Scalar > > &targ_sub_vecs, const Ptr< ReductTarget > &reduct_obj) const
Apply the reduction/transformation operator to a set of sub-vectors.
virtual void reduct_obj_reinit_impl(const Ptr< ReductTarget > &reduct_obj) const
Range1D range() const
Returns the continuous range of elements that this operator is defined over.
void extract_reduct_obj_state(const ReductTarget &reduct_obj, const ArrayView< primitive_value_type > &value_data, const ArrayView< index_type > &index_data, const ArrayView< char_type > &char_data) const
Extract the state of an already created reduction object.
virtual Range1D range_impl() const
virtual void get_reduct_type_num_entries_impl(const Ptr< int > &num_values, const Ptr< int > &num_indexes, const Ptr< int > &num_chars) const
virtual void load_reduct_obj_state_impl(const ArrayView< const primitive_value_type > &value_data, const ArrayView< const index_type > &index_data, const ArrayView< const char_type > &char_data, const Ptr< ReductTarget > &reduct_obj) const
void setOpNameBase(const std::string &op_name_base)
Just set the operator name.
PrimitiveTypeTraits< Scalar, Scalar >::primitiveType primitive_value_type
void get_reduct_type_num_entries(const Ptr< int > &num_values, const Ptr< int > &num_indexes, const Ptr< int > &num_chars) const
Get the number of entries of each basic data type in the externalized state for a reduction object fo...
void load_reduct_obj_state(const ArrayView< const primitive_value_type > &value_data, const ArrayView< const index_type > &index_data, const ArrayView< const char_type > &char_data, const Ptr< ReductTarget > &reduct_obj) const
Load the state of an already created reduction object given arrays of primitive objects.
void reduce_reduct_objs(const ReductTarget &in_reduct_obj, const Ptr< ReductTarget > &inout_reduct_obj) const
Reduce intermediate reduction target objects.
virtual bool coord_invariant_impl() const
RTOpT(const std::string &op_name_base="")
Constructor that creates an operator name appended with the type.
void reduct_obj_reinit(const Ptr< ReductTarget > &reduct_obj) const
Reinitialize an already created reduction object.
std::string op_name() const
Return the name (as a null-terminated C-style string) of the operator.
Abstract base class for all reduction objects.