QMCPACK
OTCDot< T1, T2, D > Struct Template Reference
+ Collaboration diagram for OTCDot< T1, T2, D >:

Public Types

using Type_t = typename BinaryReturn< T1, T2, OpMultiply >::Type_t
 

Static Public Member Functions

static Type_t apply (const TinyVector< std::complex< T1 >, D > &lhs, const TinyVector< std::complex< T2 >, D > &rhs)
 
static std::complex< Type_tcplx_apply (const TinyVector< std::complex< T1 >, D > &lhs, const TinyVector< std::complex< T2 >, D > &rhs)
 

Detailed Description

template<class T1, class T2, unsigned D>
struct qmcplusplus::OTCDot< T1, T2, D >

Definition at line 42 of file ParticleAttribOps.h.

Member Typedef Documentation

◆ Type_t

using Type_t = typename BinaryReturn<T1, T2, OpMultiply>::Type_t

Definition at line 44 of file ParticleAttribOps.h.

Member Function Documentation

◆ apply()

static Type_t apply ( const TinyVector< std::complex< T1 >, D > &  lhs,
const TinyVector< std::complex< T2 >, D > &  rhs 
)
inlinestatic

Definition at line 45 of file ParticleAttribOps.h.

References qmcplusplus::real().

Referenced by qmcplusplus::complex_test_case(), qmcplusplus::dlaplacian(), qmcplusplus::Dot(), and qmcplusplus::laplacian().

46  {
47  Type_t res = lhs[0].real() * rhs[0].real() - lhs[0].imag() * rhs[0].imag();
48  for (unsigned d = 1; d < D; ++d)
49  res += lhs[d].real() * rhs[d].real() - lhs[d].imag() * rhs[d].imag();
50  return res;
51  }
float real(const float &c)
real part of a scalar. Cannot be replaced by std::real due to AFQMC specific needs.
typename BinaryReturn< T1, T2, OpMultiply >::Type_t Type_t

◆ cplx_apply()

static std::complex<Type_t> cplx_apply ( const TinyVector< std::complex< T1 >, D > &  lhs,
const TinyVector< std::complex< T2 >, D > &  rhs 
)
inlinestatic

Definition at line 53 of file ParticleAttribOps.h.

Referenced by qmcplusplus::CplxDot().

55  {
56  std::complex<Type_t> res = lhs[0] * rhs[0];
57  for (unsigned d = 1; d < D; ++d)
58  res += lhs[d] * rhs[d];
59  return res;
60  }

The documentation for this struct was generated from the following file: