inner
-
constexpr Complex inner(Complex (*f)(Complex), Complex (*g)(Complex), const Complex &z, const Complex &a, const Complex &b) noexcept
Performs the inner product operation [1] on two complex functions.
Parameters
Returns
- type Complex
A complex number.
The inner product of two complex functions \(f\) and \(g\) is defined as:
\[\newcommand{\compconj}[1]{%
\overline{#1}%
}
\langle f, g \rangle = \int_{a}^{b}f(t)\compconj{g(t)}dt\]
Example
auto f = [](Complex t) { return exp(-t * t); };
auto g = [](Complex t) { return exp(-t * t); };
Complex z = 1;
Complex a = 0;
Complex b = 1;
std::cout << inner(f, g, z, a, b) << "\n";
Output:
0.598144 + 0j
References