43 #ifndef RTOPPACK_UNARY_FUNC_PTR_HPP
44 #define RTOPPACK_UNARY_FUNC_PTR_HPP
50 template<
class Scalar>
52 :
RTOpT<Scalar>(
"TOpUnaryFuncPtr")
57 template<
class Scalar>
59 unary_func_ptr_t unary_func_ptr
60 ,
const std::string &op_name
62 :
RTOpT<Scalar>(
"TOpUnaryFuncPtr")
67 template<
class Scalar>
69 unary_func_ptr_t unary_func_ptr
70 ,
const std::string &op_name
74 unary_func_ptr_ = unary_func_ptr;
78 template<
class Scalar>
80 unary_func_ptr_t *unary_func_ptr
84 if(unary_func_ptr) *unary_func_ptr = unary_func_ptr_;
85 if(op_name) *op_name = op_name_;
87 unary_func_ptr_ = NULL;
88 op_name_ =
"uninitialized()";
93 template<
class Scalar>
96 return op_name_.c_str();
99 template<
class Scalar>
110 TEUCHOS_TEST_FOR_EXCEPTION( targ_sub_vecs[0].stride() != 1, std::invalid_argument,
"Error, can't handle non-unit strides here!" );
114 unary_func_ptr_( sub_vecs[0].values(), sub_vecs[0].subDim(), targ_sub_vecs[0].values() );
120 #endif // RTOPPACK_UNARY_FUNC_PTR_HPP
Class for a changeable sub-vector.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Class for a non-changeable sub-vector.
Templated interface to vector reduction/transformation operators {abstract}.
Abstract base class for all reduction objects.
void set_initialized(unary_func_ptr_t *unary_func_ptr=NULL, std::string *op_name=NULL)
Set uninitialized.
TOpUnaryFuncPtr()
Construct to uninitialized.
void initialize(unary_func_ptr_t unary_func_ptr, const std::string &op_name)
Initialize.
void apply_op(const int num_vecs, const ConstSubVectorView< Scalar > sub_vecs[], const int num_targ_vecs, const SubVectorView< Scalar > targ_sub_vecs[], ReductTarget *reduct_obj) const
const char * op_name() const