11 #ifndef RTOPPACK_UNARY_FUNC_PTR_HPP
12 #define RTOPPACK_UNARY_FUNC_PTR_HPP
14 #include "RTOpPack_TOpUnaryFuncPtrDecl.hpp"
18 template<
class Scalar>
20 :
RTOpT<Scalar>(
"TOpUnaryFuncPtr")
25 template<
class Scalar>
27 unary_func_ptr_t unary_func_ptr
28 ,
const std::string &op_name
30 :
RTOpT<Scalar>(
"TOpUnaryFuncPtr")
35 template<
class Scalar>
37 unary_func_ptr_t unary_func_ptr
38 ,
const std::string &op_name
42 unary_func_ptr_ = unary_func_ptr;
46 template<
class Scalar>
48 unary_func_ptr_t *unary_func_ptr
52 if(unary_func_ptr) *unary_func_ptr = unary_func_ptr_;
53 if(op_name) *op_name = op_name_;
55 unary_func_ptr_ = NULL;
56 op_name_ =
"uninitialized()";
61 template<
class Scalar>
64 return op_name_.c_str();
67 template<
class Scalar>
78 TEUCHOS_TEST_FOR_EXCEPTION( targ_sub_vecs[0].stride() != 1, std::invalid_argument,
"Error, can't handle non-unit strides here!" );
82 unary_func_ptr_( sub_vecs[0].values(), sub_vecs[0].subDim(), targ_sub_vecs[0].values() );
88 #endif // RTOPPACK_UNARY_FUNC_PTR_HPP
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
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