akreon-linalg
Fixed-size linear algebra and numerical methods in C++26.
Loading...
Searching...
No Matches
hessian.hpp
Go to the documentation of this file.
1/*
2 * Copyright © 2025-2026 Akreon LLC
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6#pragma once
7
9
10namespace linalg {
11
23template <SquareMatrix Mat,
25struct Hessian : Endomorphism<Mat, Hessian<Mat, Type>> {
29
31 using OperatorBase::N;
32
35
41 constexpr explicit Hessian(const Mat& A) : H(A) {}
42
48 constexpr auto operator()(std::size_t i, std::size_t j) const {
49 return H(i, j);
50 }
51
62 template <MatrixContainer MatX>
63 requires(N == mat_rows_v<MatX>)
64 constexpr auto apply(const MatX& X) const {
65 return H * X;
66 }
67
78 constexpr auto apply(const Vec& x) const { return H * x; }
79
89 constexpr auto apply(const T& a) const { return a * H; }
90
96 constexpr bool is_pullback() const {
98 }
99
101 Mat H;
102};
103
104} // namespace linalg
DifferentialType
differential type
constexpr std::size_t mat_rows_v
Registered compile-time row count after cv/ref normalization.
Endomorphism operator CRTP base.
matrix_scalar_t< Mat > T
alias helpers for types
static constexpr std::size_t N
helper to extract N
Hessian as a linear operator.
Definition hessian.hpp:25
constexpr auto apply(const MatX &X) const
apply
Definition hessian.hpp:64
constexpr Hessian(const Mat &A)
CTOR.
Definition hessian.hpp:41
matrix_scalar_t< Mat > T
alias helpers for types
static constexpr std::size_t N
helper from base to get num rows
constexpr auto apply(const Vec &x) const
apply
Definition hessian.hpp:78
constexpr auto apply(const T &a) const
apply
Definition hessian.hpp:89
Mat H
member variables
Definition hessian.hpp:101
constexpr bool is_pullback() const
is pullback
Definition hessian.hpp:96
constexpr auto operator()(std::size_t i, std::size_t j) const
get element at (i,j)
Definition hessian.hpp:48
Owning, fixed-size vector container.
Definition vector.hpp:36