43 #ifndef RTOPPACK_RTOP_T_HELPERS_DECL_HPP
44 #define RTOPPACK_RTOP_T_HELPERS_DECL_HPP
53 #include "RTOpPack_RTOpT.hpp"
56 #include "Teuchos_dyn_cast.hpp"
60 #ifdef RTOPPACK_RTOPT_HELPER_DUMP_OUTPUT
61 # include "Teuchos_VerboseObject.hpp"
62 namespace RTOpPack {
extern bool rtop_helpers_dump_all; }
63 #endif // RTOPPACK_RTOPT_HELPER_DUMP_OUTPUT
73 template<
class Scalar>
94 template<
class Scalar>
95 std::ostream& operator<<(std::ostream &out, const ScalarIndex<Scalar> &scalarIndex)
97 out <<
"{"<<scalarIndex.scalar<<
","<<scalarIndex.index<<
"}";
105 template <
class Scalar>
121 const ArrayView<primitiveType> &primitiveObjs,
122 const ArrayView<index_type> &indexObjs,
123 const ArrayView<char> &charObjs
126 assertInput(primitiveObjs, indexObjs, charObjs);
127 ScalarPrimitiveTypeTraits::extractPrimitiveObjs(
128 obj.
scalar, primitiveObjs, Teuchos::null, Teuchos::null );
129 indexObjs[0] = obj.
index;
133 const ArrayView<const primitiveType> &primitiveObjs,
134 const ArrayView<const index_type> &indexObjs,
135 const ArrayView<const char> &charObjs,
139 assertInput(primitiveObjs, indexObjs, charObjs);
140 ScalarPrimitiveTypeTraits::loadPrimitiveObjs(
141 primitiveObjs, Teuchos::null, Teuchos::null,
142 Teuchos::outArg(obj->scalar) );
143 obj->index = indexObjs[0];
146 static void assertInput(
147 const ArrayView<const primitiveType> &primitiveObjs,
148 const ArrayView<const index_type> &indexObjs,
149 const ArrayView<const char> &charObjs
154 primitiveObjs.size()!=ScalarPrimitiveTypeTraits::numPrimitiveObjs()
155 || indexObjs.size()!=1
156 || charObjs.size()!=0 );
170 template<
class ConcreteReductObj>
175 : concreteReductObj_(concreteReductObj)
178 void set(
const ConcreteReductObj &concreteReductObj )
179 { concreteReductObj_ = concreteReductObj; }
181 const ConcreteReductObj&
get()
const
182 {
return concreteReductObj_; }
186 ConcreteReductObj concreteReductObj_;
194 template<
class ConcreteReductObj>
195 const RCP<DefaultReductTarget<ConcreteReductObj> >
225 template<
class Scalar>
226 void validate_apply_op(
228 const int allowed_num_sub_vecs,
229 const int allowed_num_targ_sub_vecs,
230 const bool expect_reduct_obj,
233 const Ptr<const ReductTarget> &reduct_obj
243 enum EBasicReductTypes { REDUCT_TYPE_SUM, REDUCT_TYPE_MAX, REDUCT_TYPE_MIN };
247 template<
class ConcreteReductObj,
int ReductionType>
251 inline void operator()(
const ConcreteReductObj& in_reduct, ConcreteReductObj& inout_reduct)
const
253 return in_reduct.this_reduction_type_needs_a_specialization();
259 template<
class ConcreteReductObj>
263 inline void operator()(
const ConcreteReductObj& in_reduct, ConcreteReductObj& inout_reduct)
const
265 inout_reduct += in_reduct;
271 template<
class ConcreteReductObj>
275 inline void operator()(
const ConcreteReductObj& in_reduct, ConcreteReductObj& inout_reduct)
const
277 inout_reduct = std::max(inout_reduct, in_reduct);
283 template<
class ConcreteReductObj>
287 inline void operator()(
const ConcreteReductObj& in_reduct, ConcreteReductObj& inout_reduct)
const
289 inout_reduct = std::min(inout_reduct, in_reduct);
295 template<
class Scalar>
299 inline void operator()(
const Scalar& in_reduct, Scalar& inout_reduct)
const
301 inout_reduct += in_reduct;
310 template<
class Scalar,
class ConcreteReductObj,
class ReductObjReduction>
323 const ConcreteReductObj &initReductObjValue_in = ScalarTraits<Scalar>::zero(),
324 ReductObjReduction reductObjReduction_in = ReductObjReduction()
326 : initReductObjValue_(initReductObjValue_in),
327 reductObjReduction_(reductObjReduction_in)
339 const Ptr<ReductTarget> &reduct_obj
357 const Ptr<int> &num_values,
358 const Ptr<int> &num_indexes,
359 const Ptr<int> &num_chars
363 *num_values = PTT::numPrimitiveObjs();
364 *num_indexes = PTT::numIndexObjs();
365 *num_chars = PTT::numCharObjs();
377 const ReductTarget& in_reduct_obj,
const Ptr<ReductTarget>& inout_reduct_obj
380 const ConcreteReductObj scalar_in_reduct_obj = this->
getRawVal(in_reduct_obj);
381 ConcreteReductObj scalar_inout_reduct_obj = this->
getRawVal(*inout_reduct_obj);
382 reductObjReduction_(scalar_in_reduct_obj, scalar_inout_reduct_obj);
383 this->
setRawVal( scalar_inout_reduct_obj, inout_reduct_obj );
389 setRawVal( initReductObjValue(), reduct_obj );
395 const ArrayView<primitive_value_type> &value_data,
396 const ArrayView<index_type> &index_data,
397 const ArrayView<char_type> &char_data
401 PTT::extractPrimitiveObjs(
getRawVal(reduct_obj),
402 value_data, index_data, char_data );
407 const ArrayView<const primitive_value_type> &value_data,
408 const ArrayView<const index_type> &index_data,
409 const ArrayView<const char_type> &char_data,
410 const Ptr<ReductTarget> &reduct_obj
414 ConcreteReductObj concrete_reduct_obj;
415 PTT::loadPrimitiveObjs( value_data, index_data, char_data,
416 Teuchos::outArg(concrete_reduct_obj) );
417 this->
setRawVal( concrete_reduct_obj, reduct_obj );
429 ReductObjReduction reductObjReduction_;
440 template<
class Scalar,
class ConcreteReductObj,
class EleWiseReduction,
441 class ReductObjReduction = SumScalarReductObjReduction<ConcreteReductObj> >
452 const ConcreteReductObj &initReductObjValue_in = ConcreteReductObj(),
453 EleWiseReduction eleWiseReduction_in = EleWiseReduction(),
454 ReductObjReduction reductObjReduction_in = ReductObjReduction()
456 :
base_t(initReductObjValue_in, reductObjReduction_in),
457 eleWiseReduction_(eleWiseReduction_in)
467 const Ptr<ReductTarget> &reduct_obj_inout
474 validate_apply_op<Scalar>(*
this, 1, 0,
true,
475 sub_vecs, targ_sub_vecs, reduct_obj_inout.getConst());
482 ConcreteReductObj reduct = reduct_obj.
get();
484 const RTOpPack::index_type subDim = sub_vecs[0].subDim();
486 const_iter_t v0_val = sub_vecs[0].values().begin();
487 const ptrdiff_t v0_s = sub_vecs[0].stride();
490 for( Teuchos_Ordinal i = 0; i < subDim; ++i )
491 eleWiseReduction_( *v0_val++, reduct);
494 for( Teuchos_Ordinal i = 0; i < subDim; ++i, v0_val += v0_s )
495 eleWiseReduction_( *v0_val, reduct);
498 reduct_obj.set(reduct);
506 EleWiseReduction eleWiseReduction_;
512 #define RTOP_ROP_1_REDUCT_SCALAR_CUSTOM_DEFAULT( ROP_CLASS_NAME, REDUCT_SCALAR, \
513 BASIC_REDUCT_TYPE_ENUM, CUSTOM_DEFAULT \
516 template<class Scalar, class ReductScalar> \
517 class ROP_CLASS_NAME ## EleWiseReduction \
520 inline void operator()( \
522 ReductScalar &reduct \
527 template<class Scalar> \
528 class ROP_CLASS_NAME \
529 : public RTOpPack::ROp_1_ScalarReduction< \
532 ROP_CLASS_NAME ## EleWiseReduction<Scalar, REDUCT_SCALAR >, \
533 RTOpPack::BasicReductObjReductionOp<REDUCT_SCALAR, BASIC_REDUCT_TYPE_ENUM> > \
535 typedef RTOpPack::ROp_1_ScalarReduction< \
538 ROP_CLASS_NAME ## EleWiseReduction<Scalar, REDUCT_SCALAR >, \
539 RTOpPack::BasicReductObjReductionOp<REDUCT_SCALAR, BASIC_REDUCT_TYPE_ENUM> > \
543 : base_t(CUSTOM_DEFAULT) \
545 this->setOpNameBase( #ROP_CLASS_NAME ); \
550 template<class Scalar, class ReductScalar> \
551 void ROP_CLASS_NAME ## EleWiseReduction<Scalar, ReductScalar>::operator()( \
552 const Scalar &v0, ReductScalar &reduct \
557 #define RTOP_ROP_1_REDUCT_SCALAR( ROP_CLASS_NAME, REDUCT_SCALAR, \
558 BASIC_REDUCT_TYPE_ENUM \
560 RTOP_ROP_1_REDUCT_SCALAR_CUSTOM_DEFAULT(ROP_CLASS_NAME, REDUCT_SCALAR, \
561 BASIC_REDUCT_TYPE_ENUM, Teuchos::ScalarTraits<REDUCT_SCALAR >::zero() )
574 class EleWiseReduction,
575 class ReductObjReduction = SumScalarReductObjReduction<ReductScalar>
590 const ReductScalar &initReductObjValue_in = ReductScalar(),
591 EleWiseReduction eleWiseReduction_in = EleWiseReduction(),
592 ReductObjReduction reductObjReduction_in = ReductObjReduction()
594 :
base_t(initReductObjValue_in, reductObjReduction_in),
595 eleWiseReduction_(eleWiseReduction_in)
600 { eleWiseReduction_ = eleWiseReduction_in; }
604 {
return eleWiseReduction_; }
618 const Ptr<ReductTarget> &reduct_obj_inout
625 validate_apply_op<Scalar>(*
this, 1, 0,
true,
626 sub_vecs, targ_sub_vecs, reduct_obj_inout);
633 ReductScalar reduct = reduct_obj.
get();
635 const RTOpPack::index_type subDim = sub_vecs[0].subDim();
637 const_iter_t v0_val = sub_vecs[0].values().begin();
638 const ptrdiff_t v0_s = sub_vecs[0].stride();
640 RTOpPack::index_type global_i = sub_vecs[0].globalOffset();
643 for( Teuchos_Ordinal i = 0; i < subDim; ++i, ++global_i )
644 eleWiseReduction_( global_i, *v0_val++, reduct);
647 for( Teuchos_Ordinal i = 0; i < subDim; ++i, v0_val += v0_s, ++global_i )
648 eleWiseReduction_( global_i, *v0_val, reduct);
651 reduct_obj.set(reduct);
659 EleWiseReduction eleWiseReduction_;
673 class EleWiseReduction,
674 class ReductObjReduction = SumScalarReductObjReduction<ReductScalar>
687 const ReductScalar &initReductObjValue_in = ReductScalar(),
688 EleWiseReduction eleWiseReduction_in = EleWiseReduction(),
689 ReductObjReduction reductObjReduction_in = ReductObjReduction()
691 :
base_t(initReductObjValue_in, reductObjReduction_in),
692 eleWiseReduction_(eleWiseReduction_in)
702 const Ptr<ReductTarget> &reduct_obj_inout
709 validate_apply_op<Scalar>(*
this, 2, 0,
true,
710 sub_vecs, targ_sub_vecs, reduct_obj_inout.getConst());
717 Scalar reduct = reduct_obj.
get();
719 const RTOpPack::index_type subDim = sub_vecs[0].subDim();
721 const_iter_t v0_val = sub_vecs[0].values().begin();
722 const ptrdiff_t v0_s = sub_vecs[0].stride();
723 const_iter_t v1_val = sub_vecs[1].values().begin();
724 const ptrdiff_t v1_s = sub_vecs[1].stride();
726 if( v0_s == 1 && v1_s == 1 ) {
727 for( Teuchos_Ordinal i = 0; i < subDim; ++i )
728 eleWiseReduction_( *v0_val++, *v1_val++, reduct);
731 for( Teuchos_Ordinal i = 0; i < subDim; ++i, v0_val += v0_s, v1_val += v1_s )
732 eleWiseReduction_( *v0_val, *v1_val, reduct);
735 reduct_obj.set(reduct);
743 EleWiseReduction eleWiseReduction_;
751 #define RTOP_ROP_2_REDUCT_SCALAR( ROP_CLASS_NAME, REDUCT_SCALAR, \
752 BASIC_REDUCT_TYPE_ENUM \
755 template<class Scalar, class ReductScalar> \
756 class ROP_CLASS_NAME ## EleWiseReduction \
759 inline void operator()(const Scalar &v0, \
761 ReductScalar &reduct \
766 template<class Scalar> \
767 class ROP_CLASS_NAME \
768 : public RTOpPack::ROp_2_ScalarReduction< \
771 ROP_CLASS_NAME ## EleWiseReduction<Scalar, REDUCT_SCALAR >, \
772 RTOpPack::BasicReductObjReductionOp<REDUCT_SCALAR, BASIC_REDUCT_TYPE_ENUM> > \
777 this->setOpNameBase( #ROP_CLASS_NAME ); \
778 this->initReductObjValue(ScalarTraits<REDUCT_SCALAR >::zero()); \
782 template<class Scalar, class ReductScalar> \
783 void ROP_CLASS_NAME ## EleWiseReduction<Scalar, ReductScalar>::operator()( \
784 const Scalar &v0, const Scalar &v1, ReductScalar &reduct) const
793 template<
class Scalar,
class EleWiseTransformation>
800 EleWiseTransformation eleWiseTransformation = EleWiseTransformation()
802 : eleWiseTransformation_(eleWiseTransformation)
812 const Ptr<ReductTarget> &reduct_obj_inout
818 validate_apply_op<Scalar>(*
this, 0, 1,
false,
819 sub_vecs, targ_sub_vecs, reduct_obj_inout.getConst());
822 (void)reduct_obj_inout;
825 const RTOpPack::index_type subDim = targ_sub_vecs[0].subDim();
827 iter_t z0_val = targ_sub_vecs[0].values().begin();
828 const ptrdiff_t z0_s = targ_sub_vecs[0].stride();
831 for( Teuchos_Ordinal i = 0; i < subDim; ++i )
832 eleWiseTransformation_( *z0_val++);
835 for( Teuchos_Ordinal i = 0; i < subDim; ++i, z0_val += z0_s )
836 eleWiseTransformation_( *z0_val);
845 EleWiseTransformation eleWiseTransformation_;
852 template<
class Scalar,
class EleWiseTransformation>
859 EleWiseTransformation eleWiseTransformation = EleWiseTransformation()
861 : eleWiseTransformation_(eleWiseTransformation)
867 eleWiseTransformation_ = eleWiseTransformation;
873 return eleWiseTransformation_;
886 const Ptr<ReductTarget> &reduct_obj_inout
892 validate_apply_op<Scalar>(*
this, 0, 1,
false,
893 sub_vecs, targ_sub_vecs, reduct_obj_inout.getConst());
896 (void)reduct_obj_inout;
899 const RTOpPack::index_type subDim = targ_sub_vecs[0].subDim();
901 iter_t z0_val = targ_sub_vecs[0].values().begin();
902 const ptrdiff_t z0_s = targ_sub_vecs[0].stride();
904 RTOpPack::index_type global_i = targ_sub_vecs[0].globalOffset();
907 for( Teuchos_Ordinal i = 0; i < subDim; ++i, ++global_i )
908 eleWiseTransformation_(global_i, *z0_val++);
911 for( Teuchos_Ordinal i = 0; i < subDim; ++i, z0_val += z0_s, ++global_i )
912 eleWiseTransformation_(global_i, *z0_val);
921 EleWiseTransformation eleWiseTransformation_;
932 template<
class Scalar,
class EleWiseTransformation>
939 EleWiseTransformation eleWiseTransformation = EleWiseTransformation()
941 : eleWiseTransformation_(eleWiseTransformation)
951 const Ptr<ReductTarget> &reduct_obj_inout
958 validate_apply_op<Scalar>(*
this, 1, 1,
false,
959 sub_vecs, targ_sub_vecs, reduct_obj_inout.getConst());
961 (void)reduct_obj_inout;
964 const RTOpPack::index_type subDim = sub_vecs[0].subDim();
966 const_iter_t v0_val = sub_vecs[0].values().begin();
967 const ptrdiff_t v0_s = sub_vecs[0].stride();
969 iter_t z0_val = targ_sub_vecs[0].values().begin();
970 const ptrdiff_t z0_s = targ_sub_vecs[0].stride();
972 if ( v0_s == 1 && z0_s == 1 ) {
973 for( Teuchos_Ordinal i = 0; i < subDim; ++i )
974 eleWiseTransformation_( *v0_val++, *z0_val++);
977 for( Teuchos_Ordinal i = 0; i < subDim; ++i, v0_val += v0_s, z0_val += z0_s )
978 eleWiseTransformation_( *v0_val, *z0_val);
987 EleWiseTransformation eleWiseTransformation_;
993 #define RTOP_TOP_1_1( TOP_CLASS_NAME ) \
995 template<class Scalar> \
996 class TOP_CLASS_NAME ## EleWiseTransformation \
999 inline void operator()( const Scalar &v0, Scalar &z0 ) const; \
1003 template<class Scalar> \
1004 class TOP_CLASS_NAME \
1005 : public RTOpPack::TOp_1_1_Base< Scalar, \
1006 TOP_CLASS_NAME ## EleWiseTransformation<Scalar> > \
1011 this->setOpNameBase( #TOP_CLASS_NAME ); \
1016 template<class Scalar> \
1017 void TOP_CLASS_NAME ## EleWiseTransformation<Scalar>::operator()( \
1018 const Scalar &v0, Scalar &z0 \
1028 template<
class Scalar,
class EleWiseTransformation>
1035 EleWiseTransformation eleWiseTransformation = EleWiseTransformation()
1037 : eleWiseTransformation_(eleWiseTransformation)
1047 const Ptr<ReductTarget> &reduct_obj_inout
1053 #ifdef TEUCHOS_DEBUG
1054 validate_apply_op<Scalar>(*
this, 2, 1,
false,
1055 sub_vecs, targ_sub_vecs, reduct_obj_inout);
1057 (void)reduct_obj_inout;
1060 const RTOpPack::index_type subDim = sub_vecs[0].subDim();
1062 const_iter_t v0_val = sub_vecs[0].values().begin();
1063 const ptrdiff_t v0_s = sub_vecs[0].stride();
1065 const_iter_t v1_val = sub_vecs[1].values().begin();
1066 const ptrdiff_t v1_s = sub_vecs[1].stride();
1068 iter_t z0_val = targ_sub_vecs[0].values().begin();
1069 const ptrdiff_t z0_s = targ_sub_vecs[0].stride();
1071 if ( v0_s == 1 && v1_s == 1 && z0_s == 1 ) {
1072 for( Teuchos_Ordinal i = 0; i < subDim; ++i )
1073 eleWiseTransformation_( *v0_val++, *v1_val++, *z0_val++ );
1077 Teuchos_Ordinal i = 0;
1079 ++i, v0_val += v0_s, v1_val += v1_s, z0_val += z0_s
1082 eleWiseTransformation_( *v0_val, *v1_val, *z0_val );
1093 EleWiseTransformation eleWiseTransformation_;
1098 template<
class Scalar,
class EleWiseTransformation>
1105 EleWiseTransformation eleWiseTransformation = EleWiseTransformation()
1107 : eleWiseTransformation_(eleWiseTransformation)
1117 const Ptr<ReductTarget> &reduct_obj_inout
1123 #ifdef TEUCHOS_DEBUG
1124 validate_apply_op<Scalar>(*
this, 3, 1,
false,
1125 sub_vecs, targ_sub_vecs, reduct_obj_inout);
1128 const RTOpPack::index_type subDim = sub_vecs[0].subDim();
1130 const_iter_t v0_val = sub_vecs[0].values().begin();
1131 const ptrdiff_t v0_s = sub_vecs[0].stride();
1133 const_iter_t v1_val = sub_vecs[1].values().begin();
1134 const ptrdiff_t v1_s = sub_vecs[1].stride();
1136 const_iter_t v2_val = sub_vecs[2].values().begin();
1137 const ptrdiff_t v2_s = sub_vecs[2].stride();
1139 iter_t z0_val = targ_sub_vecs[0].values().begin();
1140 const ptrdiff_t z0_s = targ_sub_vecs[0].stride();
1142 if ( v0_s == 1 && v1_s == 1 && v2_s == 1 && z0_s == 1 ) {
1143 for( Teuchos_Ordinal i = 0; i < subDim; ++i )
1144 eleWiseTransformation_( *v0_val++, *v1_val++, *v2_val++, *z0_val++ );
1148 Teuchos_Ordinal i = 0;
1150 ++i, v0_val += v0_s, v1_val += v1_s, v2_val += v2_s, z0_val += z0_s
1153 eleWiseTransformation_( *v0_val, *v1_val, *v2_val, *z0_val );
1163 EleWiseTransformation eleWiseTransformation_;
1171 #endif // RTOPPACK_RTOP_T_HELPERS_DECL_HPP
void get_reduct_type_num_entries_impl(const Ptr< int > &num_values, const Ptr< int > &num_indexes, const Ptr< int > &num_chars) const
Base class for scalar reduction RTOps with one input vector.
void apply_op_impl(const ArrayView< const ConstSubVectorView< Scalar > > &sub_vecs, const ArrayView< const SubVectorView< Scalar > > &targ_sub_vecs, const Ptr< ReductTarget > &reduct_obj_inout) const
Base class for coordinate-variant scalar reduction RTOps with one input vector.
void apply_op_impl(const ArrayView< const ConstSubVectorView< Scalar > > &sub_vecs, const ArrayView< const SubVectorView< Scalar > > &targ_sub_vecs, const Ptr< ReductTarget > &reduct_obj_inout) const
Simple ReductTarget subclass for simple scalar objects.
ROp_2_ScalarReduction(const ReductScalar &initReductObjValue_in=ReductScalar(), EleWiseReduction eleWiseReduction_in=EleWiseReduction(), ReductObjReduction reductObjReduction_in=ReductObjReduction())
Null reduction object reduction operator.
TOp_0_1_CoordVariantBase(EleWiseTransformation eleWiseTransformation=EleWiseTransformation())
bool coord_invariant_impl() const
This RTOp is NOT coordinate invariant! .
std::string description() const
const RCP< DefaultReductTarget< ConcreteReductObj > > defaultReductTarget(const ConcreteReductObj &concreteReductObj)
Nonmember constructor.
void apply_op_impl(const ArrayView< const ConstSubVectorView< Scalar > > &sub_vecs, const ArrayView< const SubVectorView< Scalar > > &targ_sub_vecs, const Ptr< ReductTarget > &reduct_obj_inout) const
STANDARD_MEMBER_COMPOSITION_MEMBERS(ConcreteReductObj, initReductObjValue)
const EleWiseReduction & getEleWiseReduction() const
void apply_op_impl(const ArrayView< const ConstSubVectorView< Scalar > > &sub_vecs, const ArrayView< const SubVectorView< Scalar > > &targ_sub_vecs, const Ptr< ReductTarget > &reduct_obj_inout) const
Base class for coordinate variant transformations for 0 input and 1 output vector.
ConcreteReductObj operator()(const ReductTarget &reduct_obj) const
Base class for transformations for 2 input and 1 output vector.
DefaultReductTarget(const ConcreteReductObj &concreteReductObj)
void operator()(const Scalar &in_reduct, Scalar &inout_reduct) const
void setEleWiseReduction(EleWiseReduction eleWiseReduction_in)
ROp_1_ScalarReduction(const ConcreteReductObj &initReductObjValue_in=ConcreteReductObj(), EleWiseReduction eleWiseReduction_in=EleWiseReduction(), ReductObjReduction reductObjReduction_in=ReductObjReduction())
T_To & dyn_cast(T_From &from)
Base class for transformations for 0 input and 1 output vector.
TOp_0_1_Base(EleWiseTransformation eleWiseTransformation=EleWiseTransformation())
void set(const ConcreteReductObj &concreteReductObj)
const ConcreteReductObj & get() const
PrimitiveTypeTraits< Scalar, Scalar > ScalarPrimitiveTypeTraits
void operator()(const ConcreteReductObj &in_reduct, ConcreteReductObj &inout_reduct) const
Base class for transformations for 1 input and 1 output vector.
TOp_1_1_Base(EleWiseTransformation eleWiseTransformation=EleWiseTransformation())
void apply_op_impl(const ArrayView< const ConstSubVectorView< Scalar > > &sub_vecs, const ArrayView< const SubVectorView< Scalar > > &targ_sub_vecs, const Ptr< ReductTarget > &reduct_obj_inout) const
ROpScalarReductionWithOpBase< Scalar, ConcreteReductObj, ReductObjReduction > base_t
Teuchos::RCP< ReductTarget > reduct_obj_create_impl() const
Simple struct for a Scalar and an Ordinal object.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void setEleWiseTransformation(EleWiseTransformation eleWiseTransformation)
void operator()(const ConcreteReductObj &in_reduct, ConcreteReductObj &inout_reduct) const
ROpScalarReductionWithOpBase(const ConcreteReductObj &initReductObjValue_in=ScalarTraits< Scalar >::zero(), ReductObjReduction reductObjReduction_in=ReductObjReduction())
TOp_2_1_Base(EleWiseTransformation eleWiseTransformation=EleWiseTransformation())
void apply_op_impl(const ArrayView< const ConstSubVectorView< Scalar > > &sub_vecs, const ArrayView< const SubVectorView< Scalar > > &targ_sub_vecs, const Ptr< ReductTarget > &reduct_obj_inout) const
virtual void reduce_reduct_objs_impl(const ReductTarget &in_reduct_obj, const Ptr< ReductTarget > &inout_reduct_obj) const
Base class for scalar reduction RTOps with two input vectors.
ROpScalarReductionWithOpBase< Scalar, ReductScalar, ReductObjReduction > base_t
void apply_op_impl(const ArrayView< const ConstSubVectorView< Scalar > > &sub_vecs, const ArrayView< const SubVectorView< Scalar > > &targ_sub_vecs, const Ptr< ReductTarget > &reduct_obj_inout) const
void apply_op_impl(const ArrayView< const ConstSubVectorView< Scalar > > &sub_vecs, const ArrayView< const SubVectorView< Scalar > > &targ_sub_vecs, const Ptr< ReductTarget > &reduct_obj_inout) const
static void loadPrimitiveObjs(const ArrayView< const primitiveType > &primitiveObjs, const ArrayView< const index_type > &indexObjs, const ArrayView< const char > &charObjs, const Ptr< ScalarIndex< Scalar > > &obj)
static int numPrimitiveObjs()
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
TOp_3_1_Base(EleWiseTransformation eleWiseTransformation=EleWiseTransformation())
static int numIndexObjs()
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 operator()(const ConcreteReductObj &in_reduct, ConcreteReductObj &inout_reduct) const
bool coord_invariant_impl() const
This RTOp is NOT coordinate invariant! .
static void extractPrimitiveObjs(const ScalarIndex< Scalar > &obj, const ArrayView< primitiveType > &primitiveObjs, const ArrayView< index_type > &indexObjs, const ArrayView< char > &charObjs)
ROpScalarReductionWithOpBase< Scalar, ReductScalar, ReductObjReduction > base_t
void operator()(const ConcreteReductObj &in_reduct, ConcreteReductObj &inout_reduct) const
RTOpT< Scalar >::primitive_value_type primitive_value_type
void setRawVal(const ConcreteReductObj &rawVal, const Ptr< ReductTarget > &reduct_obj) const
Base class for transformations for 3 input and 1 output vector.
const ConcreteReductObj & getRawVal(const ReductTarget &reduct_obj) const
ScalarIndex(const Scalar &_scalar, const Ordinal &_index)
void reduct_obj_reinit_impl(const Ptr< ReductTarget > &reduct_obj) const
const EleWiseTransformation & getEleWiseTransformation() const
ScalarPrimitiveTypeTraits::primitiveType primitiveType
ROp_1_CoordVariantScalarReduction(const ReductScalar &initReductObjValue_in=ReductScalar(), EleWiseReduction eleWiseReduction_in=EleWiseReduction(), ReductObjReduction reductObjReduction_in=ReductObjReduction())
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)