|
akreon-linalg
Fixed-size linear algebra and numerical methods in C++26.
|
Canonical inner product on a fixed-size vector over a scalar field. More...
#include <inner_product.hpp>
Public Types | |
| using | domain_type = remove_cvref_t< Vec > |
| Unqualified vector type accepted by both arguments. | |
| using | scalar_type = vector_element_t< domain_type > |
| Real or complex scalar field of the vector domain. | |
| using | codomain_type = scalar_type |
Scalar result type; equal to scalar_type. | |
Public Member Functions | |
| constexpr codomain_type | operator() (const domain_type &lhs, const domain_type &rhs) const |
| Pair two vectors from the same domain. | |
Canonical inner product on a fixed-size vector over a scalar field.
For a real vector, evaluation computes sum_i(lhs(i) * rhs(i)). For a complex vector, it computes the Hermitian inner product sum_i(conj(lhs(i)) * rhs(i)): the first argument is conjugate-linear and the second is linear. This convention makes <x, x> real and nonnegative mathematically, although its C++ return type remains the vector's scalar type (including std::complex<T>).
The vector dimension is known at compile time, the accumulation begins from the scalar's value-initialized zero, and evaluation is constexpr whenever the scalar operations are constant-evaluable.
| Vec | Field-vector domain. cv/ref qualification is normalized in the associated types. |
Definition at line 34 of file inner_product.hpp.
| using linalg::StandardInnerProduct< Vec >::codomain_type = scalar_type |
Scalar result type; equal to scalar_type.
Definition at line 40 of file inner_product.hpp.
| using linalg::StandardInnerProduct< Vec >::domain_type = remove_cvref_t<Vec> |
Unqualified vector type accepted by both arguments.
Definition at line 36 of file inner_product.hpp.
| using linalg::StandardInnerProduct< Vec >::scalar_type = vector_element_t<domain_type> |
Real or complex scalar field of the vector domain.
Definition at line 38 of file inner_product.hpp.
|
inlineconstexpr |
Pair two vectors from the same domain.
| lhs | First argument; conjugated element-wise for a complex field. |
| rhs | Second argument; never conjugated. |
Definition at line 48 of file inner_product.hpp.
References linalg::mat_rows_v.