RTOp Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RTOpPack_TOpEleWiseConjProd.hpp
Go to the documentation of this file.
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_ELE_WISE_CONJ_PROD_HPP
12 #define RTOPPACK_TOP_ELE_WISE_CONJ_PROD_HPP
13 
14 
15 #include "RTOpPack_RTOpTHelpers.hpp"
16 
17 
18 namespace RTOpPack {
19 
20 
22 template<class Scalar>
24 {
25 public:
27  : alpha_(alpha)
28  {}
29  void operator()( const Scalar &v0, const Scalar &v1, Scalar &z0 ) const
30  {
31  z0 += alpha_ * ScalarTraits<Scalar>::conjugate(v0) * v1;
32  }
33 private:
34  Scalar alpha_;
35 };
36 
37 
41 template<class Scalar>
43  : public TOp_2_1_Base<Scalar, TOpEleWiseConjProdEleWiseTransformation<Scalar> >
44 {
45 public:
48  TOpEleWiseConjProd( const Scalar &alpha )
50  {
51  this->setOpNameBase("TOpEleWiseConjProd");
52  }
53 };
54 
55 
56 } // namespace RTOpPack
57 
58 
59 #endif // RTOPPACK_TOP_ELE_WISE_CONJ_PROD_HPP
Base class for transformations for 2 input and 1 output vector.
void operator()(const Scalar &v0, const Scalar &v1, Scalar &z0) const
static T conjugate(T a)
TOp_2_1_Base< Scalar, TOpEleWiseConjProdEleWiseTransformation< Scalar > > base_t
Element-wise product transformation operator: z0[i] += alpha*conj(v0[i])*v1[i], i=0...n-1.
void setOpNameBase(const std::string &op_name_base)
Just set the operator name.
Element-wise transformation operator for TOpEleWiseConjProd.