tfel
Loading...
Searching...
No Matches
tfel::math::dotProduct< N > Class Template Reference

dotProduct calculates a generalized inner product of the ranges [first1,first1+N) and [first2,first2+N) More...

#include </home/runner/work/tfel/tfel/include/TFEL/Math/General/DotProduct.hxx>

Static Public Member Functions

template<typename InputIterator1, typename InputIterator2, typename T>
static TFEL_HOST_DEVICE constexpr T exe (InputIterator1 p, InputIterator2 q, T init)

Detailed Description

template<unsigned int N>
class tfel::math::dotProduct< N >

dotProduct calculates a generalized inner product of the ranges [first1,first1+N) and [first2,first2+N)

Parameters
Nnumber of element of each ranges

Contrary to inner_product, dotProduct takes automatically into account the fact that complex must be conjugated

See also
inner_product
Author
Thomas Helfer
Date
01/09/2006

Member Function Documentation

◆ exe()

template<unsigned int N>
template<typename InputIterator1, typename InputIterator2, typename T>
TFEL_HOST_DEVICE constexpr T tfel::math::dotProduct< N >::exe ( InputIterator1 p,
InputIterator2 q,
T init )
inlinestaticconstexpr

The first version of dotProduct returns init plus the inner product of the two ranges [1]. That is, it first initializes the result to init and then computes:

\[\displaystyle\mathrm{init}+\sum_{i=0}^{N-1}\overline{(*(p+i))}*(*(q+i))\]

Parameters
InputIterator1iterator to the first range
InputIterator2iterator to the second range
Tinitial value
Returns
T, result of the inner product
Precondition
  • InputIterator1 is a model of Input Iterator.
  • InputIterator2 is a model of Input Iterator.
  • T is a model of Assignable.
  • If x is an object of type T, y is an object of InputIterator1's value type, and z is an object of InputIterator2's value type, then x + y * z is defined.
  • The type of x + y * z is convertible to T.

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