Collection of Concrete Vector Reduction/Transformation Operator Implementations  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RTOpPack_TOpAssignScalar.hpp
1 // @HEADER
2 // *****************************************************************************
3 // RTOp: Interfaces and Support Software for Vector Reduction Transformation
4 // Operations
5 //
6 // Copyright 2006 NTESS and the RTOp contributors.
7 // SPDX-License-Identifier: BSD-3-Clause
8 // *****************************************************************************
9 // @HEADER
10 
11 #ifndef RTOPPACK_TOP_ASSIGN_SCALAR_HPP
12 #define RTOPPACK_TOP_ASSIGN_SCALAR_HPP
13 
14 #include "RTOpPack_RTOpTHelpers.hpp"
15 
16 
17 namespace RTOpPack {
18 
19 
21 template<class Scalar>
23 {
24 public:
25  TOpAssignScalarEleWiseTransformation( const Scalar &alpha )
26  {
27  alpha_ = alpha;
28  }
29  void operator()( Scalar &z0 ) const
30  {
31  z0 = alpha_;
32  }
33 private:
34  Scalar alpha_;
35  TOpAssignScalarEleWiseTransformation(); // Not defined
36 };
37 
38 
42 template<class Scalar>
44  : public TOp_0_1_Base<Scalar, TOpAssignScalarEleWiseTransformation<Scalar> >
45 {
46 public:
49  TOpAssignScalar( const Scalar &alpha )
51  {
52  this->setOpNameBase("TOpAssignScalar");
53  }
54 };
55 
56 
57 } // namespace RTOpPack
58 
59 
60 #endif // RTOPPACK_TOP_ASSIGN_SCALAR_HPP
Assign a scalar to a vector transformation operator: z0[i] = alpha, i=0...n-1.
Element-wise transformation operator for TOpAssignScalar.
void setOpNameBase(const std::string &op_name_base)