akreon-linalg
Fixed-size linear algebra and numerical methods in C++26.
Loading...
Searching...
No Matches
endomorphism.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
8#include "operator_traits.hpp"
9
10namespace linalg {
11
15template <SquareMatrix Mat, typename Derived>
20 using ComplexT = std::complex<ScalarT>;
21
23 static constexpr std::size_t N = mat_rows_v<Mat>;
24
33 constexpr const T& operator()(std::size_t i, std::size_t j) const {
34 return self()(i, j);
35 }
36
45 constexpr T& operator()(std::size_t i, std::size_t j) { return self()(i, j); }
46
52 constexpr Derived& self() { return static_cast<Derived&>(*this); }
53
59 constexpr const Derived& self() const {
60 return static_cast<const Derived&>(*this);
61 }
62};
63
64} // namespace linalg
typename scalar_traits_t< T >::real_type real_type_t
Associated real component type registered for T.
constexpr std::size_t mat_rows_v
Registered compile-time row count after cv/ref normalization.
typename mat_traits< remove_cvref_t< Mat > >::value_type matrix_scalar_t
Registered matrix scalar type after cv/ref normalization.
Endomorphism operator CRTP base.
std::complex< ScalarT > ComplexT
constexpr const T & operator()(std::size_t i, std::size_t j) const
get element at (i,j) index
constexpr Derived & self()
self
matrix_scalar_t< Mat > T
alias helpers for types
static constexpr std::size_t N
helper to extract N
constexpr T & operator()(std::size_t i, std::size_t j)
get element at (i,j) index
constexpr const Derived & self() const
self
real_type_t< T > ScalarT