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

Compact representation of a real or complex Householder reflector. More...

#include <householder.hpp>

Public Member Functions

constexpr HouseholderVector (const Vector< T, N > &x)
 Construct a compact Householder reflector for x.
 

Public Attributes

Vector< T, N > v
 Reflector direction vector.
 
real_type_t< T > beta
 Real coefficient in I - beta * v * v^*.
 

Detailed Description

template<typename T, std::size_t N>
requires (Field<T> && N > 0)
struct linalg::HouseholderVector< T, N >

Compact representation of a real or complex Householder reflector.

The stored v and real coefficient beta represent P = I - beta * v * v^T over a real field and P = I - beta * v * v^* over a complex field. Construction follows the Golub and Van Loan algorithm and selects a numerically stable leading coordinate. Applying the reflector maps the input toward a multiple of the first coordinate vector. For a non-axis real input, that multiple has the opposite sign to the leading input coordinate to avoid cancellation.

For N == 1, the representation is the identity reflector (v = [1], beta = 0). A zero complex input similarly requires no reflector.

Template Parameters
TReal or complex field scalar.
NPositive compile-time vector dimension.

Definition at line 35 of file householder.hpp.

Constructor & Destructor Documentation

◆ HouseholderVector()

template<typename T , std::size_t N>
constexpr linalg::HouseholderVector< T, N >::HouseholderVector ( const Vector< T, N > &  x)
inlineconstexpr

Construct a compact Householder reflector for x.

Parameters
[in]xVector to reduce toward the first coordinate axis.

Definition at line 41 of file householder.hpp.

Member Data Documentation

◆ beta

template<typename T , std::size_t N>
real_type_t<T> linalg::HouseholderVector< T, N >::beta

Real coefficient in I - beta * v * v^*.

Definition at line 46 of file householder.hpp.

◆ v

template<typename T , std::size_t N>
Vector<T, N> linalg::HouseholderVector< T, N >::v

Reflector direction vector.

Definition at line 45 of file householder.hpp.


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