inner

constexpr std::vector<Complex> inner(const std::vector<Complex> &X, const std::vector<Complex> &Y) noexcept

Performs the discrete inner product [1] on two complex sequences.

Parameters

const std::vector<Complex> &X

A complex sequence.

const std::vector<Complex> &Y

A complex sequence.

Returns

Complex

A complex number.

The discrete inner product performs the following operation on two sequences \(X\) and \(Y\):

\[\newcommand{\compconj}[1]{% \overline{#1}% } \langle X, Y \rangle = X \cdot \compconj{Y}\]

Example

std::vector<Complex> X = {1, 2, 3, 4, 5};
std::vector<Complex> Y = {1 + 5_j, 2 + 1_j, 3, 4, 5};

std::cout << inner(X, Y) << "\n";

Output:

55 - 7j

References