akreon-linalg
Fixed-size linear algebra and numerical methods in C++26.
Loading...
Searching...
No Matches
linalg::StandardInnerProduct< Vec > Struct Template Reference

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.
 

Detailed Description

template<FieldVector Vec>
struct linalg::StandardInnerProduct< Vec >

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.

Template Parameters
VecField-vector domain. cv/ref qualification is normalized in the associated types.

Definition at line 34 of file inner_product.hpp.

Member Typedef Documentation

◆ codomain_type

template<FieldVector Vec>
using linalg::StandardInnerProduct< Vec >::codomain_type = scalar_type

Scalar result type; equal to scalar_type.

Definition at line 40 of file inner_product.hpp.

◆ domain_type

template<FieldVector Vec>
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.

◆ scalar_type

template<FieldVector Vec>
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.

Member Function Documentation

◆ operator()()

template<FieldVector Vec>
constexpr codomain_type linalg::StandardInnerProduct< Vec >::operator() ( const domain_type &  lhs,
const domain_type &  rhs 
) const
inlineconstexpr

Pair two vectors from the same domain.

Parameters
lhsFirst argument; conjugated element-wise for a complex field.
rhsSecond argument; never conjugated.
Returns
Scalar inner-product value.

Definition at line 48 of file inner_product.hpp.

References linalg::mat_rows_v.


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