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

Hessian as a linear operator. More...

#include <hessian.hpp>

Inheritance diagram for linalg::Hessian< Mat, Type >:
[legend]

Public Types

using OperatorBase = Endomorphism< Mat, Hessian< Mat, Type > >
 alias from base class
 
using Vec = linalg::Vector< T, N >
 alias to bring in vec
 
using T = matrix_scalar_t< Mat >
 alias helpers for types
 
- Public Types inherited from linalg::Endomorphism< Mat, Derived >
using T = matrix_scalar_t< Mat >
 alias helpers for types
 
using ScalarT = real_type_t< T >
 
using ComplexT = std::complex< ScalarT >
 

Public Member Functions

constexpr Hessian (const Mat &A)
 CTOR.
 
constexpr auto operator() (std::size_t i, std::size_t j) const
 get element at (i,j)
 
template<MatrixContainer MatX>
requires (N == mat_rows_v<MatX>)
constexpr auto apply (const MatX &X) const
 apply
 
constexpr auto apply (const Vec &x) const
 apply
 
constexpr auto apply (const T &a) const
 apply
 
constexpr bool is_pullback () const
 is pullback
 
- Public Member Functions inherited from linalg::Endomorphism< Mat, Derived >
constexpr const T & operator() (std::size_t i, std::size_t j) const
 get element at (i,j) index
 
constexpr T & operator() (std::size_t i, std::size_t j)
 get element at (i,j) index
 
constexpr Derived & self ()
 self
 
constexpr const Derived & self () const
 self
 

Public Attributes

Mat H
 member variables
 

Static Public Attributes

static constexpr std::size_t N
 helper from base to get num rows
 
- Static Public Attributes inherited from linalg::Endomorphism< Mat, Derived >
static constexpr std::size_t N = mat_rows_v<Mat>
 helper to extract N
 

Detailed Description

template<SquareMatrix Mat, DifferentialType Type = DifferentialType::PUSHFORWARD>
struct linalg::Hessian< Mat, Type >

Hessian as a linear operator.

forward declaration of hessian

pushforward H: A(X) -> B, acts as a push-forward operator mapping primal / tangent vectors onto a change of gradient (i.e., F''(w)x -> s)

pullback H^{-1}: B(x) -> A, (i.e., F''(w)^{-1} s -> x) acts as a pull-back operator mapping gradient space vectors back to tangent / primal direction

Definition at line 25 of file hessian.hpp.

Member Typedef Documentation

◆ OperatorBase

template<SquareMatrix Mat, DifferentialType Type = DifferentialType::PUSHFORWARD>
using linalg::Hessian< Mat, Type >::OperatorBase = Endomorphism<Mat, Hessian<Mat, Type> >

alias from base class

Definition at line 27 of file hessian.hpp.

◆ T

template<SquareMatrix Mat, DifferentialType Type = DifferentialType::PUSHFORWARD>
using linalg::Endomorphism< Mat, Derived >::T = matrix_scalar_t<Mat>

alias helpers for types

Definition at line 18 of file endomorphism.hpp.

◆ Vec

template<SquareMatrix Mat, DifferentialType Type = DifferentialType::PUSHFORWARD>
using linalg::Hessian< Mat, Type >::Vec = linalg::Vector<T, N>

alias to bring in vec

Definition at line 34 of file hessian.hpp.

Constructor & Destructor Documentation

◆ Hessian()

template<SquareMatrix Mat, DifferentialType Type = DifferentialType::PUSHFORWARD>
constexpr linalg::Hessian< Mat, Type >::Hessian ( const Mat &  A)
inlineexplicitconstexpr

CTOR.

Parameters
Ain R^{n x n}

Definition at line 41 of file hessian.hpp.

Member Function Documentation

◆ apply() [1/3]

template<SquareMatrix Mat, DifferentialType Type = DifferentialType::PUSHFORWARD>
template<MatrixContainer MatX>
requires (N == mat_rows_v<MatX>)
constexpr auto linalg::Hessian< Mat, Type >::apply ( const MatX &  X) const
inlineconstexpr

apply

H : A(X) -> B H^{-1} : B(X) -> A

Parameters
MatX
Returns
B or A pending on diffeomorphism

Definition at line 64 of file hessian.hpp.

References linalg::Hessian< Mat, Type >::H, and linalg::mat_rows_v.

◆ apply() [2/3]

template<SquareMatrix Mat, DifferentialType Type = DifferentialType::PUSHFORWARD>
constexpr auto linalg::Hessian< Mat, Type >::apply ( const T &  a) const
inlineconstexpr

apply

H : H(a) = aH (same for inv)

Parameters
ascalar
Returns
scaled operator

Definition at line 89 of file hessian.hpp.

References linalg::Hessian< Mat, Type >::H, and linalg::mat_rows_v.

◆ apply() [3/3]

template<SquareMatrix Mat, DifferentialType Type = DifferentialType::PUSHFORWARD>
constexpr auto linalg::Hessian< Mat, Type >::apply ( const Vec &  x) const
inlineconstexpr

apply

H : A(x) -> b H^{-1} : A^{-1}(b) = x

Parameters
Vecx
Returns
b or x pending on diffeomorphism

Definition at line 78 of file hessian.hpp.

References linalg::Hessian< Mat, Type >::H.

◆ is_pullback()

template<SquareMatrix Mat, DifferentialType Type = DifferentialType::PUSHFORWARD>
constexpr bool linalg::Hessian< Mat, Type >::is_pullback ( ) const
inlineconstexpr

is pullback

Returns
T/F

Definition at line 96 of file hessian.hpp.

References linalg::mat_rows_v, and linalg::PULLBACK.

◆ operator()()

template<SquareMatrix Mat, DifferentialType Type = DifferentialType::PUSHFORWARD>
constexpr auto linalg::Hessian< Mat, Type >::operator() ( std::size_t  i,
std::size_t  j 
) const
inlineconstexpr

get element at (i,j)

Returns
element

Definition at line 48 of file hessian.hpp.

References linalg::Hessian< Mat, Type >::H, and linalg::mat_rows_v.

Member Data Documentation

◆ H

template<SquareMatrix Mat, DifferentialType Type = DifferentialType::PUSHFORWARD>
Mat linalg::Hessian< Mat, Type >::H

◆ N

template<SquareMatrix Mat, DifferentialType Type = DifferentialType::PUSHFORWARD>
constexpr std::size_t linalg::Endomorphism< Mat, Derived >::N
staticconstexpr

helper from base to get num rows

Definition at line 23 of file endomorphism.hpp.


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