Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::linear_algebra::Diagonal< D, F > Struct Template Referenceexport

Diagonal matrix carrier M: D×D → T parametric in dimension D and diagonal rule F. More...

Collaboration diagram for dedekind::linear_algebra::Diagonal< D, F >:

Public Types

using scalar_type = typename std::remove_cvref_t<F>::Codomain
using rule_domain_type = typename std::remove_cvref_t<F>::Domain
using dimension_type = D

Public Member Functions

template<typename Idx>
requires dedekind::order::IsDirectedSet<Idx> && std::convertible_to<Idx, rule_domain_type>
constexpr scalar_type at (Idx const &i) const
 Diagonal entry at row = col = i.
template<typename I, typename J>
requires dedekind::order::IsDirectedSet<I> && dedekind::order::IsDirectedSet<J> && std::convertible_to<I, rule_domain_type> && std::convertible_to<J, rule_domain_type>
constexpr scalar_type operator() (I const &i, J const &j) const
 Matrix entry (i,j) = δ_ij · F(i). Returns T{} off-diagonal. Equality of indices is decided after conversion to the rule's Domain — both I and J need only be net-domain-convertible to it.

Public Attributes

F rule

Static Public Attributes

static constexpr bool is_finite = D::is_finite

Detailed Description

template<typename D, typename F>
requires IsDimension<D> && dedekind::category::IsArrow<F>
struct dedekind::linear_algebra::Diagonal< D, F >

Diagonal matrix carrier M: D×D → T parametric in dimension D and diagonal rule F.

diagonal__Diagonal_Carrier

Template Parameters
DDimension witness (dim_finite<N> or ℵ<N>).
FDiagonal rule, an IsArrow with Domain = size_t and scalar Codomain.

Stored intensionally — the rule F is the carrier; the dense D×D entry table is never materialised. Works uniformly at any D, including ℵ_0. Off-diagonal entries are T{} (the additive zero), per the δ_ij convention.

Note
Relational incarnation: a Diagonal is the matrix reading of a Trsk coreflexive dedekind::relational::diag(S) — the partial identity \(\Delta_S = \{(x,x)\mid x\in S\}\). The diagonal rule F is exactly S's characteristic function (over the logic semiring 𝔹), so Diagonal<D, χ_S> ≅ diag(S) and Identity<D> ≅ the full diagonal diag(𝔸) (DiagPred). Both are point-free (rule, not table): the same partial-identity operator on the linear-algebra and relational surfaces. FIXME(#873): the concrete coreflexive↔Diagonal bridge.

Member Function Documentation

◆ at()

template<typename D, typename F>
template<typename Idx>
requires dedekind::order::IsDirectedSet<Idx> && std::convertible_to<Idx, rule_domain_type>
scalar_type dedekind::linear_algebra::Diagonal< D, F >::at ( Idx const & i) const
inlineconstexpr

Diagonal entry at row = col = i.

Idx is parametric over any IsDirectedSet that converts to the rule's Domain — keeps the eval surface intensional in the index theory (the rule decides what kind of net domain it dispatches on; std::size_t is one inhabitant, ℕ another).


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