11 #ifndef RTOPPACK_RTOP_T_HELPERS_DECL_HPP
12 #define RTOPPACK_RTOP_T_HELPERS_DECL_HPP
21 #include "RTOpPack_RTOpT.hpp"
24 #include "Teuchos_dyn_cast.hpp"
28 #ifdef RTOPPACK_RTOPT_HELPER_DUMP_OUTPUT
29 # include "Teuchos_VerboseObject.hpp"
30 namespace RTOpPack {
extern bool rtop_helpers_dump_all; }
31 #endif // RTOPPACK_RTOPT_HELPER_DUMP_OUTPUT
41 template<
class Scalar>
62 template<
class Scalar>
63 std::ostream& operator<<(std::ostream &out, const ScalarIndex<Scalar> &scalarIndex)
65 out <<
"{"<<scalarIndex.scalar<<
","<<scalarIndex.index<<
"}";
73 template <
class Scalar>
81 static int numPrimitiveObjs() {
return ScalarPrimitiveTypeTraits::numPrimitiveObjs(); }
89 const ArrayView<primitiveType> &primitiveObjs,
90 const ArrayView<index_type> &indexObjs,
91 const ArrayView<char> &charObjs
94 assertInput(primitiveObjs, indexObjs, charObjs);
95 ScalarPrimitiveTypeTraits::extractPrimitiveObjs(
96 obj.
scalar, primitiveObjs, Teuchos::null, Teuchos::null );
97 indexObjs[0] = obj.
index;
101 const ArrayView<const primitiveType> &primitiveObjs,
102 const ArrayView<const index_type> &indexObjs,
103 const ArrayView<const char> &charObjs,
107 assertInput(primitiveObjs, indexObjs, charObjs);
108 ScalarPrimitiveTypeTraits::loadPrimitiveObjs(
109 primitiveObjs, Teuchos::null, Teuchos::null,
110 Teuchos::outArg(obj->scalar) );
111 obj->index = indexObjs[0];
114 static void assertInput(
115 const ArrayView<const primitiveType> &primitiveObjs,
116 const ArrayView<const index_type> &indexObjs,
117 const ArrayView<const char> &charObjs
122 primitiveObjs.size()!=ScalarPrimitiveTypeTraits::numPrimitiveObjs()
123 || indexObjs.size()!=1
124 || charObjs.size()!=0 );
138 template<
class ConcreteReductObj>
143 : concreteReductObj_(concreteReductObj)
146 void set(
const ConcreteReductObj &concreteReductObj )
147 { concreteReductObj_ = concreteReductObj; }
149 const ConcreteReductObj&
get()
const
150 {
return concreteReductObj_; }
154 ConcreteReductObj concreteReductObj_;
162 template<
class ConcreteReductObj>
163 const RCP<DefaultReductTarget<ConcreteReductObj> >
193 template<
class Scalar>
194 void validate_apply_op(
196 const int allowed_num_sub_vecs,
197 const int allowed_num_targ_sub_vecs,
198 const bool expect_reduct_obj,
201 const Ptr<const ReductTarget> &reduct_obj
211 enum EBasicReductTypes { REDUCT_TYPE_SUM, REDUCT_TYPE_MAX, REDUCT_TYPE_MIN };
215 template<
class ConcreteReductObj,
int ReductionType>
219 inline void operator()(
const ConcreteReductObj& in_reduct, ConcreteReductObj& inout_reduct)
const
221 return in_reduct.this_reduction_type_needs_a_specialization();
227 template<
class ConcreteReductObj>
231 inline void operator()(
const ConcreteReductObj& in_reduct, ConcreteReductObj& inout_reduct)
const
233 inout_reduct += in_reduct;
239 template<
class ConcreteReductObj>
243 inline void operator()(
const ConcreteReductObj& in_reduct, ConcreteReductObj& inout_reduct)
const
245 inout_reduct = std::max(inout_reduct, in_reduct);
251 template<
class ConcreteReductObj>
255 inline void operator()(
const ConcreteReductObj& in_reduct, ConcreteReductObj& inout_reduct)
const
257 inout_reduct = std::min(inout_reduct, in_reduct);
263 template<
class Scalar>
267 inline void operator()(
const Scalar& in_reduct, Scalar& inout_reduct)
const
269 inout_reduct += in_reduct;
278 template<
class Scalar,
class ConcreteReductObj,
class ReductObjReduction>
291 const ConcreteReductObj &initReductObjValue_in = ScalarTraits<Scalar>::zero(),
292 ReductObjReduction reductObjReduction_in = ReductObjReduction()
294 : initReductObjValue_(initReductObjValue_in),
295 reductObjReduction_(reductObjReduction_in)
307 const Ptr<ReductTarget> &reduct_obj
325 const Ptr<int> &num_values,
326 const Ptr<int> &num_indexes,
327 const Ptr<int> &num_chars
331 *num_values = PTT::numPrimitiveObjs();
332 *num_indexes = PTT::numIndexObjs();
333 *num_chars = PTT::numCharObjs();
345 const ReductTarget& in_reduct_obj,
const Ptr<ReductTarget>& inout_reduct_obj
348 const ConcreteReductObj scalar_in_reduct_obj = this->
getRawVal(in_reduct_obj);
349 ConcreteReductObj scalar_inout_reduct_obj = this->
getRawVal(*inout_reduct_obj);
350 reductObjReduction_(scalar_in_reduct_obj, scalar_inout_reduct_obj);
351 this->
setRawVal( scalar_inout_reduct_obj, inout_reduct_obj );
357 setRawVal( initReductObjValue(), reduct_obj );
363 const ArrayView<primitive_value_type> &value_data,
364 const ArrayView<index_type> &index_data,
365 const ArrayView<char_type> &char_data
369 PTT::extractPrimitiveObjs(
getRawVal(reduct_obj),
370 value_data, index_data, char_data );
375 const ArrayView<const primitive_value_type> &value_data,
376 const ArrayView<const index_type> &index_data,
377 const ArrayView<const char_type> &char_data,
378 const Ptr<ReductTarget> &reduct_obj
382 ConcreteReductObj concrete_reduct_obj;
383 PTT::loadPrimitiveObjs( value_data, index_data, char_data,
384 Teuchos::outArg(concrete_reduct_obj) );
385 this->
setRawVal( concrete_reduct_obj, reduct_obj );
397 ReductObjReduction reductObjReduction_;
408 template<
class Scalar,
class ConcreteReductObj,
class EleWiseReduction,
409 class ReductObjReduction = SumScalarReductObjReduction<ConcreteReductObj> >
420 const ConcreteReductObj &initReductObjValue_in = ConcreteReductObj(),
421 EleWiseReduction eleWiseReduction_in = EleWiseReduction(),
422 ReductObjReduction reductObjReduction_in = ReductObjReduction()
424 :
base_t(initReductObjValue_in, reductObjReduction_in),
425 eleWiseReduction_(eleWiseReduction_in)
435 const Ptr<ReductTarget> &reduct_obj_inout
442 validate_apply_op<Scalar>(*
this, 1, 0,
true,
443 sub_vecs, targ_sub_vecs, reduct_obj_inout.getConst());
450 ConcreteReductObj reduct = reduct_obj.
get();
452 const RTOpPack::index_type subDim = sub_vecs[0].subDim();
454 const_iter_t v0_val = sub_vecs[0].values().begin();
455 const ptrdiff_t v0_s = sub_vecs[0].stride();
458 for( Teuchos_Ordinal i = 0; i < subDim; ++i )
459 eleWiseReduction_( *v0_val++, reduct);
462 for( Teuchos_Ordinal i = 0; i < subDim; ++i, v0_val += v0_s )
463 eleWiseReduction_( *v0_val, reduct);
466 reduct_obj.set(reduct);
474 EleWiseReduction eleWiseReduction_;
480 #define RTOP_ROP_1_REDUCT_SCALAR_CUSTOM_DEFAULT( ROP_CLASS_NAME, REDUCT_SCALAR, \
481 BASIC_REDUCT_TYPE_ENUM, CUSTOM_DEFAULT \
484 template<class Scalar, class ReductScalar> \
485 class ROP_CLASS_NAME ## EleWiseReduction \
488 inline void operator()( \
490 ReductScalar &reduct \
495 template<class Scalar> \
496 class ROP_CLASS_NAME \
497 : public RTOpPack::ROp_1_ScalarReduction< \
500 ROP_CLASS_NAME ## EleWiseReduction<Scalar, REDUCT_SCALAR >, \
501 RTOpPack::BasicReductObjReductionOp<REDUCT_SCALAR, BASIC_REDUCT_TYPE_ENUM> > \
503 typedef RTOpPack::ROp_1_ScalarReduction< \
506 ROP_CLASS_NAME ## EleWiseReduction<Scalar, REDUCT_SCALAR >, \
507 RTOpPack::BasicReductObjReductionOp<REDUCT_SCALAR, BASIC_REDUCT_TYPE_ENUM> > \
511 : base_t(CUSTOM_DEFAULT) \
513 this->setOpNameBase( #ROP_CLASS_NAME ); \
518 template<class Scalar, class ReductScalar> \
519 void ROP_CLASS_NAME ## EleWiseReduction<Scalar, ReductScalar>::operator()( \
520 const Scalar &v0, ReductScalar &reduct \
525 #define RTOP_ROP_1_REDUCT_SCALAR( ROP_CLASS_NAME, REDUCT_SCALAR, \
526 BASIC_REDUCT_TYPE_ENUM \
528 RTOP_ROP_1_REDUCT_SCALAR_CUSTOM_DEFAULT(ROP_CLASS_NAME, REDUCT_SCALAR, \
529 BASIC_REDUCT_TYPE_ENUM, Teuchos::ScalarTraits<REDUCT_SCALAR >::zero() )
542 class EleWiseReduction,
543 class ReductObjReduction = SumScalarReductObjReduction<ReductScalar>
558 const ReductScalar &initReductObjValue_in = ReductScalar(),
559 EleWiseReduction eleWiseReduction_in = EleWiseReduction(),
560 ReductObjReduction reductObjReduction_in = ReductObjReduction()
562 :
base_t(initReductObjValue_in, reductObjReduction_in),
563 eleWiseReduction_(eleWiseReduction_in)
568 { eleWiseReduction_ = eleWiseReduction_in; }
572 {
return eleWiseReduction_; }
586 const Ptr<ReductTarget> &reduct_obj_inout
593 validate_apply_op<Scalar>(*
this, 1, 0,
true,
594 sub_vecs, targ_sub_vecs, reduct_obj_inout);
601 ReductScalar reduct = reduct_obj.
get();
603 const RTOpPack::index_type subDim = sub_vecs[0].subDim();
605 const_iter_t v0_val = sub_vecs[0].values().begin();
606 const ptrdiff_t v0_s = sub_vecs[0].stride();
608 RTOpPack::index_type global_i = sub_vecs[0].globalOffset();
611 for( Teuchos_Ordinal i = 0; i < subDim; ++i, ++global_i )
612 eleWiseReduction_( global_i, *v0_val++, reduct);
615 for( Teuchos_Ordinal i = 0; i < subDim; ++i, v0_val += v0_s, ++global_i )
616 eleWiseReduction_( global_i, *v0_val, reduct);
619 reduct_obj.set(reduct);
627 EleWiseReduction eleWiseReduction_;
641 class EleWiseReduction,
642 class ReductObjReduction = SumScalarReductObjReduction<ReductScalar>
655 const ReductScalar &initReductObjValue_in = ReductScalar(),
656 EleWiseReduction eleWiseReduction_in = EleWiseReduction(),
657 ReductObjReduction reductObjReduction_in = ReductObjReduction()
659 :
base_t(initReductObjValue_in, reductObjReduction_in),
660 eleWiseReduction_(eleWiseReduction_in)
670 const Ptr<ReductTarget> &reduct_obj_inout
677 validate_apply_op<Scalar>(*
this, 2, 0,
true,
678 sub_vecs, targ_sub_vecs, reduct_obj_inout.getConst());
685 Scalar reduct = reduct_obj.
get();
687 const RTOpPack::index_type subDim = sub_vecs[0].subDim();
689 const_iter_t v0_val = sub_vecs[0].values().begin();
690 const ptrdiff_t v0_s = sub_vecs[0].stride();
691 const_iter_t v1_val = sub_vecs[1].values().begin();
692 const ptrdiff_t v1_s = sub_vecs[1].stride();
694 if( v0_s == 1 && v1_s == 1 ) {
695 for( Teuchos_Ordinal i = 0; i < subDim; ++i )
696 eleWiseReduction_( *v0_val++, *v1_val++, reduct);
699 for( Teuchos_Ordinal i = 0; i < subDim; ++i, v0_val += v0_s, v1_val += v1_s )
700 eleWiseReduction_( *v0_val, *v1_val, reduct);
703 reduct_obj.set(reduct);
711 EleWiseReduction eleWiseReduction_;
719 #define RTOP_ROP_2_REDUCT_SCALAR( ROP_CLASS_NAME, REDUCT_SCALAR, \
720 BASIC_REDUCT_TYPE_ENUM \
723 template<class Scalar, class ReductScalar> \
724 class ROP_CLASS_NAME ## EleWiseReduction \
727 inline void operator()(const Scalar &v0, \
729 ReductScalar &reduct \
734 template<class Scalar> \
735 class ROP_CLASS_NAME \
736 : public RTOpPack::ROp_2_ScalarReduction< \
739 ROP_CLASS_NAME ## EleWiseReduction<Scalar, REDUCT_SCALAR >, \
740 RTOpPack::BasicReductObjReductionOp<REDUCT_SCALAR, BASIC_REDUCT_TYPE_ENUM> > \
745 this->setOpNameBase( #ROP_CLASS_NAME ); \
746 this->initReductObjValue(ScalarTraits<REDUCT_SCALAR >::zero()); \
750 template<class Scalar, class ReductScalar> \
751 void ROP_CLASS_NAME ## EleWiseReduction<Scalar, ReductScalar>::operator()( \
752 const Scalar &v0, const Scalar &v1, ReductScalar &reduct) const
761 template<
class Scalar,
class EleWiseTransformation>
768 EleWiseTransformation eleWiseTransformation = EleWiseTransformation()
770 : eleWiseTransformation_(eleWiseTransformation)
780 const Ptr<ReductTarget> &reduct_obj_inout
786 validate_apply_op<Scalar>(*
this, 0, 1,
false,
787 sub_vecs, targ_sub_vecs, reduct_obj_inout.getConst());
790 (void)reduct_obj_inout;
793 const RTOpPack::index_type subDim = targ_sub_vecs[0].subDim();
795 iter_t z0_val = targ_sub_vecs[0].values().begin();
796 const ptrdiff_t z0_s = targ_sub_vecs[0].stride();
799 for( Teuchos_Ordinal i = 0; i < subDim; ++i )
800 eleWiseTransformation_( *z0_val++);
803 for( Teuchos_Ordinal i = 0; i < subDim; ++i, z0_val += z0_s )
804 eleWiseTransformation_( *z0_val);
813 EleWiseTransformation eleWiseTransformation_;
820 template<
class Scalar,
class EleWiseTransformation>
827 EleWiseTransformation eleWiseTransformation = EleWiseTransformation()
829 : eleWiseTransformation_(eleWiseTransformation)
835 eleWiseTransformation_ = eleWiseTransformation;
841 return eleWiseTransformation_;
854 const Ptr<ReductTarget> &reduct_obj_inout
860 validate_apply_op<Scalar>(*
this, 0, 1,
false,
861 sub_vecs, targ_sub_vecs, reduct_obj_inout.getConst());
864 (void)reduct_obj_inout;
867 const RTOpPack::index_type subDim = targ_sub_vecs[0].subDim();
869 iter_t z0_val = targ_sub_vecs[0].values().begin();
870 const ptrdiff_t z0_s = targ_sub_vecs[0].stride();
872 RTOpPack::index_type global_i = targ_sub_vecs[0].globalOffset();
875 for( Teuchos_Ordinal i = 0; i < subDim; ++i, ++global_i )
876 eleWiseTransformation_(global_i, *z0_val++);
879 for( Teuchos_Ordinal i = 0; i < subDim; ++i, z0_val += z0_s, ++global_i )
880 eleWiseTransformation_(global_i, *z0_val);
889 EleWiseTransformation eleWiseTransformation_;
900 template<
class Scalar,
class EleWiseTransformation>
907 EleWiseTransformation eleWiseTransformation = EleWiseTransformation()
909 : eleWiseTransformation_(eleWiseTransformation)
919 const Ptr<ReductTarget> &reduct_obj_inout
926 validate_apply_op<Scalar>(*
this, 1, 1,
false,
927 sub_vecs, targ_sub_vecs, reduct_obj_inout.getConst());
929 (void)reduct_obj_inout;
932 const RTOpPack::index_type subDim = sub_vecs[0].subDim();
934 const_iter_t v0_val = sub_vecs[0].values().begin();
935 const ptrdiff_t v0_s = sub_vecs[0].stride();
937 iter_t z0_val = targ_sub_vecs[0].values().begin();
938 const ptrdiff_t z0_s = targ_sub_vecs[0].stride();
940 if ( v0_s == 1 && z0_s == 1 ) {
941 for( Teuchos_Ordinal i = 0; i < subDim; ++i )
942 eleWiseTransformation_( *v0_val++, *z0_val++);
945 for( Teuchos_Ordinal i = 0; i < subDim; ++i, v0_val += v0_s, z0_val += z0_s )
946 eleWiseTransformation_( *v0_val, *z0_val);
955 EleWiseTransformation eleWiseTransformation_;
961 #define RTOP_TOP_1_1( TOP_CLASS_NAME ) \
963 template<class Scalar> \
964 class TOP_CLASS_NAME ## EleWiseTransformation \
967 inline void operator()( const Scalar &v0, Scalar &z0 ) const; \
971 template<class Scalar> \
972 class TOP_CLASS_NAME \
973 : public RTOpPack::TOp_1_1_Base< Scalar, \
974 TOP_CLASS_NAME ## EleWiseTransformation<Scalar> > \
979 this->setOpNameBase( #TOP_CLASS_NAME ); \
984 template<class Scalar> \
985 void TOP_CLASS_NAME ## EleWiseTransformation<Scalar>::operator()( \
986 const Scalar &v0, Scalar &z0 \
996 template<
class Scalar,
class EleWiseTransformation>
1003 EleWiseTransformation eleWiseTransformation = EleWiseTransformation()
1005 : eleWiseTransformation_(eleWiseTransformation)
1015 const Ptr<ReductTarget> &reduct_obj_inout
1021 #ifdef TEUCHOS_DEBUG
1022 validate_apply_op<Scalar>(*
this, 2, 1,
false,
1023 sub_vecs, targ_sub_vecs, reduct_obj_inout);
1025 (void)reduct_obj_inout;
1028 const RTOpPack::index_type subDim = sub_vecs[0].subDim();
1030 const_iter_t v0_val = sub_vecs[0].values().begin();
1031 const ptrdiff_t v0_s = sub_vecs[0].stride();
1033 const_iter_t v1_val = sub_vecs[1].values().begin();
1034 const ptrdiff_t v1_s = sub_vecs[1].stride();
1036 iter_t z0_val = targ_sub_vecs[0].values().begin();
1037 const ptrdiff_t z0_s = targ_sub_vecs[0].stride();
1039 if ( v0_s == 1 && v1_s == 1 && z0_s == 1 ) {
1040 for( Teuchos_Ordinal i = 0; i < subDim; ++i )
1041 eleWiseTransformation_( *v0_val++, *v1_val++, *z0_val++ );
1045 Teuchos_Ordinal i = 0;
1047 ++i, v0_val += v0_s, v1_val += v1_s, z0_val += z0_s
1050 eleWiseTransformation_( *v0_val, *v1_val, *z0_val );
1061 EleWiseTransformation eleWiseTransformation_;
1066 template<
class Scalar,
class EleWiseTransformation>
1073 EleWiseTransformation eleWiseTransformation = EleWiseTransformation()
1075 : eleWiseTransformation_(eleWiseTransformation)
1085 const Ptr<ReductTarget> &reduct_obj_inout
1091 #ifdef TEUCHOS_DEBUG
1092 validate_apply_op<Scalar>(*
this, 3, 1,
false,
1093 sub_vecs, targ_sub_vecs, reduct_obj_inout);
1096 const RTOpPack::index_type subDim = sub_vecs[0].subDim();
1098 const_iter_t v0_val = sub_vecs[0].values().begin();
1099 const ptrdiff_t v0_s = sub_vecs[0].stride();
1101 const_iter_t v1_val = sub_vecs[1].values().begin();
1102 const ptrdiff_t v1_s = sub_vecs[1].stride();
1104 const_iter_t v2_val = sub_vecs[2].values().begin();
1105 const ptrdiff_t v2_s = sub_vecs[2].stride();
1107 iter_t z0_val = targ_sub_vecs[0].values().begin();
1108 const ptrdiff_t z0_s = targ_sub_vecs[0].stride();
1110 if ( v0_s == 1 && v1_s == 1 && v2_s == 1 && z0_s == 1 ) {
1111 for( Teuchos_Ordinal i = 0; i < subDim; ++i )
1112 eleWiseTransformation_( *v0_val++, *v1_val++, *v2_val++, *z0_val++ );
1116 Teuchos_Ordinal i = 0;
1118 ++i, v0_val += v0_s, v1_val += v1_s, v2_val += v2_s, z0_val += z0_s
1121 eleWiseTransformation_( *v0_val, *v1_val, *v2_val, *z0_val );
1131 EleWiseTransformation eleWiseTransformation_;
1139 #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)