|
tfel
|
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) |
dotProduct calculates a generalized inner product of the ranges [first1,first1+N) and [first2,first2+N)
| N | number of element of each ranges |
Contrary to inner_product, dotProduct takes automatically into account the fact that complex must be conjugated
|
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))\]
| InputIterator1 | iterator to the first range |
| InputIterator2 | iterator to the second range |
| T | initial value |